2017-03-14 5 views
0
<build> 
    <pluginManagement> 
     <plugins>      

      <!-- Plugin to execute command "npm install" and "npm run build" inside /angular directory --> 
      <plugin> 
       <groupId>com.github.eirslett</groupId> 
       <artifactId>frontend-maven-plugin</artifactId> 
       <version>0.0.22</version> 
       <configuration> 
       <skip>false</skip> 
       <workingDirectory>${basedir}</workingDirectory> 
       <installDirectory>${basedir}/temp</installDirectory> 
       </configuration> 
       <executions> 
       <!-- It will install nodejs and npm --> 
       <execution> 
        <id>install node and npm</id> 
        <goals> 
        <goal>install-node-and-npm</goal> 
        </goals> 
        <configuration> 
        <nodeVersion>v6.3.1</nodeVersion> 
        <npmVersion>3.9.5</npmVersion> 
        </configuration> 
       </execution> 

       <!-- It will execute command "npm install" inside "/angular" directory --> 
       <execution> 
        <id>npm install</id> 
        <goals> 
        <goal>npm</goal> 
        </goals> 
        <phase>generate-sources</phase> 
        <configuration> 
        <arguments>install</arguments> 
        </configuration> 
       </execution>   

       <execution> 
        <id>bower install</id> 
        <goals> 
         <goal>bower</goal> 
        </goals> 
        <phase>generate-sources</phase> 
        <configuration> 
         <arguments> 
          <argument>install</argument> 
         </arguments> 
         <workingDirectory>${basedir}</workingDirectory> 
        </configuration> 
       </execution> 

       </executions> 
      </plugin> 


      <!-- Plugin to copy the content of /angular/dist/ directory to output directory (ie/ /target/transactionManager-1.0/) --> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-resources-plugin</artifactId> 
       <version>2.4.2</version> 
       <executions> 
       <execution> 
        <id>default-copy-resources</id> 
        <phase>process-resources</phase> 
        <goals> 
        <goal>copy-resources</goal> 
        </goals> 
        <configuration> 
        <overwrite>true</overwrite> 
        <outputDirectory>${basedir}/target/classes/static/app/bower_components</outputDirectory> 
        <resources> 
         <resource> 
         <directory>${basedir}/src/main/resources/static/app/bower_components</directory> 
         </resource> 
        </resources> 
        </configuration> 
       </execution> 
       </executions> 
      </plugin> 

      <plugin> 
       <groupId>org.springframework.boot</groupId> 
       <artifactId>spring-boot-maven-plugin</artifactId> 
      </plugin> 

     </plugins> 
     </pluginManagement> 
    </build> 

このビルド設定では、なぜmavenが完全に無視してfrontend-maven-pluginを実行するのかわかりません。Mavenはfrontend-pluginを無視します。エラーはありません。

コマンドプロンプトからbower installを正常に実行し、依存関係をダウンロードできます。

しかし、私はmavenビルドを使って同じことをすることができません。

私はさまざまなバージョンのfront-maven-pluginで試しましたが、このプラグインを実行できませんでした。また、Webから他の可能なソリューションを試しました。

私はMavenをビルドしているときに、このプラグインに関するエラーや情報はありません。

誰でも手伝ってもらえますか?

答えて

0

プラグインが<プラグイン管理>タグ内にある場合は、これらのタグを削除してください。

投稿者Maven Documentationプラグイン管理:サイドプラグインに沿って見られる要素です。プラグイン管理には、この特定のプロジェクトビルドのプラグイン情報を設定するのではなく、これを継承したプロジェクトビルドを設定することを除いて、プラグイン要素とほぼ同じ方法が含まれています。ただし、これは、子要素のplugins要素内で実際に参照されるプラグインのみを構成します。子供には、pluginManagementの定義を上書きする権利があります。

これは、あなたのプラグインがあなたの(存在しない)子供に渡されているだけで、実際には使用されていないと思います。

関連する問題