You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Eric Kolotyluk <er...@gmail.com> on 2014/03/20 20:32:22 UTC

Forcing Integration Tests Before a Release

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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Forcing Integration Tests Before a Release

Posted by Barrie Treloar <ba...@gmail.com>.
On 21 March 2014 06:02, Eric Kolotyluk <er...@gmail.com> wrote:

> I am looking for some way to force my integration tests before a release,
> without explicitly using a profile.
>
> [del]
>


> 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
>

Have a look at the apache parent pom chain.

There is some activation stuff in there that gets run when you do a release
- I can't recall how it does it.
e.g. always generating source jars

Re: Forcing Integration Tests Before a Release

Posted by Barrie Treloar <ba...@gmail.com>.
On 26 March 2014 07:34, Eric Kolotyluk <er...@gmail.com> wrote:

> 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.
>

What is -X telling you?
Is the variable performRelease actually set?

Looking at org.apache:apache:10 the release-plugin is configured different
to the docs.
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>2.1</version>
          <configuration>
            <useReleaseProfile>false</useReleaseProfile>
            <goals>deploy</goals>
            <arguments>-Papache-release</arguments>
          </configuration>
        </plugin>

i.e. it disables useReleaseProfile and forces the apache-release profile to
be used.

I've had a quick look at the code, and I dont think this variable will be
set on prepare.
The performRelease variable looks like it is only set on "perform" not
"prepare".
http://maven.apache.org/maven-release/maven-release-plugin/perform-mojo.html#useReleaseProfile

You can use
http://maven.apache.org/maven-release/maven-release-plugin/prepare-mojo.html#argumentsto
provide additional arguments to the release plugin.
The code in AbstractReleaseMojo.createReleaseDescriptor() builds a list of
active profiles and so you can just configure the release plugin to include
"-P run-its" (which is the profile name used in
org.apache.maven.plugins:maven-plugins:22 so I assume its the preferred
name)

Since it is the same plugin, I dont think you are going to be able to
separate out running the integration tests only in prepare.
They are going to be run again in perform.
This is probably not a bad thing.

Re: Forcing Integration Tests Before a Release

Posted by Mirko Friedenhagen <mf...@gmail.com>.
performRelease is only set during release:perform :-)

Regards
Mirko
-- 
Sent from my mobile
On Mar 25, 2014 10:05 PM, "Eric Kolotyluk" <er...@gmail.com> wrote:

> 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
>>> <er...@gmail.com> 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: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>
>>>>  ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Forcing Integration Tests Before a Release

Posted by Eric Kolotyluk <er...@gmail.com>.
Ahhh, actually adding "-P run-it" to the preparationGoals parameter does 
exactly what I want, and I can dispense with all the other complexities.

I did not realize I could add other arguments to the preparationGoals 
parameter.

Sometimes getting what you want from Maven is not obvious, until you get 
it working :-)

Thanks so much for the key Mirko

Cheers, Eric


On 3/25/2014 3:26 PM, Mirko Friedenhagen wrote:
> Eric,
>
> you might modify the preparationGoals parameter to include
> -DperformRelease=true.
>
> Regards
> Mirko


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Forcing Integration Tests Before a Release

Posted by Mirko Friedenhagen <mf...@gmail.com>.
Eric,

you might modify the preparationGoals parameter to include
-DperformRelease=true.

Regards
Mirko
-- 
Sent from my mobile
On Mar 25, 2014 10:05 PM, "Eric Kolotyluk" <er...@gmail.com> wrote:

> 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
>>> <er...@gmail.com> 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: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>
>>>>  ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Forcing Integration Tests Before a Release

Posted by Mirko Friedenhagen <mf...@gmail.com>.
Eric,

I do only use release:prepare, see
https://github.com/1and1/foss-parent/blob/master/release line 47ff.

Regards
Mirko
-- 
Sent from my mobile
On Mar 25, 2014 10:05 PM, "Eric Kolotyluk" <er...@gmail.com> wrote:

> 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
>>> <er...@gmail.com> 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: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>
>>>>  ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Forcing Integration Tests Before a Release

Posted by Eric Kolotyluk <er...@gmail.com>.
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
>> <er...@gmail.com> 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: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Forcing Integration Tests Before a Release

Posted by Eric Kolotyluk <er...@gmail.com>.
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
> <er...@gmail.com> 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: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Forcing Integration Tests Before a Release

Posted by Mirko Friedenhagen <mf...@gmail.com>.
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
<er...@gmail.com> 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: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org