aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Maven - Error merging velocity templates: C:\Windows\system32\my-app\pom.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Maven - Error merging velocity templates: C:\Windows\system32\my-app\pom.xml" Watch "Maven - Error merging velocity templates: C:\Windows\system32\my-app\pom.xml" New topic
Author

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

Alejandro Barrero
Ranch Hand

Joined: Aug 01, 2005
Posts: 319
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)".




Your help will be greatly appreciated,
Alejandro Barrero
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

What is your current working directory? I hope that it is not C:\Windows\system32! I do all of my work in c:\opt.


JBoss In Action
Alejandro Barrero
Ranch Hand

Joined: Aug 01, 2005
Posts: 319
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

Joined: Aug 01, 2005
Posts: 319
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

Joined: May 14, 2008
Posts: 5836
    
    7

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Maven - Error merging velocity templates: C:\Windows\system32\my-app\pom.xml