Maven-打包战争时如何创建ejb客户端 [英] Maven - how to create ejb client when packing war

查看:91
本文介绍了Maven-打包战争时如何创建ejb客户端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个eclipse基本的ejb项目,我刚刚将其转换为maven模块.它采用Web应用程序布局结构(Tomee首选).因此,在pom.xml中,打包类型设置为war,这使maven正确生成了war文件.但是,在包装战争时,我并没有使Maven也创建一个ejb-client jar取得很大的成功.我将其添加到pom.xml中,但似乎没有做任何事情:

I've an eclipse base ejb project that I have just converted into a maven module. It is structured in web app layout (as preferred by Tomee). So, in pom.xml, the packaging type is set to war, which maven correctly generated the war file. But I'm not very successful in getting maven to also create a ejb-client jar when packaging the war. I added this to the pom.xml but it does not seems to be doing anything:

    <build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-ejb-plugin</artifactId>
            <version>2.5</version>
            <executions>
                <execution>
                    <id>BossClient</id>
                    <phase>compile</phase>
                    <configuration>
                        <ejbVersion>3.1</ejbVersion>
                        <generateClient>true</generateClient>
                        <clientIncludes>
                            <clientInclude>/com/**</clientInclude>
                        </clientIncludes>
                    </configuration>
                </execution>
            </executions>
        </plugin>
      </plugins>
    </build>

有什么想法可以在打包战争时让Maven生成ejb-client吗?

Any idea how I can get maven to generate the ejb-client when packaging the war?

推荐答案

的配置maven-ejb-plugin 可以这样简化:

<project>
   <groupId>..</groupId>
   <artifactId>..</artifactId>

   <packaging>ejb</packagin>

   <build>
     <pluginManagement>
       <plugins>
         <artifactId>maven-ejb-plugin</artifactId>
         <version>2.5.1</version>
         <configuration>
           <ejbVersion>3.1</ejbVersion>
           <generateClient>true</generateClient>
           <clientIncludes>
             <clientInclude>/com/**</clientInclude>
           </clientIncludes>
         </configuration>
       </plugins>
     <pluginManagement>
   </build>
..
</project>

基于默认生命周期绑定无需由于 maven-ejb-plugin

Based on the default life cycle binding there is no need to make an execution block cause maven-ejb-plugin is already part of the life cycle. So only need to align the configuration to your needs.

此外,您应该考虑制作一个包含ejb部件的单独模块,并且不应将war和ejb部件合并到一个模块中.

Furthermore you should think about making a separate module which contains the ejb part and you shouldn't combine war and ejb part together in a single module.

这篇关于Maven-打包战争时如何创建ejb客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆