安装Dubbo管理控制台 on project dubbo-admin-ui: Could not download Node.js: Could not download

遇到了如下问题:

PS D:\Program Files\dubbo\dubbo-admin-develop\dubbo-admin-ui> mvn install
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< org.apache:dubbo-admin-ui >----------------------
[INFO] Building dubbo-admin-ui 0.2.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-maven-version) @ dubbo-admin-ui ---
[INFO]
[INFO] --- maven-checkstyle-plugin:3.0.0:check (checkstyle-validation) @ dubbo-admin-ui ---
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.2:prepare-agent (default) @ dubbo-admin-ui ---
[INFO] argLine set to "-javaagent:C:\\Users\\yourUserName\\.m2\\repository\\org\\jacoco\\org.jacoco.agent\\0.8.2\\org.jacoco.agent-0.8.2-runtime.jar=destfile=D:\\Program Files\\dubbo\\dubbo-admin-develop\\dubbo-admin-ui\\target\\jacoco.exec"
[INFO]
[INFO] --- maven-remote-resources-plugin:1.5:process (process-resource-bundles) @ dubbo-admin-ui ---
[INFO]
[INFO] --- frontend-maven-plugin:1.6:install-node-and-npm (install node and npm) @ dubbo-admin-ui ---
[INFO] Installing node version v9.11.1
[INFO] Downloading https://nodejs.org/dist/v9.11.1/node-v9.11.1-win-x64.zip to C:\Users\wangq\.m2\repository\com\github\eirslett\node\9.11.1\node-9.11.1-win-x64.zip
[INFO] No proxies configured
[INFO] No proxy was configured, downloading directly
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.953 s
[INFO] Finished at: 2020-06-04T18:49:27+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.6:install-node-and-npm (install node and npm) on project dubbo-admin-ui: Could not download Node.js: Could not download https://nodejs.org/dist/v9.11.1/node-v9.11.1-win-x64.zip: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

最终解决办法是:

步骤一:修改 pom.xml文件中的frontend-maven-plugin插件配置

借鉴:frontend-maven-plugin插件无法下载nodejs和npm的问题

修改 pom.xml文件中的frontend-maven-plugin插件配置:

添加了:

              <nodeDownloadRoot>http://nodejs.org/dist/</nodeDownloadRoot>
              <npmDownloadRoot>http://registry.npmjs.org/npm/-/</npmDownloadRoot>

详细为:

<plugins>
	<plugin>
		<groupId>com.github.eirslett</groupId>
		<artifactId>frontend-maven-plugin</artifactId>
		<version>${frontend-maven-plugin.version}</version>
		<executions>
			<execution>
				<id>install node and npm</id>
				<goals>
					<goal>install-node-and-npm</goal>
				</goals>
				<configuration>
					<nodeVersion>v9.11.1</nodeVersion>
					<nodeDownloadRoot>http://nodejs.org/dist/</nodeDownloadRoot>
					<npmDownloadRoot>http://registry.npmjs.org/npm/-/</npmDownloadRoot>
				</configuration>
			</execution>
			<!-- Install all project dependencies -->
			<execution>
				<id>npm install</id>
				<goals>
					<goal>npm</goal>
				</goals>
				<!-- optional: default phase is "generate-resources" -->
				<phase>generate-resources</phase>
				<!-- Optional configuration which provides for running any npm command -->
				<configuration>
					<arguments>install</arguments>
				</configuration>
			</execution>
			<!-- Build and minify static files -->
			<execution>
				<id>npm run build</id>
				<goals>
					<goal>npm</goal>
				</goals>
				<configuration>
					<arguments>run build</arguments>
				</configuration>
			</execution>
		</executions>
	</plugin>
</plugins>

步骤二:修改maven的settings.xml文件中镜像文件路径

    <mirror>  
      <id>alimaven</id>  
      <name>aliyun maven</name>  
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>  
      <mirrorOf>central</mirrorOf>          
    </mirror> 

注意点一:

当执行 mvn install 命令后,若长时间处于下面这个位置,不报错、不结束退出,稍微有点耐心(我的停了3分钟,我直接先干其他的事儿去了,再长,估计我能等到5分钟 ^-^,不能再长了)

[INFO] No proxies configured
[INFO] No proxy was configured, downloading directly

注意点二:

我曾执行过命令:mvn npm_mirror https://npm.taobao.org/mirrors/npm/ 而且有反应,不确定是否对解决问题有帮助。

若报错:

[INFO] No proxies configured
[INFO] No proxy was configured, downloading directly
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.492 s
[INFO] Finished at: 2020-06-04T18:17:06+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.6:install-node-and-npm (install node and npm) on project dubbo-admin-ui: Could not download Node.js: Could not download http://npm.taobao.org/mirrors/node/v9.11.1/node-v9.11.1-win-x64.zip: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

解决方案同上。

 

参考资料:

1. frontend-maven-plugin插件无法下载nodejs和npm的问题

2. nvm下载node时无法下载npm

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值