You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Marc Schneider <ma...@gmail.com> on 2008/09/17 17:24:59 UTC

Confused with activeProfile

Hello,

I have this default profile in my pom.xml

<profile>
	<id>testLocal</id>
	<activation>
		<activeByDefault>true</activeByDefault>
	</activation>
</profile>

This pom has a parent where most of the parameters of this profile are
defined.

So running :
mvn -P testLocal clean tomcat:deploy

should be equivalent to :

mvn clean tomcat:deploy ?

But if I don't put -P testLocal I get an error message as if some
parameters are missing.

Running just after this :

mvn help:active-profiles

The following profiles are active:
 - testLocal (source: pom)

So I don't understand why it doesn't work.
Any idea ?

Thanks,
Marc.


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


Re: Confused with activeProfile

Posted by Marc Schneider <ma...@gmail.com>.
Hi Jörg,

Thanks for your answer, I understand what you mean.
So I tried to add to the *parent's pom* this :

<activation>
	<activeByDefault>true</activeByDefault>
</activation>

after mvn clean install I get this strange error :

[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
[INFO] The -uriroot option must specify a pre-existing directory

I get the same if I put it in my settings.xml

I'm using : apache-maven-2.1.0-M1

Marc.

Jörg Schaible a écrit :
> Hi Marc,
> 
> Marc Schneider wrote:
>> Hello Brett,
>>
>> The error I have is :
>>
>> [INFO] Trace
>> org.apache.maven.lifecycle.LifecycleExecutionException: Cannot invoke
>> Tomcat manager 
>>
>> And then
>> java.io.IOException: Server returned HTTP response code: 401
>>
>> which means "unauthorized".
>>
>> In fact this clearly shows that some parameters are missing.
>>
>> So to remember, in my pom.xml I have :
>>
>> <profile>
>> 	<id>testLocal</id>
>> 	<activation>
>> 		<activeByDefault>true</activeByDefault>
>> 	</activation>
>> 	<properties>
>> 		...
>> 	</properties>
>> </profile>
>>
>> Running : mvn -P testLocal clean tomcat:deploy is OK
>> Running : mvn clean tomcat:deploy fails with error above
>>
>> So I don't understand why the 2nd option fails as testLocal profile
>> should be taken by default, AFAIK.
> 
> So, if I understand you right, you do not activate the profile by default in the parent (where all the interesting elements are set) and in the local POM you simply try to activate it?
> 
> This won't work. Profiles are handled on POM level, i.e. when you local POM is processed the profiles of the parent have been "resolved" already.
> 
> - Jörg
> 
> ---------------------------------------------------------------------
> 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: Confused with activeProfile

Posted by Jörg Schaible <Jo...@scalaris.com>.
Hi Marc,

Marc Schneider wrote:
> Hello Brett,
> 
> The error I have is :
> 
> [INFO] Trace
> org.apache.maven.lifecycle.LifecycleExecutionException: Cannot invoke
> Tomcat manager 
> 
> And then
> java.io.IOException: Server returned HTTP response code: 401
> 
> which means "unauthorized".
> 
> In fact this clearly shows that some parameters are missing.
> 
> So to remember, in my pom.xml I have :
> 
> <profile>
> 	<id>testLocal</id>
> 	<activation>
> 		<activeByDefault>true</activeByDefault>
> 	</activation>
> 	<properties>
> 		...
> 	</properties>
> </profile>
> 
> Running : mvn -P testLocal clean tomcat:deploy is OK
> Running : mvn clean tomcat:deploy fails with error above
> 
> So I don't understand why the 2nd option fails as testLocal profile
> should be taken by default, AFAIK.

So, if I understand you right, you do not activate the profile by default in the parent (where all the interesting elements are set) and in the local POM you simply try to activate it?

This won't work. Profiles are handled on POM level, i.e. when you local POM is processed the profiles of the parent have been "resolved" already.

- Jörg

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


Re: Confused with activeProfile

Posted by Marc Schneider <ma...@gmail.com>.
Hello Brett,

The error I have is :

[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Cannot invoke
Tomcat manager

And then
java.io.IOException: Server returned HTTP response code: 401

which means "unauthorized".

In fact this clearly shows that some parameters are missing.

So to remember, in my pom.xml I have :

<profile>
	<id>testLocal</id>
	<activation>
		<activeByDefault>true</activeByDefault>
	</activation>
	<properties>
		...
	</properties>
</profile>

Running : mvn -P testLocal clean tomcat:deploy is OK
Running : mvn clean tomcat:deploy fails with error above

So I don't understand why the 2nd option fails as testLocal profile
should be taken by default, AFAIK.

Thanks for your help,
Marc.

Brett Porter a écrit :
> 2008/9/18 Marc Schneider <ma...@gmail.com>:
>> So running :
>> mvn -P testLocal clean tomcat:deploy
>>
>> should be equivalent to :
>>
>> mvn clean tomcat:deploy ?
>>
>> But if I don't put -P testLocal I get an error message as if some
>> parameters are missing.
> 
> What is the error message?
> 
> - Brett
> 


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


Re: Confused with activeProfile

Posted by Brett Porter <br...@gmail.com>.
2008/9/18 Marc Schneider <ma...@gmail.com>:
> So running :
> mvn -P testLocal clean tomcat:deploy
>
> should be equivalent to :
>
> mvn clean tomcat:deploy ?
>
> But if I don't put -P testLocal I get an error message as if some
> parameters are missing.

What is the error message?

- Brett

-- 
Brett Porter
Blog: http://blogs.exist.com/bporter/

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