使用另一个项目中的类在Java中。

huangapple 未分类评论46阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2020年5月5日 20:04:38
  • 转载请务必保留本文链接:https://java.coder-hub.com/61612715.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定