Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to set an output directory

 
Rusty Enisin
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Karthik Rajendiran
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Friend

If it is WIndows machine
C:\documents and settings\<LOGON ID>\.maven\repository
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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/....)
 
Rusty Enisin
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic