赞
踩
先准备私库地址:
http://localhost:8081/nexus3/repository/maven-releases
http://localhost:8081/nexus3/repository/maven-snapshots
假如现需要将私有的jar发布到私库,步骤过程如下:
如果发布到releases私库(与build标签平级放入)
<distributionManagement>
<repository>
<id>releases</id>
<url>http://localhost:8081/nexus3/repository/maven-releases/</url>
</repository>
</distributionManagement>
如果发布到snapshots私库(与build标签平级放入)
<distributionManagement>
<snapshotRepository>
<id>snapshots</id>
<url>http://localhost:8081/nexus3/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
在servers标签下增加如下配置,配置发布到私库的账号和密码(如nexus3的账号admin和密码admin123)
<server>
<id>releases</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
</properties>
<!-- 编译插件 --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <encoding>${project.build.sourceEncoding}</encoding> <source>${java.version}</source> <target>${java.version}</target> <compilerArgs> <arg>-parameters</arg> </compilerArgs> </configuration> </plugin> <!-- Source attach plugin --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> <executions> <execution> <id>attach-sources</id> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin>
mvn clean deploy
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。