java.io.FileNotFoundException while building Maven project

Viewed 39

I am facing below problem. I thought it is because of the some special chars in the following path as "C:\Users\Meri�.m2\r". I changed the encoding type as in the most upvoted answer UTF8 Encoding but error still persist. I check the file path and I can see that there is a jar file called, maven-antrun-plugin-1.7.jar.

--- maven-antrun-plugin:1.7:run (generate-status-code-file) @ bla_bla ---
    [WARNING] Parameter tasks is deprecated, use target instead
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time:  6.015 s
    [INFO] Finished at: 2022-09-22T12:01:52+03:00
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (generate-status-code-file) on project bla_bla: An Ant BuildException has occured: The following error occurred while executing this line:
    [ERROR] java.io.FileNotFoundException: C:\Users\Meri�\.m2\repository\org\apache\maven\plugins\maven-antrun-plugin\1.7\maven-antrun-plugin-1.7.jar 
    [ERROR] -> [Help 1]

What can I do to fix this error?

Note: I imported a maven project from a repo, to my eclipse. I added specific settings.xml file added to maven settings. Then tried to build the project.

2 Answers

Your problem is likely caused by a schizophrenic character encoding situation, typical of some Windows installations. It's having a problem with the Unicode/native encoding in the area of the 'complex' characters in your home directory path. If you find out the DOS name of your home dir by dir C:\Users /ad/x then you can try something like mvn -Duser.home=C:\Users\MYNAME~1 compile.

Move the project out of your home directory.

Related