1

In eclipse I am trying to reference a plain Java project (let's call it "Common") from a Dynamic Web Project ("Server").

While "Server" is a faceted project and targets the Glassfish runtime, "Common" should stay a plain Java project (and not be faceted).

In "Server", I added a reference to "Common" using the "Project References" in the project properties. On deployment, however, the classes in "Common" cannot be found (NoClassDefFoundError).

This problem can be solved adding the "Common" project to the Deployment Assembly of "Server".

However, this action causes Eclipse to change the type of the "Common" project to a faceted project and let it target the Glassfish Runtime, too.
This then causes problems for team memebers who don't have GlassFish installed but still want to be able to build the "Common" project as it is used by another project, too.

How am I able to reference a plain Java project from my Server project (and add it to the deployment assembly) while keeping the referenced project's runtime and type unchanged?

4

1 回答 1

1

此处已回答了类似的问题。

部署中的内容不是由构建路径决定,而是由动态 Web 项目的首选项中的部署程序集条目决定。

于 2013-01-03T13:43:30.170 回答