Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.0k 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 Reply

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...