2
votes

I have Maven 3.x.x and defined MAVEN VERSIONS Plugin in ~/.m2/settings.xml (global user level file) where I have valid .. and plugin configuration set for maven-versions-plugin and maven-enforcer-plugin etc.

(Maven inheritance and aggregation is used among these subprojects referring parent project)

Project structure :

pom.xml
 module1/pom.xml
 module1/src/main/resources/module1/pom.xml
 module1/src/main/resources/module1/src/somemorefileshere

 module2.pom.xml

 module3/pom.xml
 module3/src/main/resources/module3/pom.xml
 module3/src/main/resources/module3/src/somemorefileshere

When I run the following command in this multi-module project setup:

$ mvn versions:set -DnewVersion=0.0.1

It successfully changes all occurrences of 0.0.1-SNAPSHOT in parent (project root level pom.xml) and sub-project/modulesX level pom.xml files BUT it didn't make the changes in the following files:

 module1/src/main/resources/module1/pom.xml
 module3/src/main/resources/module3/pom.xml

Questions:
1) Is it because these files sit under "src/main/resources" folder??

2) If the plugin info is configured in ~/.m2/settings.xml then do I still need to update the same in pom.xml (I don't think so).

3) Do I have to specify ... section where we specify "url", "connection", "developerConnection" values in root level project pom.xml OR it has to be placed in every sub-project/moduleX pom.xml? I think, root level pom.xml should suffice.

4) Even though each sub-project/moduleX pom.xml is successfully changing from 0.0.1-SNAPSHOT to 0.0.1 (as the version I'm setting), I get the following output once versions:set is complete. Why it's showing "SKIPPED" for those modulesX when it actually replaced the values successfully. Does this means, I have to have ... section in those sub-project/moduleX's pom.xml file as well??

19:54:40 [INFO] ------------------------------------------------------------------------
19:54:40 [INFO] Reactor Summary:
19:54:40 [INFO] 
19:54:40 [INFO] main-parent ........................................ SUCCESS [  3.082 s]
19:54:40 [INFO] module1          ................................... SKIPPED
19:54:40 [INFO] module2   .......................................... SKIPPED
19:54:40 [INFO] module3   .......................................... SKIPPED

5) Do I need to include "maven-enforcer-plugin" configuration in every root level / sub-project level (moduleX) level pom.xml?? --OR ~/.m2/setting.xml level pom should suffice?

1

1 Answers

1
votes

because those looks like archetype pom.xml files (Template files) it doesn't process them, it just touches those are connected in maven POMdel