【问题标题】:Maven - EJB plugin in parent pomMaven - 父 pom 中的 EJB 插件
【发布时间】:2012-05-30 13:20:30
【问题描述】:

我刚刚被要求处理现有的 Java EE Web 项目。

该项目包含很多模块,一些 EJB 打包在 EAR 中,还有一个 Web 部件在 WAR 中。

困扰我的是,你实际上需要 1 小时 30 来编译整个东西。 我在插件管理部分之间的父 POM 中找到了这个:

        <plugin>
            <artifactId>maven-ejb-plugin</artifactId>
            <configuration>
                <ejbVersion>3.0</ejbVersion>
                <generateClient>true</generateClient>
                <clientIncludes>
                    <!-- Includes only service interface and business delegate. -->
                    <clientInclude>**/*Service.class</clientInclude>
                    <clientInclude>**/*Delegate.class</clientInclude>
                    <clientInclude>**/ejb/*EJBRemote.class</clientInclude>
                </clientIncludes>
                <archive>
                    <manifest>
                        <addClasspath>true</addClasspath>
                        <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                        <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                    </manifest>
                    <manifestEntries>
                        <Build-Time>${timestamp}</Build-Time>
                        <Implementation-URL>${project.url}</Implementation-URL>
                    </manifestEntries>
                </archive>
            </configuration>
        </plugin>

这不是意味着每个模块都被 EJB 插件“解析”了吗? 甚至非 ejb 模块?

谢谢。

ps : 父 pom 也有一些依赖关系,这些依赖关系也在模块的 pom 中。

【问题讨论】:

  • 如果 pluginManagement 中的 this 比这意味着它不是为每个模块“解析”的。如果在适当的模块中有一个插件块,那么它将为适当的模块执行。
  • 你给的时间是全部时间还是真的只是编译时间?还是包括测试等?你有多少个模块?多少测试?测试是否并行运行?
  • 这是整个时间,但我一直在看控制台(努力工作,你看 =D)唯一一次消耗操作是由 mvane-compile-plugin 完成的。它总是阻止“编译 XX 源文件”
  • 我有 10 个模块,一些 EJB 一些常规和 1 个动态 Web 项目。我自己没有做任何测试。使用 te -T4 选项,编译时间下降到 28 分钟(如果你问我,还是太多了)
  • 您使用哪个版本的 maven-compiler-plugin?

标签: java maven maven-plugin maven-3


【解决方案1】:

我完全忘记了这一点:我找到了解决方案,然后项目“仅”需要 15 分钟来编译。

java版本需要升级,据我记得maven和java 1.6版本xxxxx有一些bug。

当时升级到最新版本的java 1.6解决了这个问题(或者是1.5我不记得了)。

【讨论】:

    猜你喜欢
    • 2011-12-10
    • 2021-12-13
    • 2011-06-17
    • 1970-01-01
    • 1970-01-01
    • 2017-01-02
    • 2019-02-03
    • 1970-01-01
    • 2010-12-31
    相关资源
    最近更新 更多