I can run "mvn install" it builds the project successfully. And I can build it with "Preferences | Build, Execution, Deployment | Build Tools | Maven | Runner | 'Delegate IDE build/run actions to maven option". But IntelliJ default build fails with the following error message:

"Error:Maven Resources Compiler: Failed to copy '/Users/user/Projects/r2d2/projects/blabla_service/src/main/resources/application.properties' to '/Users/user/Projects/r2d2/projects/blabla_service/target/classes/.': /Users/user/Projects/r2d2/projects/blabla_service/target/classes/. (Is a directory)"

IntelliJ Version:

IntelliJ IDEA 2019.1 (Ultimate Edition)
Build #IU-191.6183.87, built on March 27, 2019
Licensed to ...
JRE: 1.8.0_202-release-1483-b39 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.13.6

P.S All projects were buildable via IntelliJ, I exactly don't know which point it started to give error. For being sure I updated ide to the recent version.

3 Answers 3


I had the same error with Intellij Community Edition 2018.2 one day after syncing the latest code from the repo in my workspace. I did rebuild all the dependency modules explicitly and then it started working.


I had the same problem, I had used the command line to build the project so I needed to run sudo mvn clean since my user didn't have permission to delete the sudo owned files.


This error happens when you put your project files in 'Desktop' directory on macOS. It seems like 'Desktop' directory is not given proper access for running the project on IDE by macOs. I resolved this problem by creating a 'dev/myProject' directory under terminal home (the home directory it points to while opening a new terminal i.e. cd ~/)

mkdir ~/dev/myProject

  • 1
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Apr 11, 2023 at 5:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .