Wednesday, October 3, 2012

How to build Maven Repository


  1. Download nexus war file from http://www.sonatype.org/downloads/nexus-2.1.2.war
  2. Rename nexus-2.1.2.war to nexus.war. 
  3. Put nexus.war into your tomcat webapp folder. 
  4. Start tomcat server 
  5. Login your nexus server:  http://127.0.0.1:8080/nexus (the default user/password: admin/admin123)
  6. Use the web UI to upload your jar file, as follows: 
  • Select the "3rd party" repository
  • Choose the "Artifact Upload" tab. 
  • Follow the steps in the screen to choose your jar file to upload. 

  • Choose the "Browse Storage" tab to check your uploaded jar file
  • Double click your uploaded jar file (i.e, Test-1.jar) will show the dependency content for pom.xml

In you pom.xml, you need to add the following content to connect your maven repository: 
  • <repositories>
  • <repository>
  • <id>VPDC</id>
  • <name>VPDC Repository</name>
  • <url>http://localhost:8080/nexus/content/groups/public/</url>
  • </repository>
  • </repositories>
To get your uploaded jar file (i.e., Test.jar), you also need to add the following content in your pom.xml: 
  • <dependency>
  • <groupId>org.springframework</groupId>
  • <artifactId>spring-hibernate3</artifactId>
  • <version>2.0.8</version>
  • </dependency>

3 comments:

  1. This comment has been removed by the author.

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
  2. This comment has been removed by the author.

    ReplyDelete