User Tools

Site Tools


maven

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
maven [2015/05/08 12:49]
mihael
maven [2016/05/27 09:39] (current)
mihael [Skip Unit test]
Line 1: Line 1:
 ====== Maven ====== ====== Maven ======
 +
 +===== Update Parent POM Version in Modules =====
 +If the project structure is the following:
 +<​code>​
 + ​Parent POM
 +     +
 +     |
 +     ​+--->​ Module 1
 +     |
 +     ​+--->​ Module 2
 +     |
 +     ​+--->​ Module 3
 +</​code>​
 +
 +and the modules inherit the version from the parent pom then it is a PITA to update all modules with the new parent pom version when the parent pom version is incremented.
 +
 +An easy way for this is the following command which will update the parent pom version in the modules with the version in the parent pom project.
 +
 +  mvn -N versions:​update-child-modules
 +
 +<note tip>By default this command will generate a backup version of each updated pom. To drop the generation of backups add the parameter ''​generateBackupPoms=false''​ to the maven command.</​note>​
 +
 +Found on [[http://​www.mojohaus.org/​versions-maven-plugin/​examples/​update-child-modules.html|Mojohaus.org]].
  
 ===== Manifest.merge Error in Eclipse ===== ===== Manifest.merge Error in Eclipse =====
Line 5: Line 28:
   org.codehaus.plexus.archiver.jar.Manifest.merge(org.codehaus.plexus.archiver.jar.Manifest)   org.codehaus.plexus.archiver.jar.Manifest.merge(org.codehaus.plexus.archiver.jar.Manifest)
   ​   ​
-This error only occurs in Eclipse. The maven-jar-plugin ​needs to be added to the Eclipse m2e lifecycle mapping:+This error only occurs in Eclipse. The Eclipse Plugin for the Maven Archiver ​needs to be updated with this update site:
  
-<sxh xml> +  http://​repo1.maven.org/​maven2/​.m2e/​connectors/​m2eclipse-mavenarchiver/​0.17.0/​N/​LATEST/​
-<​build>​+
  
-<​pluginManagement>​ +See http://stackoverflow.com/​questions/​28351678/org-codehaus-plexus-archiver-jar-manifest-mergeorg-codehaus-plexus-archiver-jar
- <​plugins>​ +
- <​!--This plugin'​s configuration is used to store Eclipse m2e settings  +
- only. It has no influence on the Maven build itself. --> +
- <​plugin>​ +
- <​groupId>​org.eclipse.m2e<​/groupId>​ +
- <​artifactId>​lifecycle-mapping<​/artifactId>​ +
- <​version>​1.0.0</version>​ +
- <​configuration>​ +
- <​lifecycleMappingMetadata>​ +
- <​pluginExecutions>​ +
- <​pluginExecution>​ +
- <​pluginExecutionFilter>​ +
- <​groupId>​org.apache.felix</​groupId>​ +
- <​artifactId>​maven-jar-plugin</​artifactId>​ +
- <​versionRange>​[2.6,​)</​versionRange>​ +
- <​goals>​ +
- <​goal>​manifest</​goal>​ +
- </​goals>​ +
- </​pluginExecutionFilter>​ +
- <​action>​ +
- <​ignore></​ignore>​ +
- </​action>​ +
- </​pluginExecution>​ +
- </​pluginExecutions>​ +
- </​lifecycleMappingMetadata>​ +
- </​configuration>​ +
- </​plugin>​ +
- </​plugins>​ +
-</​pluginManagement>​ +
- +
-</​build>​ +
-</​sxh>​+
   ​   ​
   ​   ​
Line 83: Line 73:
     -Dpackaging=jar     -Dpackaging=jar
 </​code>​ </​code>​
 +
 +===== Skip Unit test =====
 +
 +Use the Java property ''​-Dmaven.test.skip=true''​ to skip unit tests.
  
 ===== Embed Dependencies ===== ===== Embed Dependencies =====
maven.1431089387.txt.gz · Last modified: 2015/05/08 12:49 by mihael