Follow the following steps in order to reproduce a bug in version 2.4 of the maven-war-plugin.
- Clone this repository and
cd
into it. Notice that I am using version 2.4 of the maven-war-plugin in pom.xml, which was the latest version of it at publish time. mvn clean verify
- Observe the reproduced bug
cat target/maven-war-plugin-bug-0.0.1-SNAPSHOT/app.properties
. Only the properties that were specified in pom.xml itself were filtered into app.properties. None of the properties from default.properties were filtered into this file.cat target/classes/app.properties
. Notice here, though, that both the properties frompom.xml
anddefault.properties
made it intoapp.properties
.
- Edit pom.xml to change the version of maven-war-plugin from 2.4 to 2.3.
- Rerun
mvn clean verify
- Observe the bug no longer reproduced
cat target/maven-war-plugin-bug-0.0.1-SNAPSHOT/app.properties
andcat target/classes/app.properties
should produce the same output.
Without being able to filter app.properties correctly, I will not be able to inject my properties into my Java application (for example, through Dependency Injection frameworks like Guice). The version of the file in target/classes
is not available to my classpath, but the version of the file in target/maven-war-plugin-bug-0.0.1-SNAPSHOT
is and therefore is where my application will read the properties from.
Until this bug is fixed, I and all other people affected by this bug will be forced to use an older version of the plugin such as 2.3.