英文:
Using class from another project in java
问题
我正在处理一个Java项目A,该项目正在使用来自项目B的一个类。我将项目B添加到了项目A的构建路径中,但在编译时,我使用了项目B中的类时出现错误,但当我运行项目A时,它显示了项目B的依赖项的ClassNotFound错误。
是否有任何方法可以在不将项目A的构建路径中添加项目B的所有依赖项的情况下解决这个问题?
项目A和项目B都是Maven项目。
英文:
I am working on a java project A which is using a class from project B. I added project B in the build path of Project A, I am getting error at compile time for the classes I have used from project B but when I run project A it is showing error ClassNotFound error for the dependencies of project B.
Is there any way I can solve this without adding all the dependencies of project B in build path of project A ?
Both Project A and B are maven project.
专注分享java语言的经验与见解,让所有开发者获益!
评论