Creating your Local Repository

Tihomir R. Todorov

Version 0.0.2
Copyright © 2010 Tihomir R. Todorov
11.22.2010
Revision HistoryCommentDateName
tutorial.maven.creating-local-repo_0.0.2.v20101127-2220Refactoring11.27.2010Tihomir R. Todorov
tutorial.maven.creating-local-repo_0.0.1.v20101122-2023Article created11.22.2010Tihomir R. Todorov

Open a new command prompt (Winkey + R then type cmd) and run mvn3. You should see the following:

This call create a folder .m2 in your user folder. Go to the folder (cd %USERPROFILE%\.m2) -> remove the repository folder (rmdir repository /S /Q) -> create a file settings.xml (notepad settings.xml) -> confirm with Yes -> and insert the following xml content in the notepad editor.

<?xml version="1.0" encoding="UTF-8"?>

<settings>

  <localRepository>C:\Portable\maven\my-repo</localRepository>

  <!--
  <proxies>
    <proxy>
      <active>true</active>
      <protocol>http</protocol>
      <host>your proxy host</host>
      <port>your port number</port>
      <username>your username</username>
      <password>your password</password>
      <nonProxyHosts>127.0.0.1 | localhost</nonProxyHosts>
      <id></id>
    </proxy>
  </proxies>
  -->

  <mirrors>
    <mirror>
      <id>maven3.family-todorov.de</id>
      <name>My Maven 3 Repo</name>
      <url>http://maven3.family-todorov.de</url>
      <mirrorOf>central</mirrorOf>
    </mirror>
  </mirrors>

</settings>
      

Ctrl+S->Alt+F4

Well, you have created now your local repository! You can find the repository folder called my-repo in C:\Portable\maven.

Done!