编译部署RocketMq时报错;Failed to execute goal org.apache.maven.plugins

记一次安装RocketMq时出现的问题,如果你也安装RocketMq,使用如下命令编译部署

mvn -Prelease-all -DskipTests clean install -U

可能会编译失败.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-remote-resources-plugin:1.5:process (process-resource-bundles) on project rocketmq-all: Error finding remote resources manifests: /usr/local/rocketmq/rocketmq-all-4.2.0/target/maven-shared-archive-resources/META-INF/NOTICE (No such file or directory) -> [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/MojoExecutionException

然后就上网搜索,基本上解决方案有说maven版本不对的,有建议使用maven3.2.x,结果重新下载maven3.2.x,结果还是不行,然后使用如下命令看错误日志

mvn -Prelease-all -DskipTests clean install -U -e

然后出现如下出错,其实上面错误也已经提示了没有文件和目录(No such file or directory)

Caused by: java.io.FileNotFoundException: /usr/local/rocketmq/rocketmq-all-4.2.0/target/maven-shared-archive-resources/META-INF/NOTICE (No such file or directory)

那就看看,到底在rocketmq-all-4.2.0目录下是否存在target目录,结果真的没有,瞬间恍然大悟,应该是没有创建文件的权限,设置权限后重新执行(记得设置rocketmq-all-4.2.0/*的权限).再次执行,完美.我们可以看到成功的命令行了

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Apache RocketMQ 4.2.0 4.2.0:
[INFO]
[INFO] Apache RocketMQ 4.2.0 .............................. SUCCESS [  4.052 s]
[INFO] rocketmq-remoting 4.2.0 ............................ SUCCESS [  5.657 s]
[INFO] rocketmq-common 4.2.0 .............................. SUCCESS [  5.105 s]
[INFO] rocketmq-client 4.2.0 .............................. SUCCESS [  4.876 s]
[INFO] rocketmq-store 4.2.0 ............................... SUCCESS [  2.810 s]
[INFO] rocketmq-srvutil 4.2.0 ............................. SUCCESS [  0.508 s]
[INFO] rocketmq-filter 4.2.0 .............................. SUCCESS [  1.490 s]
[INFO] rocketmq-broker 4.2.0 .............................. SUCCESS [  2.723 s]
[INFO] rocketmq-tools 4.2.0 ............................... SUCCESS [  2.295 s]
[INFO] rocketmq-namesrv 4.2.0 ............................. SUCCESS [  0.910 s]
[INFO] rocketmq-logappender 4.2.0 ......................... SUCCESS [  0.859 s]
[INFO] rocketmq-openmessaging 4.2.0 ....................... SUCCESS [  1.046 s]
[INFO] rocketmq-example 4.2.0 ............................. SUCCESS [  0.837 s]
[INFO] rocketmq-filtersrv 4.2.0 ........................... SUCCESS [  0.911 s]
[INFO] rocketmq-test 4.2.0 ................................ SUCCESS [  1.496 s]
[INFO] rocketmq-distribution 4.2.0 ........................ SUCCESS [  5.359 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  41.445 s
[INFO] Finished at: 2020-07-22T21:05:29+08:00
[INFO] ------------------------------------------------------------------------

权限问题搞了这么久也是醉了,如果你也遇到找不到文件这种情况,可以试一试.对于其他软件的安装可能也会出现此情况.

你可能感兴趣的:(编译部署RocketMq时报错;Failed to execute goal org.apache.maven.plugins)