mvn配置文件修改
<server>
<id>maven-repository</id>
<username>admin</username>
<password>admin</password>
</server>
工程pom.xml配置
配置生成源码
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.0.1.RELEASE</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
配置上传的中央仓库
<distributionManagement>
<repository>
<!-- 这里的ID要和setting的id一致 -->
<id>maven-repository</id>
<url>https://repository.nero.cn/repository/third/</url>
</repository>
<!--这是打成快照版本的配置,如果不用这个snapshotRepository标签,打包失败,会报权限问题 -->
<!-- <snapshotRepository>
<id>maven-repository-snapshots</id>
<url>https://repository.nero.cn/repository/snapshots/</url>
</snapshotRepository>-->
</distributionManagement>
上传
$ mvn clean deploy