简体   繁体   中英

m2eclipse wtp deploy an ejb project with dependencies

I have a ejb project with 1 dependent project (also in my workspace) that I want to deploy on glassfish. I use m2eclipse to resolve my projects en configure my eclipse projects.

Everything works fine when I create a war or ear. But with an ejb project it fails to add the dependent project to my server.

<groupId>be.stijn</groupId>
<artifactId>moviez-ejb</artifactId>
<packaging>ejb</packaging>
<version>0.0.1-SNAPSHOT</version>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-ejb-plugin</artifactId>
            <configuration>
                <ejbVersion>3.1</ejbVersion>
            </configuration>
        </plugin>
    </plugins>
</build>

<dependencies>
    <dependency>
        <groupId>be.stijn</groupId>
        <artifactId>moviez-dom</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <scope>compile</scope>
    </dependency>

No dependent project moviez-dom deployed to the server:

伺服器 :-(

If you will change your packaging model, your maven configuration will cause that moviez-dom will be packed as a JAR library inside moviez-ejb EAR. In such case you have to deploy only moviez-ejb and everything should work fine. That's the standard way how things are done - EAR stands for enterprise application and include JARs and WARs inside.

If you want to deploy some project to server using eclipse plugin you mentioned, you have to do it explicitly - your maven configuration cannot do it for you. In Eclipse, you can set it in the server 'modules' tab.

The moviez-dom project isn't going to be a deployable entity. You need to include the moviez-dom project code in the build for your moviez-ejb project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM