This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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...
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/....)
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Joined: May 26, 2005
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.