我有一个 POM 项目,如下所示:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>my-parent</artifactId>
<groupId>com.company</groupId>
<version>2</version>
</parent>
<groupId>com.company</groupId>
<artifactId>resources-silo</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>ejb</packaging>
<name>Some EJB component</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ejb-plugin</artifactId>
<configuration>
<ejbVersion>3.0</ejbVersion>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>simple-command</id>
<phase>package</phase>
<goals>
<goal>attached</goal>
</goals>
<inherited>false</inherited>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<!-- some jars ... -->
</dependencies>
</project>
我想使用 m2eclipse 和 m2e-wtp 将此项目部署到 Glassfish 3。但是,m2e-wtp 不部署依赖项。我知道构建 superjarsjar-with-dependencies
可能不是 EJB 项目的方式,但如果不打乱客户的构建/部署过程,我无法真正改变这一点。
所以,问题是部署组装向导没有显示 Maven 依赖项:
我需要一个无需更改即可工作的解决方案pom.xml
,因为这会干扰客户的构建过程。我知道使用 EAR 将是这里的首选解决方案。
- Is the behaviour that I'm seeing a bug or is it an inherent limitation in the way m2e-wtp and the ejb packaging work?
- Is it even possible to have m2e-wtp extract dependency jars into the deployed application?