Did you try using profile to do that? I guess it's quite the use-case...
See
http://maven.apache.org/guides/introduction/introduction-to-profiles.html

Activable via mvn -PprofileName yourGoal.

Cheers.

2008/12/22 Chris Berry <[email protected]>

> Greetings,
> I need to configure a few JUnits to *not*  run when in I'm running offline
> (i.e mvn -o)
> I tried many incarnations and nothing seems to work.
> It seems that ${settings.offline} should work (according to a few posts
> here and there), but it does not...
>
> Here's what I'm trying in my POM:
>
> <project>
> .....
>     <properties>
>            <isOffline>${settings.offline}</isOffline>
>    </properties>
> .....
>    <plugins>
>            <plugin>
>                <groupId>org.apache.maven.plugins</groupId>
>                <artifactId>maven-surefire-plugin</artifactId>
>                .....
>                <configuration>
>                    <systemProperties>
>                         ........
>                        <property>
>                            <name>is.offline</name>
>                            <value>${isOffline}</value>
>                        </property>
>
> And then in my JUnit, I check against the system property; "is.offline"
> And it is always just the literal; "${settings.offline}"  (or whatever else
> I've tried)
>
> What is the maven variable that corresponds to the "-o" switch??
> Thanks,
> -- Chris
>
> PS; I have put <offline/> in my settings.xml (or alternately,
> <offline>true</offline>)
>
>
> S'all good  ---   chriswberry at gmail dot com
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>


-- 
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !

Reply via email to