Myapp.tgz
|_ lib
|_ abc.jar
I have a project 'Project1' which needs to have dependency on a jar and this jar is inside a *.tgz file(Myapp.tgz).
My requirement is that I need to be able to import classes in abc.jar from Project1.
Myapp.tgz file is inside the maven repository that I am using.(e.g. it is accessbile to maven from http://xxxx.net/artifactory/app-cloud )
The structure of the tgz file is shown above. The tgz file has a folder and the jar that I need to add dependency is inside it.
Through maven plugins, how can I unpack the tgz file and make sure the jar is added as a dependency in pom.xml?
<dependency>
<groupId>zz.yy.zz</groupId>
<artifactId>Myapp</artifactId>
<version>0.1.4.1</version>
<type>tgz</type>
</dependency>
<dependency>
<artifactId>artifactofabcjar</artifactId>
<groupId>groupidofabcjar</groupId>
<scope>system</scope>
<systemPath>${project.build.directory}/classes/Myapp/lib/abc.jar</systemPath>
</dependency>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>${project.groupId}.${project.artifactId} unpack-dependencies</id>
<phase>generate-sources</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<excludeTransitive>true</excludeTransitive>
<includeTypes>tgz</includeTypes>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<executions>
<execution>
<id>fincore</id>
<phase>install</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<groupId>zz.yy.kk</groupId>
<artifactId>artname</artifactId>
<version>0.1.4-SNAPSHOT</version>
<packaging>jar</packaging>
<file>${project.build.directory}/classes/Myapp/lib</file>
<createChecksum>true</createChecksum>
<generatePom>true</generatePom>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
I added the above mentioned plugins to pom.xml of 'Project1'. But when I added dependency of abc.jar in pom.xml, it is showing the following error 'Dependency not found'. How to fix this error?
