所以我刚刚从EC2创build了一个Linux实例,现在我正在尝试在其上安装AWS Java SDK。 我在安装结束时运行mvn clean compile exec:java
并得到这个:
[ec2-user@ip-xxx-xxx-xxx-xxx aws-java-sample]$ mvn clean compile exec:java [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building aws-java-sample 1.0 [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ aws-java-sample --- [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ aws-java-sample --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: x.xxx s [INFO] Finished at: xxxx-xx-xxTxx:xx:xx+xx:xx [INFO] Final Memory: M/xM [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.6:resources (default-resources) on project aws-java-sample: Cannot create resource output directory: /home/ec2-user/aws-java-sample/target/classes -> [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
我已经看到类似堆栈溢出这个问题,但是这是使用Windows作为其主机,我正在使用一个Linux实例。 此外,答案涉及Eclipse的configuration,我不使用。 我不确定它为什么这样做,也不知道如何解决这个问题。
我的情况这个错误出现时,我有目标目录在控制台中打开(所以maven不能删除它)。
从目标文件夹导航允许我通过maven安装没有问题。
尝试禁用IDE的自动构建,也许与Maven构建有一些冲突。 还要验证该文件夹没有在资源管理器或某些其他应用程序的某个地方打开如果不起作用,只需重新启动IDE