本地仓库的创建
下载 nexus-2.11.4-01-bundle.zip 解压并运行C:\nexus-2.11.4-01-bundle\nexus-2.11.4-01\bin\jsw\windows-x86-64\console-nexus.bat (不同系统选择不同目录)
http://127.0.0.1:8081/nexus/登录,admin/admin123
更新central ,codehanus snapshots,apache snapshots 的download remote index为true,
如果需要存放自定义的jar包,选择 3rd party, 选择artifact upload,设置好相关信息,选择jar包并上传,在browse index中可以看见成功的jar包及
xml
如:
<dependency>
<groupId>xiao.chang.wei</groupId>
<artifactId>xiaotest</artifactId>
<version>2.0.1</version>
</dependency>
将此xml拷贝到pom.xml中即可加载相应的jar包
本地pom.xml配置
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.xiao</groupId> <artifactId>Test001</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>war</packaging> <properties> <argLine>-Dfile.encoding=UTF-8</argLine> </properties> <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>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.5</version> <scope>provided</scope> </dependency> <dependency> <groupId>xiao.chang.wei</groupId> <artifactId>xiaotest</artifactId> <version>2.0.1</version> </dependency> </dependencies> </project>
原文:http://www.cnblogs.com/xiaochangwei/p/4949218.html