IDEA 打包生成source.jar的方法

在pom.xml中添加插件:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-source-plugin</artifactId>
  <executions>
    <execution>
      <id>attach-sources</id>
      <goals>
        <goal>jar</goal>
      </goals>
    </execution>
  </executions>
</plugin>

执行maven命令:
mvn source:jar
或者点击下图中的install

posted @ 2021-12-08 19:21  还可入梦  阅读(191)  评论(0编辑  收藏  举报