Maven 2 : java.net.URISyntaxException : Illegal character in path at index 18:
Environment Maven 2.0/ Windows XP/ Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_09-b03)
I had a peculiar problem with Maven 2.0, my builds were working fine and one fine monday morning, I got a problem
Caused by: java.lang.RuntimeException: Not a valid URL: file:/C:/Documents and Settings/rnallakukkala/.m2
at org.jboss.util.file.ArchiveBrow
at org.hibernate.ejb.Ejb3Configura
… 75 more
Caused by: java.net.URISyntaxException : Illegal character in path at index 18: file:/C:/Documents and Settings/rnallakukkala/.m2
at java.net.URI$Parser.fail(URI.java:2816)
at java.net.URI$Parser.checkChars(URI.java:2989)
at java.net.URI$Parser.parseHierar
at java.net.URI$Parser.parse(URI.java:3021)
at java.net.URI.<init>(URI.java:578)
when trying to look for a dependency jar (this dependency jar is available in my local repository)
Additional Information for this problem
- Found that this problem has been reported to maven here
- Root problem is that there is a space in the maven repository path location.
- Related bug has been raised in Java here, unfortunately closed as “will not be fixed”.
Solution
- Change the local repository location to a different path without spaces.
Configuring your Local Repository
- You can specify your user configuration in ${user.home}/.m2/settings.xml
- Location can be modified through the following configuration changes (to the above file)
<settings>
... <localRepository>/path/to/local/repo/</localRepository> ... </settings>
Written by Ravi Nallakukkala on March 25th, 2007 with
no comments.
Read more articles on Build.
- [+] Digg: Feature this article
- [+] Del.icio.us: Bookmark this article
- [+] Furl: Bookmark this article