开发者

Project Build classes do not include external project imports

开发者 https://www.devze.com 2023-03-20 04:23 出处:网络
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 c

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开发者_JS百科 classes gets compile and included into my build classes?

Thanks


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.


@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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号