java maven-resources-plugin:2.6 - 无法创建资源输出目录
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29726927/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
maven-resources-plugin:2.6 - Cannot create resource output directory
提问by user2361174
So I just created a Linux instance from EC2 and now I'm trying to install the AWS Java SDK on it. I'm at the end of the installation when I run mvn clean compile exec:java
and get this:
所以我刚刚从 EC2 创建了一个 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
I've seen the question similar to this on Stack Overflow, but that is using Windows as its host where I'm using a Linux instance. Plus that answer involves configuration with Eclipse, which I am not using. I'm not sure why it's behaving like this nor know how to fix it.
我在 Stack Overflow 上看到过与此类似的问题,但这是使用 Windows 作为我使用 Linux 实例的主机。另外,该答案涉及使用 Eclipse 进行配置,我没有使用它。我不确定它为什么会这样,也不知道如何解决。
回答by pbaranski
I my case this error appeared when I had target directory opened in console (so maven cannot delete it).
Navigating out of the target folder allowed me to install via maven without a problem.
我的情况是当我在控制台中打开目标目录时出现此错误(因此 maven 无法删除它)。
导航出目标文件夹允许我通过 Maven 安装而不会出现问题。
回答by Lho Ben
Try to Disable the automatic build of your IDE maybe there is some conflict with the Maven build. Verify also that the folder is not open somewhere with explorer or some other applications In case it doesn't work just restart your IDE
尝试禁用 IDE 的自动构建可能与 Maven 构建存在一些冲突。还验证该文件夹未在资源管理器或其他一些应用程序的某处打开 如果它不起作用,只需重新启动您的 IDE