I have tried to get this working, but it does not seem to work. When I do
mvn release:prepare
I get
[INFO] Executing: cmd.exe /X /C
"D:\bin\Apache\apache-maven-3.1.1\bin\mvn -s
C:\Users\Eric\AppData\Local\Temp\release-settings2652114304406041143.xml
clean verify site --no-plugin-updates -Psonatype-oss-release -P
user,local-repository"
In the output I can see the 'clean' and the 'site' happen, but the
failsafe integration tests do not run. If I do
mvn verify -P run-it
then the integration tests run as normal.
Cheers, Eric
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.17</version>
<executions>
<execution>
<id>default-integration-test</id>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
<execution>
<id>default-verify</id>
<goals>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.5</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<configuration>
<preparationGoals>clean verify site</preparationGoals>
</configuration>
</plugin>
. . .
<profiles>
<profile>
<id>run-it</id>
<activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
On 3/21/2014 1:10 PM, Eric Kolotyluk wrote:
Cool, that is what I am looking for. Thanks so much.
Cheers, Eric
On 2014-03-20, 1:50 PM, Mirko Friedenhagen wrote:
Eric,
when you use the maven-release-plugin a property performRelease is set
during release:perform.
So define in the pluginManagement section a definition for the
maven-failsafe-plugin in your build section:
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.17</version>
<executions>
<execution>
<id>default-integration-test</id>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
<execution>
<id>default-verify</id>
<goals>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
and later on in your pom
<profile>
<id>release-run-failsafe</id>
<activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>
</plugins>
</build>
<profile>
So only during release:perform your integration tests will be executed
and success is verified.
Regards Mirko
--
http://illegalstateexception.blogspot.com/
https://github.com/mfriedenhagen/ (http://osrc.dfm.io/mfriedenhagen)
https://bitbucket.org/mfriedenhagen/
On Thu, Mar 20, 2014 at 8:32 PM, Eric Kolotyluk
<[email protected]> wrote:
I am looking for some way to force my integration tests before a
release,
without explicitly using a profile.
For example,
<plugin>
<artifactId>maven-release-plugin</artifactId>
<configuration>
<preparationGoals>clean verify site</preparationGoals>
</configuration>
</plugin>
But that doesn't work because unless the failsafe plugin is defined, it
won't run the tests.
I thought of doing something like
<profiles>
<profile>
<id>run-it</id>
<activation>
<file>
<missing>target/failsafe-reports</missing>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.17</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
But that will cause the integration tests to be run after every clean.
Is there some way I can trigger the integration tests when doing a
release
mvn release:prepare
without having to do
mvn release:prepare -P run-it
Cheers, Eric
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]