User Tools

Site Tools



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 [2014/03/04 09:15]
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:
 + ​Parent POM
 +     +
 +     |
 +     ​+--->​ Module 1
 +     |
 +     ​+--->​ Module 2
 +     |
 +     ​+--->​ Module 3
 +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://​​versions-maven-plugin/​examples/​update-child-modules.html|]].
 +===== Manifest.merge Error in Eclipse =====
 +  org.codehaus.plexus.archiver.jar.Manifest.merge(org.codehaus.plexus.archiver.jar.Manifest)
 +  ​
 +This error only occurs in Eclipse. The Eclipse Plugin for the Maven Archiver needs to be updated with this update site:
 +  http://​​maven2/​.m2e/​connectors/​m2eclipse-mavenarchiver/​0.17.0/​N/​LATEST/​
 +See http://​​questions/​28351678/​org-codehaus-plexus-archiver-jar-manifest-mergeorg-codehaus-plexus-archiver-jar
 +  ​
 +  ​
 +===== Copy Maven Artifact on Build =====
 +<sxh xml;title: pom.xml>
 + <​plugins>​
 + <​plugin>​
 + <​groupId>​org.codehaus.mojo</​groupId>​
 + <​artifactId>​wagon-maven-plugin</​artifactId>​
 + <​version>​1.0-beta-5</​version>​
 + <​executions>​
 + <​execution>​
 + <​id>​upload-jar-to-folder</​id>​
 + <​phase>​deploy</​phase>​
 + <​goals>​
 + <​goal>​upload</​goal>​
 + </​goals>​
 + </​execution>​
 + </​executions>​
 + <​configuration>​
 + <​fromDir>​${}</​fromDir>​
 + <​includes>​${}.${project.packaging}</​includes>​
 + <​url>​file:///​opt/​karaf</​url>​
 + <​toDir>​deploy</​toDir>​
 + </​configuration>​
 + </​plugin>​
 + </​plugins>​
 ===== Add 3rd Party Library ===== ===== Add 3rd Party Library =====
Line 11: 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 =====
-Wenn man die abhängigen Java Bibliotheken in einem OSGi Bundle einbetten will, kann man das Maven Bundle Plugin ​nutzenHierzu konfiguriert man die Java Bibliotheken,​ die als OSGi Bundle im OSGi Container vorliegen, als <​code>​scope: provided</​code>​ anDie Java Bibliotheken,​ die eingebetten werden sollen, konfiguriert man als <​code>​scope: compile</​code>​.+If all dependencies should be embedded into one jar then the Maven Bundle Plugin ​can be usedAll dependencies which should be installed as their own bundle should be configured as ''​scope: provided''​All dependencies which should be embedded should be configured as ''​scope: compile''​.
   <​Embed-Dependency>​*;​scope=compile</​Embed-Dependency>​   <​Embed-Dependency>​*;​scope=compile</​Embed-Dependency>​
-Damit alle transitiven (nicht direkten) Abhängigkeiten auch eingebettet werden muss folgende Anweisung benutzt werden:+To embed all transitive dependencies the following configuration must be added to the pom.xml:
   <​Embed-Transitive>​true</​Embed-Transitive>​   <​Embed-Transitive>​true</​Embed-Transitive>​
-Das Maven Bundle Plugin ​sorgt dafür, dass die eingebetteten Java Bibliotheken in dem OSGi Bundle landen und passt das Manifest an (Bundle-ClassPath).+The Maven Bundle Plugin ​embeds all configured dependencies and adjusts the Bundle-ClassPath ​in the Manifest file.
-== Beispiel ​==+==== Example ====
 <sxh xml> <sxh xml>
   <​build>​   <​build>​
maven.1393924533.txt.gz · Last modified: 2014/03/04 09:15 by mihael