Nexus Common features are: Specify the central address of the IP, assign your MAVEN project to the address, download the project index from the Central Library, download the dependent component from the repository, and upload the third-party project Jar to the other project group.
After turning on the Nexus service to access the URL address http://localhost:8081/nexus/(recommended to use their own IP address), and then login to the system, the user name password is: admin/admin123.
The most frequent is to click the Repositories button on the left menu bar
Group Warehouse Groups: Nexus manages multiple warehouses with the concept of a warehouse group, so that we request warehouse groups directly in the project to request multiple warehouses managed by the Warehouse group;
Hosted host repository: primarily for publishing internal project artifacts or third-party project artifacts (such as purchase of commercial artifacts) and artifacts that cannot be obtained from public warehouses (such as the JDBC Driver for Oracle)
Proxy Agent Warehouse: Agent of the public remote warehouse;
Virtual Warehouse: Used to fit Maven 1;
The general type of warehouse used is hosted, proxy
Hosted Warehouse Common Type description:
Release repository for the release module in the releases internal module
Snapshots Release the warehouse of the internal SNAPSHOT module
3rd The third party relies on the warehouse, this data is usually downloaded by the internal personnel after the release
If the built Maven project local repository does not have a corresponding dependency package, then it will go to the Nexus to download, if the Nexus does not have this dependency package, go back to the Remote central repository download dependency, these central warehouse is proxy. The Nexus download is successfully downloaded to the local Maven library for project reference.
1, set proxy Agent warehouse (Apache Snapshots/central/codehaus snapshots) to allow remote download,
Other two agent libraries are also set to True
Installation and configuration of 2.Maven local libraries Setting.xml
[HTML]View Plain Copy
- <?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>D:/maven/repository</localRepository>
- <interactiveMode>true</interactiveMode>
- <offline>false</offline>
- <pluginGroups>
- <pluginGroup>org.mortbay.jetty</pluginGroup>
- <pluginGroup>org.jenkins-ci.tools</pluginGroup>
- </pluginGroups>
- <!--Configure permissions, use Default User--
- <servers>
- <server>
- <id>nexus-releases</id>
- <username>deployment</username>
- <password>deployment123</password>
- </server>
- <server>
- <id>nexus-snapshots</id>
- <username>deployment</username>
- <password>deployment123</password>
- </server>
- </servers>
- <mirrors>
- </mirrors>
- <profiles>
- <profile>
- <id>nexus</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- <jdk>1.7</jdk>
- </activation>
- <repositories>
- <!--Private library address--
- <repository>
- <id>nexus</id>
- <url>http://127.0.0.1:1818/nexus/content/groups/public/</url>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- </repositories>
- <pluginRepositories>
- <!--plugin Library address--
- <pluginRepository>
- <id>nexus</id>
- <url>http://127.0.0.1:1818/nexus/content/groups/public/</url>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </pluginRepository>
- </pluginRepositories>
- </profile>
- </profiles>
- <!--activating profile-->
- <activeProfiles>
- <activeProfile>nexus</activeProfile>
- </activeProfiles>
- </settings>
- <span style= "font-family:arial, Helvetica, Sans-serif;" ><span style= "White-space:normal;" >
- </span></span>
3. Publish the project to a
Pom.xml Adding a configuration
[HTML]View Plain Copy
- <distributionManagement>
- <repository>
- <id>nexus-releases</id>
- <name>nexus Release repository</name>
- <url>http://127.0.0.1:1818/nexus/content/repositories/releases/</url>
- </repository>
- <snapshotRepository>
- <id>nexus-snapshots</id>
- <name>nexus Snapshot repository</name>
- <url>http://127.0.0.1:1818/nexus/content/repositories/snapshots/</url>
- </snapshotRepository>
- </distributionManagement>
Then run the Publish
Clean Deploy
After the console has been published successfully
Then go to the warehouse on the database and see if there is a project just released.
4. Upload a third-party jar package
Then click the Select Artifact (s) for upload button to select the jar package to upload, then add arifact
Last point Upload Artifact (s)
View after successful upload
Reference
http://blog.csdn.net/xiaoreqing/article/details/51352751
Http://www.cnblogs.com/luotaoyeah/p/3817465.html
maven--Setup (Nexus use)