Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.1k views
in Technique[技术] by (71.8m points)

java - Maven is unable to access interface.class inside dependency jar

My Maven project has a custom dependency JAR which has a class file that I use in my application. This custom dependency JAR is actually a fat JAR meaning its dependency JARs are placed in a lib folder in its project structure instead of fetching them from a POM file.

MyApplication uses class from customjar.package.class:

    //Some code above and below
    Line 109`  CustomJar responeObject = new CustomJar();

CustomJar internally uses libFolder.jar.interface:

public class CustomJar implements LibFolderJarInterface

Now when I am trying to do a clean build in my application using mvn clean install, I get an error stating that:

failed to execute goal org.apache.maven.plugins maven-compiler-plugin:2.3.2:compile (default-compile) on project ABC: compilation failure <insert full project path (including relative path) here>SomeClass.java:[109:44] error: cannot access LibFolderJarInterface.class

This dependency class is present in the dependency JAR in a lib folder within an another dependency JAR. Have anyone encountered this before? Any suggestions? Eclipse is able to access it but Maven is unable to. Should I request the team that made this customJar to refactor their project structure to use the components in such a way that Maven can access it or should I add any changes to my POM. Please advice.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...