报错提示:”Error while file distribution is prepared.“
详细日志:
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/commons/commons-parent/17/commons-parent-17.pom
8/31 KB
16/31 KB
24/31 KB
31/31 KB
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/commons/commons-parent/17/commons-parent-17.pom (31 KB at 38.8 KB/sec)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2:29.956s
[INFO] Finished at: Mon Aug 17 19:48:04 CST 2020
[INFO] Final Memory: 57M/679M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project www.baidu.com: Could not resolve dependencies for project ngrinder:www.baidu.com:jar:0.0.1: Failed to collect dependencies for [org.ngrinder:ngrinder-groovy:jar:3.4.2 (provided)]: Failed to read artifact descriptor for grinder:grinder-patch:jar:3.9.1-patch: Could not transfer artifact grinder:grinder-patch:pom:3.9.1-patch from/to ngrinder.maven.repo (https://github.com/naver/ngrinder/raw/ngrinder.maven.repo/releases): 拒绝连接 to https://raw.githubusercontent.com/naver/ngrinder/ngrinder.maven.repo/releases/grinder/grinder-patch/3.9.1-patch/grinder-patch-3.9.1-patch.pom -> [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/DependencyResolutionException
Dependencies copy in www.baidu.com/pom.xml is failed.
解决方法:
从日志上看,就是缺少相关jar包,且它官网的仓库里也缺失这些jar包,我们可以通过手动导入jar包的方式,导到本地仓库,当然这里的本地仓库已经是被修改了的,本地安装了maven,且ngrinder运行时,指向本地的setttings.xml文件,具体可参考这个博客
https://blog.csdn.net/weixin_42118880/article/details/108058257
本来ngrinder的war包里就有这些jar包,我们把它导入到我们的仓库里就可以了,在ngrinder的源包里其实是有关于缺少这些包的导入脚本,把它的命令改改就好了
mvn install:install-file -Dfile=/opt/apache-tomcat-8.5.57/webapps/ngrinder-controller-3.4.2/WEB-INF/lib/sigar-native-1.0.jar -DgroupId=sigar -DartifactId=sigar-native -Dversion=1.0 -Dpackaging=jar -DcreateChecksum=true
mvn install:install-file -Dfile=/opt/apache-tomcat-8.5.57/webapps/ngrinder-controller-3.4.2/WEB-INF/lib/grinder-3.9.1-patch.jar -DgroupId=grinder -DartifactId=grinder-patch -Dversion=3.9.1-patch -Dpackaging=jar -DcreateChecksum=true
mvn install:install-file -Dfile=/opt/apache-tomcat-8.5.57/webapps/ngrinder-controller-3.4.2/WEB-INF/lib/universal-analytics-java-1.0.jar -DgroupId=org.ngrinder -DartifactId=universal-analytics-java -Dversion=1.0 -Dpackaging=jar -DcreateChecksum=true