0

Kopie eines Jars aus dem Repository in ein Modulverzeichnis

Posted by admin on June 25, 2012 in Maven |

F�r das Schn�ren eines Software-Paketes ben�tigte ich ein JAR aus meinem Artifactory. Diese Dependency sollte lediglich in ein entsprechendes Output-Directory kopiert werden. Das Maven Dependency-Plugin hat die Aufgabe l�sen k�nnen. Der folgende Pom-Auschnitt kopiert ein Jar (siehe artifactItem) in das konfigurierte OutputDirecory.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<build>
�� �<plugins>
�� ��� �<plugin>
�� ��� ��� �<groupId>org.apache.maven.plugins</groupId>
�� ��� ��� �<artifactId>maven-dependency-plugin</artifactId>
�� ��� ��� �<version>2.4</version>
�� ��� ��� �<executions>
�� ��� ��� ��� �<execution>
�� ��� ��� ��� ��� �<id>copy</id>
�� ��� ��� ��� ��� �<phase>package</phase>
�� ��� ��� ��� ��� �<goals>
�� ��� ��� ��� ��� ��� �<goal>copy</goal>
�� ��� ��� ��� ��� �</goals>
�� ��� ��� ��� ��� �<configuration>
�� ��� ��� ��� ��� ��� �<artifactItems>
�� ��� ��� ��� ��� ��� ��� �<artifactItem>
�� ��� ��� ��� ��� ��� ��� ��� �<groupId>de.analysisfreaks</groupId>
�� ��� ��� ��� ��� ��� ��� ��� �<artifactId>modulename</artifactId>
�� ��� ��� ��� ��� ��� ��� ��� �<version>1.0.0-SNAPSHOT</version>
�� ��� ��� ��� ��� ��� ��� ��� �<classifier>jar-with-dependencies</classifier>
�� ��� ��� ��� ��� ��� ��� ��� �<overWrite>true</overWrite>
�� ��� ��� ��� ��� ��� ��� ��� �<outputDirectory>${project.build.directory}</outputDirectory>
�� ��� ��� ��� ��� ��� ��� �</artifactItem>�� ��� ��� ��� ��� ��� ��� ��� �
�� ��� ��� ��� ��� ��� �</artifactItems>
�� ��� ��� ��� ��� ��� �<overWriteReleases>false</overWriteReleases>
�� ��� ��� ��� ��� ��� �<overWriteSnapshots>true</overWriteSnapshots>
�� ��� ��� ��� ��� �</configuration>
�� ��� ��� ��� �</execution>
�� ��� ��� �</executions>
�� ��� �</plugin>
�� �</plugins>
</build>

Beispiele aus der Plugin-Doku: http://maven.apache.org/plugins/maven-dependency-plugin/examples/copying-artifacts.html

Tags: , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Copyright © 2010-2025 Analysisfreaks.de All rights reserved.
This site is using the Desk Mess Mirrored theme, v2.0.4, from BuyNowShop.com.

Developed by Hardik