【问题标题】:maven-resources-plugin:2.6 - Cannot create resource output directorymaven-resources-plugin:2.6 - 无法创建资源输出目录
【发布时间】:2015-04-19 07:15:01
【问题描述】:

所以我刚刚从 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

我在 Stack Overflow 上看到过与此类似的问题,但这是使用 Windows 作为其主机,而我使用的是 Linux 实例。另外,这个答案涉及到我没有使用的 Eclipse 配置。我不确定它为什么会这样,也不知道如何解决它。

【问题讨论】:

  • 你有父目录/home/ec2-user/aws-java-sample/target/吗?你有那个目录的写权限吗?
  • 不,我运行了命令ls -l,它的权限是d--------- 6 root root 4096 Apr 19 xx:xx aws-java-sample。我尝试更改权限,但一直收到此消息chmod: changing permissions of âaws-java-sample/â: Operation not permitted
  • 你有sudorights 吗?

标签: java linux maven amazon-ec2 aws-java-sdk


【解决方案1】:

我的情况是,当我在控制台中打开目标目录时出现此错误(因此 maven 无法删除它)。
导航出目标文件夹使我可以毫无问题地通过 maven 进行安装。

【讨论】:

    【解决方案2】:

    我在windows中关闭打开的proyect文件夹时解决了

    【讨论】:

      【解决方案3】:

      尝试禁用 IDE 的自动构建可能与 Maven 构建存在冲突。 还要验证该文件夹是否未使用资源管理器或其他一些应用程序在某处打开 如果它不起作用,只需重新启动您的 IDE

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2018-02-18
        • 2019-12-23
        • 2015-11-23
        • 1970-01-01
        • 2018-02-19
        • 2013-11-20
        • 2018-01-08
        • 2012-06-11
        相关资源
        最近更新 更多