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

前端 未结 9 998
我寻月下人不归
我寻月下人不归 2020-12-18 19:01

I occasionally receive this error when I build my project with

>mvn --version
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602         


        
9条回答
  •  渐次进展
    2020-12-18 19:35

    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:

    
      ...
    
      
        ${basedir}/${target.dir}/classes
        ${basedir}/${target.dir}/test-classes
      
    
      
        target
      
    
      
        
          eclipse-folders
          
            target-eclipse
          
        
      
      ...  
    

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

提交回复
热议问题