在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
IDEA 打包生成source.jar的方法

相关文章:

  • 2022-12-23
  • 2021-07-05
  • 2021-08-03
猜你喜欢
  • 2021-11-19
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2021-10-29
  • 2021-11-27
相关资源
相似解决方案