Maven 打包源码

2021-06-21 199点热度 0人点赞 0条评论

准备

使用maven打包源码需要用到maven-source-plugin插件,这个只需要在POM中引入即可。

<profiles>
    <profile>
        <id>develop</id>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.0.1</version>
                    <configuration>
                        <attach>true</attach>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>compile</phase>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>
</profiles>

打包

mvn clean source:jar install

Jalena

原创内容,转载请注明出处! 部分内容来自网络,请遵守法律适用!

文章评论