You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Reto Bachmann-Gmür <re...@gmuer.ch> on 2008/10/06 22:07:30 UTC

automatically go offline

I would like to automatically switch betwenn online and offline mode
depending on the network interface that i have activated. I've
configured NetworkManager to create a file (/tmp/fast-network-up)
whenever a fast network interface is up, I would like to configure maven
to switch to offline mode when this file is missing.

I've tried using profiles in settings.xml, as in
<profiles>
		<profile>
			<id>offline</id>
			<activation>
				<file>
				<missing>/tmp/fast-network-upg</missing>
				</file>
			</activation>
			<properties>
				<offline.value>true</offline.value>
			</properties>
		</profile>
</profiles>
<offline>${offline.value}</offline>

but had no success. any idea?

Cheers,
reto


Re: automatically go offline

Posted by Reto Bachmann-Gmür <re...@gmuer.ch>.
Wayne Fay wrote:
> On Mon, Oct 6, 2008 at 1:07 PM, Reto Bachmann-Gmür <re...@gmuer.ch> wrote:
>> I would like to automatically switch betwenn online and offline mode
>> depending on the network interface that i have activated. I've
>> configured NetworkManager to create a file (/tmp/fast-network-up)
>> whenever a fast network interface is up, I would like to configure maven
>> to switch to offline mode when this file is missing.
> 
> You could adjust the "mvn" shell script to look for that file and pass
> in -o (or not) rather than depending on what seem to be bugs in the
> profile handling, at least as a short-term fix.


This works, thanks! had to configure netbeans not to use the buil-in maven.

reto


Re: automatically go offline

Posted by Wayne Fay <wa...@gmail.com>.
On Mon, Oct 6, 2008 at 1:07 PM, Reto Bachmann-Gmür <re...@gmuer.ch> wrote:
> I would like to automatically switch betwenn online and offline mode
> depending on the network interface that i have activated. I've
> configured NetworkManager to create a file (/tmp/fast-network-up)
> whenever a fast network interface is up, I would like to configure maven
> to switch to offline mode when this file is missing.

You could adjust the "mvn" shell script to look for that file and pass
in -o (or not) rather than depending on what seem to be bugs in the
profile handling, at least as a short-term fix.

Wayne

Re: automatically go offline

Posted by Reto Bachmann-Gmür <re...@gmuer.ch>.
Wendy Smoak wrote:
> On Mon, Oct 6, 2008 at 1:07 PM, Reto Bachmann-Gmür <re...@gmuer.ch> wrote:
>> I would like to automatically switch betwenn online and offline mode
>> depending on the network interface that i have activated. I've
>> configured NetworkManager to create a file (/tmp/fast-network-up)
>> whenever a fast network interface is up, I would like to configure maven
>> to switch to offline mode when this file is missing.
>>
>> I've tried using profiles in settings.xml, as in
> ...
>> but had no success. any idea?
> 
> What happened?
nothing, it still made network connections, I was thinking that I might
not use the property in the same file as its defined...

cheers,
reto


Re: automatically go offline

Posted by Wendy Smoak <ws...@gmail.com>.
On Mon, Oct 6, 2008 at 1:07 PM, Reto Bachmann-Gmür <re...@gmuer.ch> wrote:
> I would like to automatically switch betwenn online and offline mode
> depending on the network interface that i have activated. I've
> configured NetworkManager to create a file (/tmp/fast-network-up)
> whenever a fast network interface is up, I would like to configure maven
> to switch to offline mode when this file is missing.
>
> I've tried using profiles in settings.xml, as in
...
> but had no success. any idea?

What happened?

There's an issue [1] complaining that a profile intended to be
activated when a file is missing is *always* active.  You might want
to comment on/vote for it if you're having the same problem.

[1] http://jira.codehaus.org/browse/MNG-3524

-- 
Wendy

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