Maven releases plugins for passes, but do not cook

When using the maven release plugin, tests mvn release:performlike mvn release:prepareand mvn release:perform.

Is it possible to somehow configure things so that they only start on time mvn release:prepare?

I know you can pass:

-Darguments="-DskipTests"

But this will skip tests during both goals, which I don't want. And I also don’t want them to start only on time mvn release:performand don’t get ready, because a crash during execution already marks the repository.

+5
source share
1 answer

You must do this by adding an item <releaseProfiles>to the release plugin configuration. This will only be used for release: run Mojo.

- :

<build>
    <plugins>
        <plugin>
            <artifactId>maven-release-plugin</artifactId>
            <configuration>
                <releaseProfiles>skipTestsForReleasePerform</releaseProfiles>
            </configuration>
        </plugin>
    </plugins>
</build>
(...)
<profiles>
    <profile>
        <id>skipTestsForReleasePerform-tests</id>
        <properties>
            <maven.test.skip>true</maven.test.skip>
        </properties>
    </profile>
</profiles>
+1

Source: https://habr.com/ru/post/1531653/


All Articles