经过一些试验,我认为我有一些可行的方法(除了我无法让 m2e 接受用于 EJB 的 Java 1.7)。
版本:
- 日食朱诺 4.2
- 平方米 1.3.1
- 玻璃鱼 3.1.2
- JDK 1.7.0_17(甲骨文)
重要使用注意事项:使用下面的设置,如果您想运行 Maven clean & install,您应该禁用自动发布到 GlassFish(“从不自动发布”)。对于 Eclipse 中通常的编辑和保存工作,可以启用自动发布并且似乎工作正常。只有在显式启动 Maven 时(在 Eclipse 中)我才遇到问题。
在 Eclipse 中使用 Maven 设置 EJB 项目
Create Maven projects in Eclipse with these archetypes:
ejb-javaee6
ear-javaee6
webapp-javaee6
webapp-javaee6
--------------
- Convert to faceted form, select GlassFish in Runtimes and enable:
- Dynamic Web Module
- GlassFish Deployment Descriptors Files
- Java
- JavaScript
- JavaServer Faces
Further configuration available...
- Content directory: src/main/webapp
- NOT checked: Generate web.xml deployment descriptor
- JSF Capabilities (all defaults): JSF 2.1 + PrimeFaces selected
CHECKED: "Include libraries with this application"
ejb-javaee6
-----------
- Convert to faceted form, select GlassFish in Runtimes and enable:
- EJB Module
- GlassFish Deployment Descriptors Files
- Java
Further configuration available...
- NOT checked: Generate ejb-jar.xml deployment descriptor
ear-javaee6
-----------
- Convert to faceted form, select GlassFish in Runtimes and enable:
- EAR
- GlassFish Deployment Descriptors Files
Further configuration available...
- Add EJB and WEB projects as dependencies
- Content directory: src/main/application (META-INF location used by Maven)
- NOT checked: Generate application.xml deployment descriptor