maven-resources-plugin:2.5 - Cannot create resource output directory

docker maven cannot create resource output directory
org.apache.maven.plugin.mojoexecutionexception: cannot create resource output directory:
cannot create file access denied target/classes
maven compile cannot create resource output directory
maven executionexception
failed to execute goal org/apache maven/plugins/maven-compiler-plugin:2.0 2 compile
maven compilation failure
failed to execute goal org apache maven plugins:maven-clean-plugin:3.1 0 clean (default-clean)

I occasionally receive this error when I build my project with

>mvn --version
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 15:51:28+0200)
Maven home: ...\apache-maven-3.0.5
Java version: 1.6.0_45, vendor: Sun Microsystems Inc.
Java home: ...
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

and the error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.5:resources 
(default-resources) on project project-name: Cannot create resource output directory: 
 path\to\project\code\project-name\target\classes -> [Help 1]

Note: this happens sometimes, and it is not related to the code. It can happen in one of two consecutive builds - one after the other, against exactly the same source code.

Does anyone have any idea how to avoid it completely? It tends to interrupt quite a time-consuming build :-/

On Windows, there reasons for being unable to create a folder are:

  1. Some other process is deleting this folder at the same time
  2. You don't have permissions to access this folder
  3. The folder is on a network share

Network shares are notoriously unreliable on Windows. Don't use them for any automated tasks. Always build projects with all files residing on a local hard disk.

If you use Maven and Eclipse to build at the same time, you should configure them to use different target folders. See https://stackoverflow.com/a/54366009/34088

Your POM should look like this:

<project>
  ...

  <build>
    <outputDirectory>${basedir}/${target.dir}/classes</outputDirectory>
    <testOutputDirectory>${basedir}/${target.dir}/test-classes</testOutputDirectory>
  </build>

  <properties>
    <target.dir>target</target.dir>
  </properties>

  <profiles>
    <profile>
      <id>eclipse-folders</id>
      <properties>
        <target.dir>target-eclipse</target.dir>
      </properties>
    </profile>
  </profiles>
  ...  

All that's left is to enable the profile eclipse-folders in the IDE.

Cannot create resource output directory when searching for nested , goal org.apache.maven.plugins:maven-resources-plugin:2.5:resources ( default-resources) on project project-name: Cannot create resource output directory:� The Maven resources plugin:. This goal requires that you configure the resources to be copied, and specify the outputDirectory. Copy two (or more) external resource directories within the basedir to the build output directory using maven (see blah and uggh).

Disable the automatic build of your IDE (Eclipse or IntellJ IDEA or whatever). It will conflict with the Maven build.

maven-resources-plugin fails to create folders error, maven-resources-plugin:2.5 - Cannot create resource output directory. maven. I occasionally receive this error when I build my project with. >mvn --version� [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.5:resources (default-resources) on project project-name: Cannot create resource output directory: path\to\project\code\project-name\target\classes -> [Help 1] Note: this happens sometimes, and it is not related to the code.

I experience this issue every time I run the command while I have the output folder or the parent folder opened in Windows Explorer.

If I move one level above the parent, the build ends successfully.

(default-resources) on project support-checkstyle: Cannot create , Whem searching for nested resources (*/.css) a misparse folder can't be created; goal net.alchim31.maven:yuicompressor-maven-plugin:1.3.0:compress ( default) on project freak-core: Cannot create resource output d here is mine: Failed to execute goal net.alchim31.maven:yuicompressor-maven-plugin:1.3.0:compress (default) on project alfresco-mm-share: Cannot create resource output directory: D:\Projects\AfrescoSource\AlfrescoMM\alfresco-mm-share\target\classes\D:\Projects\AfrescoSource\AlfrescoMM\alfresco-mm-share\target\alfresco-mm-share-1.0-SNAPSHOT\web\mediamanagement\components\documentlibrary -> [Help 1]

For me the reason for this was only being in said folder with my git bash while building. Ensure that you don't happen to have the said folder open in any other program.

Quick install lead to build failure., gmail.com>. Subject, maven-resources-plugin fails to create folders error MojoExecutionException: Cannot create resource output directory:� The output directory into which to copy the resources. By supplying extraFilters configurations, you can separate which filters are used for which type of resource.

I had the exact same issue when trying to run the First Cup tutorial.

I fixed it by simply closing NetBeans and running it as administrator (via right click).

maven — maven-resources-plugin : 2.5-자원 출력 디렉토리를 작성할 , plugins:maven-resources-plugin:2.5:resources (default-resources) on project support-checkstyle: Cannot create resource output directory: /usr/local/ddf/ support/� The Resources Plugin copies files specified by Resource elements, to an output directory. The three variations below only differ in how the resource and output directory elements are specified or defaulted. The Resources Plugin has three goals: resources:resources copies the resources for the main source code to the main output directory.

Protege Developer, Just did fresh install of maven and a git clone of ddf from github. org.apache. maven.plugins:maven-resources-plugin:2.5:resources (default-resources) on MavenFilteringException: Cannot create resource output directory:� IDEA warns you that the directory is not a valid package name, but it doesn't prevent you from creating it. I am using EAP 94.585 I have a project that was imported into IJ from Maven. For the 'xform' module I have marked the directories: xform/src/test/java & xform/src/test/resources as test sources. I am unable to create a directory using IJ

Solved: Problem with a build of spring boot project, Apache.maven.plugins:maven-resources-plugin:2.5:resources (default-resources ) on project project-name: Cannot create resource output directory:� Tech support scams are an industry-wide issue where scammers trick you into paying for unnecessary technical support services. You can help protect yourself from scammers by verifying that the contact is a Microsoft Agent or Microsoft Employee and that the phone number is an official Microsoft global customer service number.

[INFO] --- maven-clean-plugin:2.5:clean (default-clean) lt-resources) on project protege-editor-owl: Cannot create resource output [ERROR] After correcting the problems, you can resume the build with the command One possibility is that you do not have permissions to create the indicated directory. The remote_directory resource can be used to recursively create the path outside of remote directory structures, but the permissions of those outside paths are not managed. This is because the recursive attribute only applies group , mode , and owner attribute values to the remote directory itself and any inner directories the resource copies.

Comments
  • Does it happen on a CI Server (Jenkins, ...) or on a developers workstation. In which frequency is maven called?
  • I remember it happened just once on CI server; it happens more often locally, say one of 4 times, in different modules of the project.
  • Possible duplicate of Could not transfer artifact org.apache.maven.plugins:maven-surefire-plugin:pom:2.7.1 from/to central (http://repo1.maven.org/maven2)
  • Of all the listed, it seems it can be "1. Some other process is deleting this folder at the same time"
  • Is there any other process using the same folder (e.g. Eclipse?)
  • Could it be Intellij IDEA? and if so, what would be a possible solution to this?
  • That might be. I know this problem using Eclipse: Maven cleans out the resources, the Eclipse Compiler thinks "hey, someone is stealing my class files and resources, lets recompile". And then we have the conflict that Maven and the IDE work in the same directory and strange things happen (e.g. Tests fails that usually work, directoies are locked,...)
  • I did closed the Windows Explorer, Hit refresh on the project, and Project> clean; then build worked fine
  • for me, same issue, even after enabling/disabling the automatic builds, Eclipse.
  • I did closed the Windows Explorer, Hit refresh on the project, and Project> clean; then build worked fine
  • This was my problem