Aditya
Aditya

Reputation: 1268

Where does maven install jars?

So I copied a Repo from my team lead's work-space into my work-space. Literally using unix CP.

Now whenever I run mvn clean install, it installs the compiled jar into the his work space.

I have checked the pom.xml in the repo and it doesn't explicitly define the target location.

I've also checked my printenv. There is no mention of my TL's work-space in any of the environment variables. Where is the location of my TL's work-space coming form?

Upvotes: 6

Views: 6887

Answers (2)

Markus Schreiber
Markus Schreiber

Reputation: 371

in the .m2 repository there is a settings.xml which normally includes a path, since you just copied it you will most certenly have his path there

  • Windows: C:\Users\USERNAME.m2\settings.xml
  • Linux:/home/USERNNAME/.m2/settings.xml

In the file there is a 'localRepository' tag (Check it)

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      https://maven.apache.org/xsd/settings-1.0.0.xsd">
  <localRepository>SomePath/.m2/repository</localRepository>
  <interactiveMode>true</interactiveMode>
  <offline>false</offline>
  ...
</settings>

Upvotes: 4

SystemGlitch
SystemGlitch

Reputation: 2262

You can find your installed JARs and dependencies in your local repository.

By default, you can find it here:

  • Windows: C:\Users\USERNAME\.m2\repository
  • Linux: /home/USERNNAME/.m2/repository
  • MacOS: /Users/USERNAME/.m2/repository

Upvotes: 5

Related Questions