1.制定jdk版本插件
<!--指定jdk版本-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<!-- 检索级别-->
<source>1.8</source>
<!-- 打包级别-->
<target>1.8</target>
</configuration>
</plugin>
2.自定义jar包生成源码插件
<!-- 生成源码jar 插件-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>