Uploaded image for project: 'WildFly Maven Plugin'
  1. WildFly Maven Plugin
  2. WFMP-172

backslashes stripped from propertiesFiles values on Windows.

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 4.0.0.Alpha2
    • Maven Plugin
    • None

      On windows one must add 15 backslashes for each single backslash in (windows style)
      property value.  (see https://issues.redhat.com/browse/WFCORE-5982)

      There is no documentation that describes the usages cases.
      As long as the property value is in unix-style format there is no issue,
      however if the user is (auto-generating) the value in maven then the user
      must convert all window's formated text to unix format or windows format. 
      (e.g.

        <propertyfile file="${basedir}/target/my-cli.properties">
          <entry key="testResourcesDir" value="${basedir}/target/resources/test.truststore"/>
        </propertyfile>

      )

      On windows text "${basedir}/target/my-cli.properties" MUST be converted to 
      WINDOW's format because it is being used to create a new file.  Text 
      "${basedir}/target/resources/test.truststore" must be converted to be fully
      unix format (e.g. ${basedir} must be converted) or the full string must be
      converted to window's format, in which case all '/' must be replaced with '\'
      and each '\' MUST have 15 more '\' prefixed to it.  An initial testResourcesDir
      value, A:\home\me\project/target/resources/test.truststore must be converted
      to A:\\\\\\\\\\\\\\\\home\\\\\\\\\\\\\\\\me\\\\\\\\\\\\\\\\project\\\\\\\\\\\\\\\\target\\\\\\\\\\\\\\\\resources\\\\\\\\\\\\\\\\test.truststore

      This is because wildfly-maven-plugin strips half the '\' when it reads the property
      value.  It writes value to the cmd-line like this 
        -DtestResourcesDir=A:\\\\\\\\home\\\\\\\\me\\\\\\\\project\\\\\\\\target\\\\\\\\resources\\\\\\\\test.truststore

      Widfly CLI strips half the '\' when it reads the runtime property which then is
      testResourcesDir=A:\\\\home\\\\me\\\\\project\\\\target\\\\resources\\\\test.truststore
      Internally CLI must do one more stream read because another set of backslashes
      are removed to produce a final cmd path, A:\\home\\me\\\project\\target\\resources
      test.truststore

      A secondary issue with the handling of property values is window's formated text 
      within quotation marks is always altered.  It is expected that text within
      quotation marks is not altered.

       

      Project https://github.com/rsearls/cwbug.git is provided to demonstrate the issue.

            Unassigned Unassigned
            rsearls r searls
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: