*
The moose likes Ant, Maven and Other Build Tools and the fly likes How to set an output directory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "How to set an output directory" Watch "How to set an output directory" New topic
Author

How to set an output directory

Rusty Enisin
Ranch Hand

Joined: May 26, 2005
Posts: 107
I know nothing about Maven. But I am working through a tutorial that includes a pom.xml. Inside are listed all the dependant jars. When I run maven I cannot see where it downloads all the jars to. How can I specify a directory to which maven will put all the jars it downloads?


The squeaky wheel gets the grease. Well, that or replaced...
Karthik Rajendiran
Ranch Hand

Joined: Aug 13, 2004
Posts: 211
Hello Friend

If it is WIndows machine
C:\documents and settings\<LOGON ID>\.maven\repository


SCJP 1.4 SCWCD 1.4 SCDJWS 1.4
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

This is called the 'local repository' in Maven. If you want to specify a different directory, in your %USER_HOME%\.m2 directory create a file called 'settings.xml' and place the following in it:


if you want your repository to be in C:\.m2 (or you can specify any other location). On a windows machine, you may actually have to do this because of the spaces in the path of the default repository location - it causes some plugins to throw weird errors like 'and is not a recognized protocol' - because of file:///Documents *and* Settings/....)


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Rusty Enisin
Ranch Hand

Joined: May 26, 2005
Posts: 107
Hey. Thanks. That really helps. I also found that I just needed to run "mvn package" and it would put everything in a directory called "target". And it compiled the .war file. Very smooth tool once you figure out how to use it.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to set an output directory
 
Similar Threads
Struts 2 tutorial errors
Simple MAVEN questions
maven pom.xml: downloading dependancy from maven public repository
maven / web inf
struts2-maven File not found exception problem