当前位置: 代码迷 >> 综合 >> maven项目生成源码包
  详细解决方案

maven项目生成源码包

热度:22   发布时间:2024-02-23 06:22:05.0

 将maven项目生成的jar放入仓库后,如果不放源码的话,其他人(同事)在使用这个maven依赖时会很不方便。

pom.xml

<build>的<plugins>中

            <!--配置生成源码包--><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-source-plugin</artifactId><version>3.0.1</version><executions><execution><id>attach-sources</id><goals><goal>jar</goal></goals></execution></executions></plugin>