There are situations when a .jar is required by a maven project, but it is not available in any repository. One needs a solution to make it a dependency in one's project. There are two solutions: including the .jar manually in your local repository and declare a
systemPath.Manual Inclusion in Local Repository
This requires a separate maven project based on the following pom.xml:<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>net.mypackage</groupId>
<artifactId>MavenMissingJars</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>Maven Missing Jars</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<id>dProguard-4.6</id>
<phase>generate-sources</phase>
<goals>
<goal>install-file</goal>
</goals>
<inherited>false</inherited>
<configuration>
<file>toinstall/4.6/proguard.jar</file>
<groupId>net.sf.proguard</groupId>
<artifactId>proguard</artifactId>
<version>4.6</version>
<packaging>jar</packaging>
<generatePom>true</generatePom>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Use a System Path
Another solution is to to declare the following dependency in your projects' pom.xml:<dependency>
<groupId>net.sf.proguard</groupId><
<artifactId>proguard</artifactId>
<version>4.6</version>
<scope>system</scope>
<systemPath>${project.basedir}/4.6/proguard.jar</systemPath>
</dependency>
No comments:
Post a Comment