Eclipse WAR with 2 projects?

后端 未结 2 1257
日久生厌
日久生厌 2021-01-13 18:38

I am trying to export a WAR file from Eclipse. I have a \"Dynamic Web Project\". But I need classes created for two other projects, one a plain Java project, the other anoth

相关标签:
2条回答
  • 2021-01-13 19:09

    Packing together different projects for deployment is achieved through an EAR file (enterprise archive). An EAR may combine multiple web projects (WAR), Enterprise JavaBeans projects (JAR), standard JARs, etc. and packs it into a single application.

    Create a new EAR project in Eclipse, open its properties and check all dependencies on the Java EE Module Dependencies page. After that export the project as an EAR and deploy it.

    0 讨论(0)
  • 2021-01-13 19:25

    You need to add your other project as a Java EE module to your web project. Right click on your web project -> properties -> Java EE module Dependencies. Add the 'other' project to it. Eclipse will include this project in the export.

    0 讨论(0)
提交回复
热议问题