I have a spring project, that is compiled into a jar file. Lets call this project A. There is another project B which is a dependency of Project A. I have no contol over project B. The project B is available in the form of two files. One is an executable jar file while the other one is zip file. This zip file contains all the resources of the project. To invoke the API from B I need to pass a resourceLocation parameter (it is the url of the above mentioned resource folder). I included both B.jar and B.zip in my A's pom as dependencies.
Now I create an executable jar-with-all-dependencies for my project A. Along with other dependencies, resources folder from B.zip is present inside my jar.
Now the problem: What should be the resourcePath that I should give while invoking API of B from inside of A. I have tried . and ./resources. But B doesn't get it. How can I get the absolute path for resources folder and give it to B. Or setup a common classpath for A and B.
you could try maven-dependency-plugin unpack zip to classpath unpack dependency zip resources folder, which will add the artifacts to classpath of A
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<id>unpack-sigar</id>
<phase>package<!-- or any other valid maven phase --></phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeGroupIds>somegroupid</includeGroupIds>
<includeArtifactIds>B</includeArtifactIds>
<outputDirectory>
${project.build.directory}/src/main/resources
</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>