若是构建的 n Maven 项目本地仓库没有对应的依赖包,那么就会去 s Nexus 私服去下载,若是 Nexus 私服也没有此依赖包, 就回去远程中央仓库下载依赖, 这些中央仓库就是 proxy 。 Nexus 私服下载成功后再下载至本地 Maven(可是若是私服没有网络不能正常下载,本地也会跳过私服从新下载) apache
系统须要安装并配置好 JDK,下载好Sonatype Nexus(版本地址:nexus-2.13.0-01-bundle.tar.gz)、maven(版本地址:apache-maven-3.3.9-bin.tar.gz)。提示:nexus3不支持maven不要下错了,下的时候看清楚bash
mkdir nexus tar -zxvf nexus-2.13.0-01-bundle.tar.gz -c nexus
cd nexus-2.13.0-01/bin vi nexus
将 RUN_AS_USER 修改成用权限运行的用户网络
# If specified, the Wrapper will be run as the specified user. # IMPORTANT - Make sure that the user has the required privileges to write into the Nexus installation directory. # NOTE - This will set the user which is used to run the Wrapper as well as # the JVM and is not useful in situations where a privileged resource or # port needs to be allocated prior to the user being changed. RUN_AS_USER=root
cd nexus-2.13.0-01/bin ./nexus start
用户权限设置oracle
<!--配置权限,使用默认用户--> <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>
<profiles> <profile> <!--id 须要惟一--> <id>test1</id> <activation> <activeByDefault>false</activeByDefault> <!-- jdk版本触发激活,配置成本地的jdk版本--> <jdk>1.8</jdk> </activation> <repositories> <!-- 私有库地址--> <repository> <id>nexus</id> <url>http://192.168.0.112:8081/nexus/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <!--插件库地址--> <pluginRepository> <id>nexus</id> <url>http://192.168.0.112:8081/nexus/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </pluginRepository> </pluginRepositories> </profile> </profiles>
<!--激活profile--> <activeProfiles> <activeProfile>test1</activeProfile> </activeProfiles>
<distributionManagement> <repository> <id>nexus-releases</id> <name>Nexus Release Repository</name> <url>http://192.168.0.112:8081/nexus/content/repositories/releases/</url> </repository> <snapshotRepository> <id>nexus-snapshots</id> <name>Nexus Snapshot Repository</name> <url>http://192.168.0.112:8081/nexus/content/repositories/snapshots/</url> </snapshotRepository> </distributionManagement>
maven在构建(install) 的时候加上 deploy 参数就能够将jar本地jar发布到中央库app
第三方jar包上传maven
点击3rd 而后选择Artifacts Uploadtcp
选择文件而后设置GAV Definition网站
选择 Select Artifact(s) for Upload 而后选择文件ui
点击add 而后点击uploadurl