公司架构调整,后期使用RocketMQ和spring boot进行项目开发。由于spring boot没有集成RocketMQ的start包,所以自己写了一个简单的rocketmq-spring-boot-start应用。在此记录将应用生成jar包上传maven私服过程中遇到的几个问题。
首先回顾下上传过程中的配置:
1、pom.xml的配置
<build>
<plugins>
<!-- compile -->
<plugin>
<artifactId>maven-source-plugin</artifactId>
<configuration>
<attach>true</attach>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<distributionManagement>
<repository>
<id>releases</id>
<name>releases</name>
<url>http://xxx:8081/repository/rocketmq-spring-boot-starter/</url>
</repository>
</distributionManagement>
2、setting.xml的配置
<server>
<id>releases</id>
<username>username</username>
<password>password</password>
</server>
<server>
<id>snapshots</id>
<username>username</username>
<password>password</password>
</server>
3、eclipse打包
右击项目 -> Run As -> Run Configurations。Goals填上deploy,点击Run,就能直接上传maven私服。
在引入项目时,发现rocketmq-spring-boot-start的jar包不能使用,核心代码BOOT-INF文件夹下面,引入其他项目后无法正常读取。
解决方法:去除pom.xml中的spring-boot插件再次打包
eclipse上传nexus私服配置参考:https://www.jianshu.com/p/f0c87c7d4353