由于frontent-maven-plugin而构建maven项目的错误

时间:2015-11-03 10:49:21

标签: java maven intellij-idea

我正在尝试构建/编译使用前端maven插件的maven项目。但是当强制执行项目时,我在IntelliJ IDEA中收到此错误:

Failed to execute goal com.github.eirslett:frontend-maven-plugin:0.0.26:install-node-and-npm (install node and npm) on project PROJECT-NAME: The plugin com.github.eirslett:frontend-maven-plugin:0.0.26 requires Maven version 3.1.0

我安装了Maven 3.3.3,所以它也降级了3.1.1但是我仍然收到同样的错误。

这是我的POM.xml文件中详细介绍插件的部分:

 <plugin>
                <groupId>com.github.eirslett</groupId>
                <artifactId>frontend-maven-plugin</artifactId>
                <version>0.0.26</version>

                <configuration>
                    <workingDirectory>src/web</workingDirectory>
                </configuration>

                <executions>
                    <execution>
                        <id>install node and npm</id>
                        <goals>
                            <goal>install-node-and-npm</goal>
                        </goals>
                        <phase>validate</phase>
                        <configuration>
                            <nodeVersion>v0.12.7</nodeVersion>
                            <npmVersion>2.11.3</npmVersion>
                        </configuration>
                    </execution>

                    <execution>
                        <id>npm install</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <arguments>install</arguments>
                        </configuration>
                    </execution>

                    <execution>
                        <id>gulp dev build</id>
                        <goals>
                            <goal>gulp</goal>
                        </goals>
                        <phase>generate-resources</phase>
                        <configuration>
                            <arguments>dev-once</arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

在终端中运行mvn clean install --debug时出现错误;

   [DEBUG] -- end configuration --
[INFO] Found proxies: []
[INFO] Installing node version v0.12.7
[INFO] Creating temporary directory /Users/folder/Development/BSD/eng-bsd-bigted-server-ice-tea/src/web/node_tmp
[INFO] Downloading Node.js from http://nodejs.org/dist/v0.12.7/node-v0.12.7-darwin-x64.tar.gz to /Users/folder/Development/BSD/eng-bsd-bigted-server-ice-tea/src/web/node_tmp/node.tar.gz
[INFO] No proxies configured
[INFO] No proxy was configured, downloading directly
Nov 03, 2015 1:41:30 PM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (java.net.NoRouteToHostException) caught when processing request: No route to host
Nov 03, 2015 1:41:30 PM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request

2 个答案:

答案 0 :(得分:0)

frontend-maven-plugin的用户版本0.0.22。那个不需要Maven 3.1.1。它也适用于较低版本的Maven。

答案 1 :(得分:0)

对于较新版本(我使用 20.04)的 IntelliJ,请在 Maven 设置中启用使用插件注册表选项:

  1. 点击文件 -> 设置
  2. 扩展构建、执行、部署 -> 构建工具 -> Maven
  3. 检查使用插件注册表
  4. 点击应用并确定。

我希望它在 Eclipse 和其他 IDE 中会类似。