2016-05-28 37 views
1

在我們的項目中,我們使用的前端Maven插件 這是我的pom.xml:前端Maven插件無法執行目標

 <plugin> 
      <groupId>com.github.eirslett</groupId> 
      <artifactId>frontend-maven-plugin</artifactId> 
      <version>1.0</version> 
      <configuration> 
       <workingDirectory>src/main/webapp/ui</workingDirectory> 
       <installDirectory>src/main/webapp/ui/node_modules</installDirectory> 
      </configuration> 
      <executions> 
       <execution> 
        <!--Needed To run Grunt Tasks--> 
        <id>install node and npm</id> 
        <goals> 
         <goal>install-node-and-npm</goal> 
        </goals> 
        <configuration> 
         <nodeVersion>v5.3.0</nodeVersion> 
         <npmVersion>3.3.12</npmVersion> 
        </configuration> 
       </execution> 
       <execution> 
        <id>grunt build</id> 
        <goals> 
         <goal>grunt</goal> 
        </goals> 
       </execution> 

      </executions> 
     </plugin> 

當我安裝乾淨的項目中,我得到這個錯誤:

led to execute goal com.github.eirslett:frontend-maven-plugin:1.0:install-node-and-npm (install node and npm) on project web: The plugin com.github.eirslett:frontend-maven-plugin:1.0 requires Maven version 3.1.0 -> [Help 1] 

我的Maven的版本是3.3.3我也試過版本3.1.0,它得到了同樣的錯誤,所以我在我的settings.xml中使用代理,但它得到了同樣的錯誤。

+0

如何運行maven命令?從IDE內部?在這種情況下,您的IDE可能會使用內置maven,例如netbeans就是這種情況。 –

+0

@MikhailChibel哦,謝謝,我明白了 – Moolerian

回答

3

我解決了它,我的IDE有捆綁的maven,所以我只是告訴它使用我的!

enter image description here

0

我建立一個詹金斯插件使用Netbeans時有同樣的問題。 Netbeans也使用其自己的Maven捆綁版本。進入Tools-Options-Java-Maven並在「Maven Home」下選擇另一個版本的Maven。

捆綁版本是3.0.5。

Netbeans Options

相關問題