Plugin Configuration
Example to use the 1jar-maven-plugin
Known bugs of Plugin
This plugin is not available in the standard maven repository! But you can download it via the following repository entry in your pom.xml
For Download Plugin from Sourceforge, please add this to your pom.xml
<pluginRepositories> <pluginRepository> <id>sourceforge</id> <name>SF Maven Plugin Repository</name> <url>http://sf-mvn-plugins.svn.sourceforge.net/svnroot/sf-mvn-plugins/_m2-repo</url> <snapshots> <enabled>true</enabled> </snapshots> </pluginRepository> </pluginRepositories>
You should be use the wagon-http-sourceforge extension to download it in your pom.xml
<repositories> <repository> <id>sourceforge-svn</id> <name>SF Maven Plugin SVN Repository</name> <url>http://sf-mvn-plugins.svn.sourceforge.net/svnroot/sf-mvn-plugins/_m2-repo/trunk</url> </repository> </repositories> <build> <extensions> <extension> <groupId>net.sf.maven.plugins</groupId> <artifactId>wagon-http-sourceforge</artifactId> <version>0.4</version> </extension> </extensions> : </build>
Add the files to your local maven repository, like this:
mvn install:install-file \ -DgroupId=com.ice -DartifactId=registry -Dversion=3.1.3 -Dpackaging=jar -Dfile=registry.jar
mvn install:install-file \ -DgroupId=com.ice -DartifactId=ICE_JNIRegistry -Dversion=3.1.3 -Dpackaging=dll -Dfile=ICE_JNIRegistry.dll
This will build the following structure in the local m2 repository.
m2\com\ice\registry\3.1.3\registry-3.1.3.jar m2\com\ice\ICE_JNIRegistry\3.1.3\ICE_JNIRegistry-3.1.3.dll
Download and install the one-jar file to your local maven repository.
<build> <plugins> <plugin> <groupId>net.sf.maven.plugins</groupId> <artifactId>jar-install-plugin</artifactId> <executions> <execution> <goals> <goal>install</goal> </goals> <configuration> <downloads> <downloadArtifact> <url>http://sourceforge.net/projects/one-jar/files/one-jar/one-jar-0.97/one-jar-boot-0.97.jar/download</url> <groupId>com.simontuffs.onejar</groupId> <artifactId>one-jar-boot</artifactId> <version>0.97</version> </downloadArtifact> </downloads> </configuration> </execution> </executions> </plugin> : </plugins> </build>
In a project you can use the archives as dependency. Attention pleas you need one-jar dependency in your porject. Because the one-jar will be part of your target jar.
<dependencies> <dependency> <groupId>com.ice</groupId> <artifactId>registry</artifactId> <version>3.1.3</version> <type>jar</type> <scope>compile</scope> </dependency> <dependency> <groupId>com.ice</groupId> <artifactId> ICE_JNIRegistry </artifactId> <version>3.1.3</version> <type>dll</type> <scope>compile</scope> </dependency> <dependency> <groupId>com.simontuffs.onejar</groupId> <artifactId>one-jar-boot</artifactId> <version>0.97</version> <scope>runtime</scope> </dependency> </dependencies>
<build> <plugins> <plugin> <groupId>net.sf.maven.plugins</groupId> <artifactId>1jar-maven-plugin</artifactId> <version>0.2</version> <executions> <execution> <goals> <goal>1jar</goal> </goals> <configuration> <mainClass> info.thomas_michel.lib.win.Main </mainClass> <stripVersion>false</stripVersion> <fileNameMap> <ICE_JNIRegistry-3.1.3.dll> ICE_JNIRegistry.dll </ICE_JNIRegistry-3.1.3.dll> </fileNameMap> </configuration> </execution> </executions> </plugin> </plugins> </build>
mvn clean package