简体   繁体   English

m2eclipse wtp部署具有依赖项的ejb项目

[英]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. 我有一个ejb项目,其中有1个相关项目(同样在我的工作空间中),我想将其部署在glassfish上。 I use m2eclipse to resolve my projects en configure my eclipse projects. 我使用m2eclipse解决我的项目,并配置eclipse项目。

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. 但是对于ejb项目,它无法将依赖项目添加到我的服务器中。

<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: 没有将依赖项目moviez-dom部署到服务器:

伺服器 :-( :-(

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. 如果要更改打包模型,那么您的maven配置将导致moviez-dom将打包为moviez-ejb EAR中的JAR库。 In such case you have to deploy only moviez-ejb and everything should work fine. 在这种情况下,您只需要部署moviez-ejb,一切就可以正常进行。 That's the standard way how things are done - EAR stands for enterprise application and include JARs and WARs inside. 这是完成工作的标准方式-EAR代表企业应用程序,并在其中包含JAR和WAR。

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. 如果要使用提到的eclipse插件将某些项目部署到服务器,则必须显式地执行它-您的maven配置无法为您完成。 In Eclipse, you can set it in the server 'modules' tab. 在Eclipse中,您可以在服务器的“模块”选项卡中进行设置。

The moviez-dom project isn't going to be a deployable entity. moviez-dom项目不会是可部署的实体。 You need to include the moviez-dom project code in the build for your moviez-ejb project. 您需要在moviez-ejb项目的构建中包含moviez-dom项目代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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