Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Maven - Error merging velocity templates: C:\Windows\system32\my-app\pom.xml

 
Alejandro Barrero
Ranch Hand
Posts: 335
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to learn Maven; I downloaded it, unzipped it and set "<localRepository>C:\Java\maven_repo</localRepository>" in settings.xml. At section 2.2 of the book "Better Builds with Maven" it says to execute "mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app". I am the error "Error merging velocity templates: C:\Windows\system32\my-app\pom.xml (The system cannot find the path specified)".



 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is your current working directory? I hope that it is not C:\Windows\system32! I do all of my work in c:\opt.
 
Alejandro Barrero
Ranch Hand
Posts: 335
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your answer. I have never set a current working directory; I didn't even know it was possible. I ran echo %cd% in DOS and got "C:\Windows\system32"; I then created the system variable cd as "C:\Java\apache-maven-3.0.3\Local Directory" and after restarting the computer, echo %cd% gave me the value. However, I am still getting the same error from Maven; I am at a loss.
 
Alejandro Barrero
Ranch Hand
Posts: 335
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem was that I was running the command on "C:\Windows\system32" and it bwas trying to created a directory there.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was running the command on "C:\Windows\system32" and it bwas trying to created a directory there.

That is what I thought. Don't do that, especially in Windows 7 or Server 2008 SR2 (or Vista for that matter) because that is a "protected" directory and you need additional permissions to change things there.

The best thing to do is create a directory elsewhere and work in there. With Windows 7, working in c:\users\xxx\Documents is acceptable - at least there are no spaces in the path.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic