项目构建类不包括外部项目导入
我有一个项目将另一个项目导入其构建路径。当我清理项目以编译类时,从外部项目导入的类不会显示为已编译类目录的一部分。
有谁知道如何确保这些外部导入类得到编译并包含到我的构建类中?
谢谢
I have a project which imports another projects to its build path. When I clean the project to compile classes, the classes imported from external projects are not showing up as part of the compiled classes directory.
Do anyone know how to make sure these external import classes gets compile and included into my build classes?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为这是不可能的。但是当您部署项目时,您肯定会想要创建一个 jar 文件来保存所有类。 Eclipse 有一个向导可以导出 jar 文件并选择在 jar 中嵌入依赖项。
然而,通常的方法是让每个项目生成自己的 jar,并使用项目的所有 jar + 依赖项的 jar 作为部署项目的类路径。
I don't think it's possible. But when you deploy your project, you'll certainly want to create a jar file to hold all your classes. And Eclipse has a wizard to export a jar file and choose to embed dependencies in the jar.
The usual way, however, is to have each project generate its own jar, and to use all the jar of the project + the jars of the dependencies as the classpath of the deployed project.
@位图,
这是 WAR 项目还是 EAR 项目?
在 EAR 项目中,您必须明确指定“JAVA EE 模块依赖项”以包含引用的项目。
如果将项目包含为构建依赖项,则它将仅用于编译时。
如果这些是简单的 Java 项目,您可能需要查看“JAR JAR”在此处输入链接说明
为了实现这一点。
华泰
@Bitmap,
is this a WAR or EAR project?
In EAR project you have to specify clearly the "JAVA EE Module dependency" to include the referenced projects.
If you include a project as a build dependency, it will be for compile-time only.
If these are simple java projects you may want to look at "JAR JAR" enter link description here
to achieve this.
HTH