You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Matt Raible <mr...@gmail.com> on 2006/08/18 17:18:27 UTC

[m2] maven.test.skip=true on by default?

In Maven 1, it was possible to turn off tests by creating a
build.properties and adding maven.test.skip=true.  I want to do
something similar (don't worry, only temporarily) for Maven 2.  I
tried creating a ~/.m2/settings.xml with the following, but it doesn't
seem to work.

<settings>
  <profiles>
    <profile>
      <id>skip.tests</id>
      <properties>
        <name>maven.test.skip</name>
        <value>true</value>
      </properties>
    </profile>
  </profiles>

  <activeProfiles>
    <activeProfile>skip.tests</activeProfile>
  </activeProfiles>
</settings>

On a related note, is it possible to create a setting that sets up
"offline mode" permanently w/o typing -o?

Thanks,

Matt

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


Re: [m2] maven.test.skip=true on by default?

Posted by Doug Douglass <do...@gmail.com>.
Nice work Jon, maybe add control of this behavior as an attribute to the
maven2 element and submit it as a patch to the CC folks? I could see it
coming in handy for others.

Cheers.

On 8/22/06, Jon SlinnHawkins <j....@elsevier.com> wrote:
>
> Hi Doug,
>
> I have achieved what i wanted.
>
> I had to modify the CC source, but it was a very minor change.
>
> I have modified the Maven2Builder class to run all the goals in the goal
> set
> before failing the build.
>
> So i now have
>
> <schedule interval="600">
> <maven2 mvnscript="&mavenExec;"
> pomfile="&cruiseProjects;\Phoenix-Parent\pom.xml"
> goal="-Pbuild,tomcat55,jdk15,scm clean|-Pbuild,tomcat55,jdk15
> install|-Pbuild,tomcat55,jdk15,site-generation site:site site:deploy" />
> <pause starttime="2200" endtime="0600" />
> </schedule>
>
> This means that all 3 of the maven "runs" will be executed before CC fails
> the build.
>
> If you are intested the modification required is just to comment out a few
> lines.
>
> 182-184 Maven2Builder.java
>             if (buildLogElement.getAttribute("error") != null) {
>                 break;
>             }
>
> This just means that we don't brealk out of the goalSet loop until all
> goals
> have been executed.
>
> Hope this is of some use.
>
> Cheers
>
> Jon
>
>
> "Doug Douglass" <do...@gmail.com> wrote in message
> news:3a9670a0608211435t1624cb74r6b85405d0fd853e5@mail.gmail.com...
> > Hey Jon,
> >
> > Yes, we have a separate (Cruisecontrol) build to generate the maven site
> > docs. It runs on a fixed schedule instead of being triggered by scm
> > commits.
> > For the site build, as you've seen, we do not fail the build if tests
> > fail,
> > we have separate builds for that.
> >
> > I do not know of a way to allow a build with failling tests to continue
> > with
> > site generation _and_ produce a build failure. That's why we have two
> > separate builds, that and we don't need the site docs updated all the
> > time.
> > Note that we use Trac and it's Cruisecontrol plugin to report build
> status
> > and present the build logs (very nice IMHO) so little/no need to go to
> the
> > surefire logs on the CI server to diagnose failures.
> >
> > Just thinking out loud now...if you're using Cruisecontrol, you could
> try
> > running your site:site goal in a separate maven after your tests during
> > the
> > same build (i.e., something like "clean scm:update|test| -
> > Dmaven.test.failure.ignore=true site:site" as the goal attribute value
> in
> > your CC project config)...oooppps, but that won't fail your build since
> > the
> > site:site will return success...DOH
> >
> > Maybe file a JIRA for the surefire plugin to add a param to continue on
> > test
> > failure but ultimately fail the build? Or maybe write a little plugin
> > linked
> > to the verify phase that inspects the surefire reports for any failures
> > and
> > fails the build?
> >
> > HTH,
> > Doug
> >
> > On 8/21/06, Jon SlinnHawkins <j....@elsevier.com> wrote:
> >>
> >> Hi Doug,
> >>
> >> I have an issue with Site generation and failing builds.
> >> See my post earlier today [Using site:site to create reports on a
> failed
> >> build]
> >>
> >> If you are using this profile when building sites, does that infer that
> >> you
> >> are using a separate mvn build to produce the site ?
> >>
> >> I want to be able to fail a build, but still continue to generate the
> >> site
> >> reports.
> >>
> >> Any help you can offer would be great.
> >>
> >> Thanks
> >>
> >> Jon
> >>
> >>
> >> "Doug Douglass" <do...@gmail.com> wrote in message
> >> news:3a9670a0608190757r2f048981vafaad4eaee1a655c@mail.gmail.com...
> >> > FYI,
> >> >
> >> > As another option, we've got this profile in our CI servers
> >> > settings.xml
> >> > for
> >> > use during site generating builds:
> >> >
> >> > <profiles>
> >> >    <profile>
> >> >      <id>site-generation</id>
> >> >      <properties>
> >> >        <maven.test.failure.ignore>true</maven.test.failure.ignore>
> >> >      </properties>
> >> >    </profile>
> >> >  </profiles>
> >> >
> >> >
> >> > On 8/18/06, Wendy Smoak <ws...@gmail.com> wrote:
> >> >>
> >> >> On 8/18/06, Max Cooper <ma...@maxcooper.com> wrote:
> >> >>
> >> >> > This will set maven.test.skip to true, as long as you don't set it
> >> >> > on
> >> >> > the command line. The nice part about this technique is that it
> DOES
> >> >> > allow you to override it on the command line if you want to.
> >> >>
> >> >> Thanks, Max. I added your tip to the wiki with a link to this
> thread.
> >> >> Feel free to edit the page-- ask for access on the dev list if you
> >> >> need it.
> >> >>
> >> >>     http://docs.codehaus.org/display/MAVENUSER/Surefire+Plugin
> >> >>
> >> >> --
> >> >> Wendy
> >> >>
> >> >>
> ---------------------------------------------------------------------
> >> >> 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: [m2] maven.test.skip=true on by default?

Posted by Jon SlinnHawkins <j....@elsevier.com>.
Hi Doug,

I have achieved what i wanted.

I had to modify the CC source, but it was a very minor change.

I have modified the Maven2Builder class to run all the goals in the goal set 
before failing the build.

So i now have

<schedule interval="600">
<maven2 mvnscript="&mavenExec;" 
pomfile="&cruiseProjects;\Phoenix-Parent\pom.xml"
goal="-Pbuild,tomcat55,jdk15,scm clean|-Pbuild,tomcat55,jdk15 
install|-Pbuild,tomcat55,jdk15,site-generation site:site site:deploy" />
<pause starttime="2200" endtime="0600" />
</schedule>

This means that all 3 of the maven "runs" will be executed before CC fails 
the build.

If you are intested the modification required is just to comment out a few 
lines.

182-184 Maven2Builder.java
            if (buildLogElement.getAttribute("error") != null) {
                break;
            }

This just means that we don't brealk out of the goalSet loop until all goals 
have been executed.

Hope this is of some use.

Cheers

Jon


"Doug Douglass" <do...@gmail.com> wrote in message 
news:3a9670a0608211435t1624cb74r6b85405d0fd853e5@mail.gmail.com...
> Hey Jon,
>
> Yes, we have a separate (Cruisecontrol) build to generate the maven site
> docs. It runs on a fixed schedule instead of being triggered by scm 
> commits.
> For the site build, as you've seen, we do not fail the build if tests 
> fail,
> we have separate builds for that.
>
> I do not know of a way to allow a build with failling tests to continue 
> with
> site generation _and_ produce a build failure. That's why we have two
> separate builds, that and we don't need the site docs updated all the 
> time.
> Note that we use Trac and it's Cruisecontrol plugin to report build status
> and present the build logs (very nice IMHO) so little/no need to go to the
> surefire logs on the CI server to diagnose failures.
>
> Just thinking out loud now...if you're using Cruisecontrol, you could try
> running your site:site goal in a separate maven after your tests during 
> the
> same build (i.e., something like "clean scm:update|test| -
> Dmaven.test.failure.ignore=true site:site" as the goal attribute value in
> your CC project config)...oooppps, but that won't fail your build since 
> the
> site:site will return success...DOH
>
> Maybe file a JIRA for the surefire plugin to add a param to continue on 
> test
> failure but ultimately fail the build? Or maybe write a little plugin 
> linked
> to the verify phase that inspects the surefire reports for any failures 
> and
> fails the build?
>
> HTH,
> Doug
>
> On 8/21/06, Jon SlinnHawkins <j....@elsevier.com> wrote:
>>
>> Hi Doug,
>>
>> I have an issue with Site generation and failing builds.
>> See my post earlier today [Using site:site to create reports on a failed
>> build]
>>
>> If you are using this profile when building sites, does that infer that
>> you
>> are using a separate mvn build to produce the site ?
>>
>> I want to be able to fail a build, but still continue to generate the 
>> site
>> reports.
>>
>> Any help you can offer would be great.
>>
>> Thanks
>>
>> Jon
>>
>>
>> "Doug Douglass" <do...@gmail.com> wrote in message
>> news:3a9670a0608190757r2f048981vafaad4eaee1a655c@mail.gmail.com...
>> > FYI,
>> >
>> > As another option, we've got this profile in our CI servers 
>> > settings.xml
>> > for
>> > use during site generating builds:
>> >
>> > <profiles>
>> >    <profile>
>> >      <id>site-generation</id>
>> >      <properties>
>> >        <maven.test.failure.ignore>true</maven.test.failure.ignore>
>> >      </properties>
>> >    </profile>
>> >  </profiles>
>> >
>> >
>> > On 8/18/06, Wendy Smoak <ws...@gmail.com> wrote:
>> >>
>> >> On 8/18/06, Max Cooper <ma...@maxcooper.com> wrote:
>> >>
>> >> > This will set maven.test.skip to true, as long as you don't set it 
>> >> > on
>> >> > the command line. The nice part about this technique is that it DOES
>> >> > allow you to override it on the command line if you want to.
>> >>
>> >> Thanks, Max. I added your tip to the wiki with a link to this thread.
>> >> Feel free to edit the page-- ask for access on the dev list if you
>> >> need it.
>> >>
>> >>     http://docs.codehaus.org/display/MAVENUSER/Surefire+Plugin
>> >>
>> >> --
>> >> Wendy
>> >>
>> >> ---------------------------------------------------------------------
>> >> 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: [m2] maven.test.skip=true on by default?

Posted by Doug Douglass <do...@gmail.com>.
Hey Jon,

Yes, we have a separate (Cruisecontrol) build to generate the maven site
docs. It runs on a fixed schedule instead of being triggered by scm commits.
For the site build, as you've seen, we do not fail the build if tests fail,
we have separate builds for that.

I do not know of a way to allow a build with failling tests to continue with
site generation _and_ produce a build failure. That's why we have two
separate builds, that and we don't need the site docs updated all the time.
Note that we use Trac and it's Cruisecontrol plugin to report build status
and present the build logs (very nice IMHO) so little/no need to go to the
surefire logs on the CI server to diagnose failures.

Just thinking out loud now...if you're using Cruisecontrol, you could try
running your site:site goal in a separate maven after your tests during the
same build (i.e., something like "clean scm:update|test| -
Dmaven.test.failure.ignore=true site:site" as the goal attribute value in
your CC project config)...oooppps, but that won't fail your build since the
site:site will return success...DOH

Maybe file a JIRA for the surefire plugin to add a param to continue on test
failure but ultimately fail the build? Or maybe write a little plugin linked
to the verify phase that inspects the surefire reports for any failures and
fails the build?

HTH,
Doug

On 8/21/06, Jon SlinnHawkins <j....@elsevier.com> wrote:
>
> Hi Doug,
>
> I have an issue with Site generation and failing builds.
> See my post earlier today [Using site:site to create reports on a failed
> build]
>
> If you are using this profile when building sites, does that infer that
> you
> are using a separate mvn build to produce the site ?
>
> I want to be able to fail a build, but still continue to generate the site
> reports.
>
> Any help you can offer would be great.
>
> Thanks
>
> Jon
>
>
> "Doug Douglass" <do...@gmail.com> wrote in message
> news:3a9670a0608190757r2f048981vafaad4eaee1a655c@mail.gmail.com...
> > FYI,
> >
> > As another option, we've got this profile in our CI servers settings.xml
> > for
> > use during site generating builds:
> >
> > <profiles>
> >    <profile>
> >      <id>site-generation</id>
> >      <properties>
> >        <maven.test.failure.ignore>true</maven.test.failure.ignore>
> >      </properties>
> >    </profile>
> >  </profiles>
> >
> >
> > On 8/18/06, Wendy Smoak <ws...@gmail.com> wrote:
> >>
> >> On 8/18/06, Max Cooper <ma...@maxcooper.com> wrote:
> >>
> >> > This will set maven.test.skip to true, as long as you don't set it on
> >> > the command line. The nice part about this technique is that it DOES
> >> > allow you to override it on the command line if you want to.
> >>
> >> Thanks, Max. I added your tip to the wiki with a link to this thread.
> >> Feel free to edit the page-- ask for access on the dev list if you
> >> need it.
> >>
> >>     http://docs.codehaus.org/display/MAVENUSER/Surefire+Plugin
> >>
> >> --
> >> Wendy
> >>
> >> ---------------------------------------------------------------------
> >> 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: [m2] maven.test.skip=true on by default?

Posted by Jon SlinnHawkins <j....@elsevier.com>.
Hi Doug,

I have an issue with Site generation and failing builds.
See my post earlier today [Using site:site to create reports on a failed 
build]

If you are using this profile when building sites, does that infer that you 
are using a separate mvn build to produce the site ?

I want to be able to fail a build, but still continue to generate the site 
reports.

Any help you can offer would be great.

Thanks

Jon


"Doug Douglass" <do...@gmail.com> wrote in message 
news:3a9670a0608190757r2f048981vafaad4eaee1a655c@mail.gmail.com...
> FYI,
>
> As another option, we've got this profile in our CI servers settings.xml 
> for
> use during site generating builds:
>
> <profiles>
>    <profile>
>      <id>site-generation</id>
>      <properties>
>        <maven.test.failure.ignore>true</maven.test.failure.ignore>
>      </properties>
>    </profile>
>  </profiles>
>
>
> On 8/18/06, Wendy Smoak <ws...@gmail.com> wrote:
>>
>> On 8/18/06, Max Cooper <ma...@maxcooper.com> wrote:
>>
>> > This will set maven.test.skip to true, as long as you don't set it on
>> > the command line. The nice part about this technique is that it DOES
>> > allow you to override it on the command line if you want to.
>>
>> Thanks, Max. I added your tip to the wiki with a link to this thread.
>> Feel free to edit the page-- ask for access on the dev list if you
>> need it.
>>
>>    http://docs.codehaus.org/display/MAVENUSER/Surefire+Plugin
>>
>> --
>> Wendy
>>
>> ---------------------------------------------------------------------
>> 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: [m2] maven.test.skip=true on by default?

Posted by Doug Douglass <do...@gmail.com>.
FYI,

As another option, we've got this profile in our CI servers settings.xml for
use during site generating builds:

<profiles>
    <profile>
      <id>site-generation</id>
      <properties>
        <maven.test.failure.ignore>true</maven.test.failure.ignore>
      </properties>
    </profile>
  </profiles>


On 8/18/06, Wendy Smoak <ws...@gmail.com> wrote:
>
> On 8/18/06, Max Cooper <ma...@maxcooper.com> wrote:
>
> > This will set maven.test.skip to true, as long as you don't set it on
> > the command line. The nice part about this technique is that it DOES
> > allow you to override it on the command line if you want to.
>
> Thanks, Max. I added your tip to the wiki with a link to this thread.
> Feel free to edit the page-- ask for access on the dev list if you
> need it.
>
>    http://docs.codehaus.org/display/MAVENUSER/Surefire+Plugin
>
> --
> Wendy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: [m2] maven.test.skip=true on by default?

Posted by Wendy Smoak <ws...@gmail.com>.
On 8/18/06, Max Cooper <ma...@maxcooper.com> wrote:

> This will set maven.test.skip to true, as long as you don't set it on
> the command line. The nice part about this technique is that it DOES
> allow you to override it on the command line if you want to.

Thanks, Max. I added your tip to the wiki with a link to this thread.
Feel free to edit the page-- ask for access on the dev list if you
need it.

   http://docs.codehaus.org/display/MAVENUSER/Surefire+Plugin

-- 
Wendy

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


Re: [m2] maven.test.skip=true on by default?

Posted by Max Cooper <ma...@maxcooper.com>.
Put this in your settings.xml:

     <!-- skip tests by default, but allow override on command line -->
     <profile>
       <id>skiptests</id>
       <activation>
         <property>
           <name>!maven.test.skip</name>
         </property>
       </activation>
       <properties>
         <maven.test.skip>true</maven.test.skip>
       </properties>
     </profile>

This will set maven.test.skip to true, as long as you don't set it on 
the command line. The nice part about this technique is that it DOES 
allow you to override it on the command line if you want to.

-Max


Matt Raible wrote:
> In Maven 1, it was possible to turn off tests by creating a
> build.properties and adding maven.test.skip=true.  I want to do
> something similar (don't worry, only temporarily) for Maven 2.  I
> tried creating a ~/.m2/settings.xml with the following, but it doesn't
> seem to work.
> 
> <settings>
>  <profiles>
>    <profile>
>      <id>skip.tests</id>
>      <properties>
>        <name>maven.test.skip</name>
>        <value>true</value>
>      </properties>
>    </profile>
>  </profiles>
> 
>  <activeProfiles>
>    <activeProfile>skip.tests</activeProfile>
>  </activeProfiles>
> </settings>
> 
> On a related note, is it possible to create a setting that sets up
> "offline mode" permanently w/o typing -o?
> 
> Thanks,
> 
> Matt
> 
> ---------------------------------------------------------------------
> 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