2016-06-01 1 views
2

私のPOMファイルには、フロントエンドビルドを構築するプラグインがあります。しかし、mvn clean installを実行すると、フロントエンドgrunt/npm execが2回実行されます。複数回の実行を避けるにはどうすればよいですか?Mavenフロントエンドビルドは、生成ソースフェーズのために2回実行されます。

すべてのご協力をいただきありがとうございます。無駄なビルドには時間がかかるので、重複したランを削除するとビルド時間が短縮されます。

<plugin> 
     <groupId>org.codehaus.mojo</groupId> 
     <artifactId>exec-maven-plugin</artifactId> 
     <version>1.4.0</version> 
     <executions> 
      <execution> 
       <id>exec-npm-install</id> 
       <phase>generate-sources</phase> 
       <configuration> 
        <executable>npm</executable> 
        <arguments> 
         <argument>install</argument> 
        </arguments> 
        <workingDirectory>src/main/raw_ui</workingDirectory> 
       </configuration> 
       <goals> 
        <goal>exec</goal> 
       </goals> 
      </execution> 
      <execution> 
       <id>exec-bower-install</id> 
       <phase>generate-sources</phase> 
       <configuration> 
        <executable>bower</executable> 
        <arguments> 
         <argument>install</argument> 
        </arguments> 
        <workingDirectory>src/main/raw_ui</workingDirectory> 
       </configuration> 
       <goals> 
        <goal>exec</goal> 
       </goals> 
      </execution> 
      <execution> 
       <id>exec-grunt</id> 
       <phase>generate-sources</phase> 
       <configuration> 
        <executable>grunt</executable> 
        <arguments> 
         <argument>build</argument> 
         <argument>-f</argument> 
        </arguments> 
        <workingDirectory>src/main/raw_ui</workingDirectory> 
       </configuration> 
       <goals> 
        <goal>exec</goal> 
       </goals> 
      </execution> 
     </executions> 
    </plugin> 

答えて

1

これが問題を解決し、なぜ私は本当に知らないが、事をした「を生成-源」から「プロセス・クラス」から位相を変更した後、それは今一度だけ実行されます。

私はここで、特定の目標が特定のライフサイクルを実行できることを確認しました:Maven plugin executes multiple times during buildです。そのため、ノードスクリプトを実行するフェーズを変更しようとしました。

+0

ありがとうございました。 – user2630054

関連する問題