1

I have a project with a POM that looks like this:

    <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>

I want to use m2eclipse with m2e-wtp to deploy this project to Glassfish 3. However, m2e-wtp does not deploy the dependencies. I know that building superjars with jar-with-dependencies is probably not the way to go for EJB projects, but I cannot really change this without messing up the customer's build / deployment processes.

So, the problem is that the deployment assembly wizard does not display the maven dependencies:

No options for Java Build Path Entries

I need a solution that works without changing the pom.xml, since that would disturb the customer's build processes. I am aware that using an EAR would be the preferred solution here.

  • 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?
Jannik Jochem
  • 1,516
  • 1
  • 14
  • 28
  • If you can't change the pom file which is the *only* truth in a Maven build than you are lost. Using maven-assembly-plugin does not make sense for an EAR project where maven-ear-plugin would make more sense (separate project) apart from that that you are using a deprecated goal of the plugin. Furthermore better change the pom that it works it should instead of start fighting against Maven. Furthermore an EJB is technically a JAR file which should be part of an EAR/WAR file...so what you are trying to do sound really crazy to me (sorry for this). – khmarbaise Aug 08 '14 at 09:53
  • 1
    I'm aware that this approach is quite crazy, if not to say insane. However, I did not design the deployment processes for this application and unfortunately cannot just change them. Also note that I can build a working, deployable JAR with Maven. I just cannot get Eclipse to deploy this for me - so I do think the issue here is with m2e-wtp, not with Maven itself. – Jannik Jochem Aug 08 '14 at 11:33
  • Yes the issue is in m2e which i can understand, cause it is not an intended use case. – khmarbaise Aug 08 '14 at 11:44

0 Answers0