加快构建EAR文件并跳过没有更改的构建WAR文件

时间:2019-01-11 13:03:52

标签: maven jboss pom.xml war ear

我有一个父pom,在其中定义了配置文件和模块。而且,我有一项“全部服务”服务和一个pom文件,该文件继承了父项并定义了所使用的所有Web模块(服务)。

这是我父母pom的样子

<groupId>com.example</groupId>
<artifactId>parent</artifactId>
<packaging>pom</packaging>
<profile>
    <id>parent-all</id>
    <activation>
    <activeByDefault>true</activeByDefault>
    </activation>
    <modules>
        <module>service-all</module>
        <module>customer-service</module>
    </modules>
</profile>

继承父级的我的service-all service pom像这样

<artifactId>service-all</artifactId>
 <packaging>ear</packaging>

 <parent>
  <groupId>com.example</groupId>
  <artifactId>parent</artifactId>
  <version>1.0.0-SNAPSHOT</version>
 </parent>

<plugins>
   <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-ear-plugin</artifactId>
    <version>2.9.1</version>
    <configuration>
     <version>6</version>
     <skinnyWars>true</skinnyWars>
     <defaultLibBundleDir>lib</defaultLibBundleDir>
     <applicationName>service-all</applicationName>
     <modules>

      <webModule>
       <groupId>com.example</groupId>
       <artifactId>customer-service</artifactId>
       <bundleFileName>customer-service.war</bundleFileName>
      </webModule>
     </modules>
    </configuration>
   </plugin>
</plugin>

所以当我说

  

mvn全新安装

     

mvn安装

构建每个服务war文件并最终从这些war文件中建立一个耳朵需要花费10分钟以上的时间。我有将近30个服务,甚至日志记录更改也需要10分钟才能测试。我使用JBoss Server部署耳文件。

有什么办法可以只为已更改的服务构建特定的war文件吗?如果可能的话,我可以将时间减少到5分钟,因为构建ear文件本身需要5分钟。谢谢,这里的任何输入都会有帮助。

0 个答案:

没有答案