1.要將源碼包放上私服,首先pom文件要修改插件(針對springboot項目)spring
<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文件添加以下配置(裏面路徑是你本身的私服地址)apache
<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中,添加配置springboot
<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.運行命令maven
mvn deploy -Dmaven.test.skip=true
url