Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-2449

Resource filtering does not use Maven properties specified on the mvn command line via -D command line switches

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • maven-bundle-plugin-2.0.1
    • maven-bundle-plugin-2.3.5
    • Maven Bundle Plugin
    • None

    Description

      Inside my pom, I have the following properties specified:
      <derby.host>localhost</derby.host>
      <derby.port>1527</derby.port>

      I also turn on resource filtering using the following in my pom:
      <resources>
      <resource>
      <directory>src/main/resources</directory>
      <filtering>true</filtering>
      </resource>
      </resources>

      In the src/main/resources directory, there is file named jdbc.properties which contains the following:
      jdbc.driverClassName=org.apache.derby.jdbc.ClientDriver
      jdbc.url=jdbc:derby://${derby.host}:${derby.port}/test
      jdbc.username=mri
      jdbc.password=test

      When I run mvn install on my project, jdbc.properties is properly included into the final bundle jar as follows:
      jdbc.driverClassName=org.apache.derby.jdbc.ClientDriver
      jdbc.url=jdbc:derby://localhost:1527/test
      jdbc.username=mri
      jdbc.password=test

      When I run mvn install -Dderby.host=jkwdev -Dderby.port=1600, the filtering of jdbc.properties before packaging into the bundle jar does not honor the properties I specifed on the command line. target/classes contains this:

      jdbc.driverClassName=org.apache.derby.jdbc.ClientDriver
      jdbc.url=jdbc:derby://jkwdev:1600/test
      jdbc.username=mri
      jdbc.password=test

      But, the bundle jar contains this:
      jdbc.driverClassName=org.apache.derby.jdbc.ClientDriver
      jdbc.url=jdbc:derby://localhost:1527/test
      jdbc.username=mri
      jdbc.password=test

      Attachments

        Activity

          People

            mcculls Stuart McCulloch
            jkwuc89 Keith Wedinger
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: