您的位置:首页 > 其它

nexus 搭建私服简单步骤

2016-04-12 10:44 330 查看
1. 下载nexus:http://www.sonatype.org/nexus/go, 我下载的是nexus-2.12.1-01-bundle.zip

2. 解压缩包到本地,包含两个文件夹:nexus-2.12.1-01, sonatype-work

3. 进入文件夹:nexus-2.12.1-01\bin\jsw\windows-x86-64, 启动nexus

C:\software\apache-maven-3.3.9\nexus-2.12.1-01\bin\jsw\windows-x86-64>console-nexus

4. open site: http://localhost:8081/nexus/
5. login with: admin/admin123

6. set true to 'download remote indexes'

7 method 1

7.1. modify project pom.xml

<repositories>

<repository>

<id>nexus</id>

<name>Team Nexus Repository</name>

<url>http://localhost:8081/nexus/content/groups/public</url>

</repository>

</repositories>

<pluginRepositories>

<pluginRepository>

<id>nexus</id>

<name>Team Nexus Repository</name>

<url>http://localhost:8081/nexus/content/groups/public</url>

</pluginRepository>

</pluginRepositories>

<dependencies>

<dependency>

<groupId>junit</groupId>

<artifactId>junit</artifactId>

<version>3.8.1</version>

<scope>test</scope>

</dependency>

</dependencies>
7.2. execute command:

C:\software\apache-maven-3.3.9\lyrepo\my-webapp>mvn compile

will retrieve the jars from http://localhost:8081/nexus
8. method 2: using mirror

8.1 set settings.xml

<mirror>

<id>my-org-repo</id>

<name>Repository in My Orgnization</name>

<url>http://localhost:8081/nexus/content/groups/public/</url>

<mirrorOf>central</mirrorOf>

</mirror>
8.2. execute command:

C:\software\apache-maven-3.3.9\lyrepo\my-webapp>mvn compile

will retrieve the jars from http://localhost:8081/nexus
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: