0

I have two different java modules A and B, where A is a dependecy of B. In both modules I have a .property file:

operation=${my-prop}

The value of ${my-prop} is different depending on module (I have a property inside the main pom of each module, the value is "true" inside A and "false" inside B)

In the pom of each module there is:

 <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.1.0</version>
                <configuration>
                    <resources>
                        <resource>
                            <directory>src/main/resources</directory>
                            <filtering>true</filtering>
                        </resource>
                    </resources>
                    <overwrite>true</overwrite>
                    <nonFilteredFileExtensions>
                        <nonFilteredFileExtension>nix64</nonFilteredFileExtension>
                    </nonFilteredFileExtensions>
                </configuration>
            </plugin>

When I build module A, inside the jar I can see the correct .property file (operation=true); insted, when I build module B, inside the jar I find the .property file of A (operation=true); any suggestion?

S-Wing
  • 485
  • 6
  • 25
  • Why are you using the same property ? – Ehud Lev Nov 05 '19 at 16:48
  • Because inside module A (that then is imported also in module B) there is some code that read that property and has different behaviour depending on the value of that property. If I use different properties for each module than I have to override also the code in each module (in order to read a property with a different name). – S-Wing Nov 06 '19 at 08:20

0 Answers0