How do I exclude the sources jar in mvn deploy?

后端 未结 7 902
半阙折子戏
半阙折子戏 2021-01-01 17:03

When I run \"mvn deploy:deploy\", maven deploys 4 jar files to my internal remote repository.

They are:

[module-name]-1.jar
[module-name]-1.pom
[modu

相关标签:
7条回答
  • 2021-01-01 17:31
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.0.1</version>
        <configuration>
            <attach>false</attach>
        </configuration>
        <executions>
            <execution>
                <phase>package</phase>
                <id>attach-sources</id>
                <goals>
                    <goal>jar</goal>
                </goals>           
            </execution>
        </executions>
    </plugin>
    

    The attach parameter specifies whether the java sources will be attached to the artifact list of the project.
    <attach>false</attach>

    0 讨论(0)
提交回复
热议问题