Sonatype Nexus Open Source (Nexus OSS) is a repository manager for maven repositories.
Prerequisites
Maven
Versions used
Nexus OSS 2.0.5-04
Maven 3.0.4
Steps
- Download the nexus oss zip package from http://sonatype.org/nexus
- Extract the zip file to a folder created for nexus e.g. C:\nexus
- Installation is complete
Running nexus
- Open a command prompt window and navigate to the the NEXUS_HOME\bin directory e.g. C:\nexus\nexus-2.0.5-04\bin\
- Run the command nexus.bat console
- Open a browser and navigate to localhost:8081/nexus. The nexus interface should be displayed.
- To install nexus as a service, run the command nexus.bat install
- The nexus service name is nexus-webapp. Now you can start/stop nexus like any other service e.g. using the command net start nexus-webapp. To uninstall the service, run the command nexus.bat uninstall
- On the nexus home page, click on the Log In link. The default login username/password is admin/admin123. There is also a default deployment user with username/password deployment/deployment123. You can change any of these passwords by expanding the Security section on the left hand pane, selecting the Users option, right-click on the desired user and selecting the Set Password context menu.
Configuring maven to use nexus
- You can set maven to look for artefacts from nexus instead of directly from the internet e.g. the maven central repository. A Nexus proxy repository acts as a local cache for a remote repository.
- Create or edit the USER_HOME_DIR\.m2\settings.xml file e.g. C:\Users\ANDY\.m2\settings.xml, to configure nexus as the mirror for all repositories e.g.
nexus external:* http://localhost:8081/nexus/content/groups/public nexus central http://central true true central http://central true true nexus
No comments:
Post a Comment