我有一个带有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不会部署依赖项 . 我知道用 jar-with-dependencies 构建超级游戏可能不适合EJB项目,但我不能在不搞乱客户构建/部署过程的情况下改变它 .

因此,问题是部署程序集向导不显示maven依赖项:

No options for Java Build Path Entries

我需要一个无需更改 pom.xml 的解决方案,因为这会干扰客户的构建过程 . 我知道使用EAR将是这里的首选解决方案 .

  • 我看到的行为是bug还是m2e-wtp和ejb包装工作的固有限制?

  • 甚至可以将m2e-wtp提取依赖性jar放入已部署的应用程序中吗?