Tuesday, October 28, 2014

Maven Central Repository as proxy in Nexus manager.

In nexus console

Figure 1. Set Repository Central proxy point to http://repo1.maven.org/maven2/

Figure 2. Add Repository Central proxy into Group Repositories.

The Ordered Group Repositories is used to order repositories, which is applied to look up library respectively.

In settings.xml, create a nexus profile and also active a nexus profile.

<mirrors>
<mirror>
<!--This sends everything else to /public -->
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://172.17.2.212:8089/nexus/content/groups/public</url>
</mirror>
</mirrors>

<profiles>

<profile>
<id>nexus</id>
<!--Enable snapshots for the built in central repo to direct -->
<!--all requests to nexus via the mirror -->
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
<repository>
<id>primeface-releases</id>
<url>http://172.17.2.212:8089/nexus/content/repositories/primeface-releases/</url>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>primeface-releases</id>
<url>http://172.17.2.212:8089/nexus/content/repositories/primeface-releases/</url>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
  </profiles>
  
  <activeProfiles>
<!--make the profile active all the time -->
<activeProfile>nexus</activeProfile>
  </activeProfiles>

2 comments:

  1. Hello Wittakarn, I am Derek Weeks from Sonatype. We are really happy to see your blog discussing Nexus and we would love to bring it some more visibility. We recently started up a new Nexus community site with loads of articles, free training, videos, and members only features. If you are interested, we would love to cross-post your blog on the community, giving your article and you as the author more visibility to the rest of the Nexus community. I am sure others would find the article just as useful as I did. Our Nexus community site “TheNexus” can be found at: http://www.sonatype.org/nexus/

    Reach out to me at “weeks[at]sonatype dotcom” and I can introduce you to our Nexus community advocate, Mark Miller. We can then work to get your article up on the site. Of course, Sonatype will help with more visibility by promoting the article through our community, twitter, LinkedIn, G+, Facebook and other communities.

    Are you in? Let me know.

    ReplyDelete
  2. Casino - Bracket betting guide for your chance to win
    The Casino is a unique casino that nba매니아 has been around for over a decade. It has managed to bsjeon.net offer great games such as 토토 Blackjack, wooricasinos.info Roulette and https://septcasino.com/review/merit-casino/ Video Poker,

    ReplyDelete