Where does Maven store the dependencies?

Last time I declared this Maven dependency in my pom.xml:

<dependency>
  <groupId>com.tinkerpop.blueprints</groupId>
  <artifactId>blueprints-core</artifactId>
  <version>1.2</version>
</dependency>

I then requested the download of this dependency and got blueprints-core-1.2.jar. But where has this dependency been saved? I then found out that the dependencies are saved to the user’s Maven home directory (e.g. C:\Users\bennyn\.m2).

Finally I found the file here:
C:\Users\bennyn\.m2\repository\com\tinkerpop\blueprints\blueprints-core\1.2\blueprints-core-1.2.jar

You can also specify the location yourself. To do that, you just have to change the Maven local repository in the settings.xml:

<?xml version="1.0" encoding="UTF-8"?>
<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 http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <localRepository>C:\dev\temp</localRepository>
  ...
</settings>

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.