下面是pom,直接粘贴使用便可
<build>
<finalName>message-router</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<!-- 剔除配置文件 -->
<excludes>
<exclude>*.properties</exclude>
<exclude>*.xml</exclude>
</excludes>
<archive>
</archive>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<!--本地依赖包不打入-->
<includeSystemScope>false</includeSystemScope>
<layout>ZIP</layout>
<!-- 主类路径-->
<mainClass>com.sjtu.messagerouter.MessageRouterApplication</mainClass>
<!-- 任何依赖都不打入到jar包-->
<includes>
<include>
<groupId>nothing</groupId>
<artifactId>nothing</artifactId>
</include>
</includes>
<!-- 下面的依赖排除掉,不放入libs-->
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
<!--拷贝依赖到jar外面的libs目录-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>
${project.build.directory}/libs
</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<!-- 指定仓库源,从百度的仓库下载-->
<repositories>
<repository>
<id>baidu-nexus</id>
<url>http://maven.scm.baidu.com:8081/nexus/content/groups/public</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>