Maven发布源码包

Maven发布源码包

第一步

按照官网的Usage,在pom文件中添加如下内容:

<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>
                    <phase>verify</phase>
                    <goals>
                        <goal>jar-no-fork</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

第二步

执行如下命令:

mvn source:jar deploy

注意事项

需要把配置添加到具体的pom中,不能是父pom。

猜你喜欢

转载自blog.csdn.net/woshismyawei/article/details/80703424