1.要将源码包放上私服,首先pom文件要修改插件(针对springboot项目)
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin>
2.在pom文件添加如下配置(里面路径是你自己的私服地址)
<distributionManagement> <repository> <id>Releases</id> <name>Project RELEASE</name> <url>http://xxxxxxx:8081/nexus/content/repositories/releases</url> </repository> <snapshotRepository> <id>Snapshots</id> <name>Porject SNAPSHOTS</name> <url>http://xxxxxxx:8081/nexus/content/repositories/snapshots</url> </snapshotRepository> </distributionManagement>
3.在maven的配置文件setting.xml中,添加配置
<servers> ...... <server> <!--与第一步中id配置一致--> <id>Releases</id> <username>xxx</username> <password>xxx</password> </server> <server> <!--与第一步中id配置一致--> <id>Snapshots</id> <username>xxx</username> <password>xxx</password> </server> </servers>
4.运行命令
mvn deploy -Dmaven.test.skip=true