You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by aymen83 <ay...@yahoo.fr> on 2008/12/19 10:43:57 UTC

questions about profiles?

hi

i've been searching for a way to override the version of an Artifact using
profiles, is that possible?
the idea is to change the version of framework when compiling a project, for
instance, the project is compiled using spring 2.5 and i want to write a
profile to compile it with the version 2.0

-- 
View this message in context: http://www.nabble.com/questions-about-profiles--tp21088457p21088457.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: questions about profiles?

Posted by aymen83 <ay...@yahoo.fr>.
i have changed my pom. the compilation is successful but i want to confirm
that the project was compiled 
with spring 2.0.8 is there any way to know?
thanks for help

aymen83 wrote:
> 
> i know that. I've done that way before but i was confused because it seem
> to me not working thus instead of writing all dependencies i've chosen the
> one that interests me   
> 
> Stephen Connolly-2 wrote:
>> 
>> Why even bother doing it that way.... you do know you can have
>> dependencies
>> in profiles!!!
>> 
>> <profile>
>>   <id>legacy</id>
>>   <!--  have this one inactive -->
>>   <dependencies>
>>      <!-- Spring 2.0.8 stuff -->
>>   </dependencies>
>> </profile>
>> <profile>
>>   <id>new</id>
>>   <!-- have this one active by default -->
>>   <dependencies>
>>     <!-- Spring 2.5.6 stuff -->
>>   </dependencies>
>> </profile>
>> 
>> if you don't specify the profile on the command line, it will use 2.5.6,
>> if
>> you specify -Plegacy that will deactivate all other profiles, as
>> specifying
>> a profile on the command line deactivates any profiles that are active by
>> default
>> 
>> -Stephen
>> 
>> 2008/12/22 aymen83 <ay...@yahoo.fr>
>> 
>>>
>>> the property is used in another pom
>>> <properties>
>>>        <Spring.version>2.5.6</Spring.version>
>>>        <Spring-WS.version>1.5.0</Spring-WS.version>
>>>        <Aspectj.version>1.5.4</Aspectj.version>
>>>        <Log4j.version>1.2.15</Log4j.version>
>>>        <spring-batch.version>1.1.1.RELEASE</spring-batch.version>
>>>     </properties>
>>> what i want to do is to override the Spring.Verison properties using my
>>> new
>>> profile. Something like
>>> --mvn clean install -Plegacy
>>> and it's supposed to change the version of spring from 2.5.6 to 2.0.8
>>> thanks for suggestions
>>>
>>>
>>> Baptiste MATHUS-4 wrote:
>>> >
>>> > I might have missed something, but where did you use this property
>>> > somewhere
>>> > else in your pom? And how do you run maven? What did you put after -P?
>>> >
>>> > Cheers
>>> >
>>> > 2008/12/19 aymen83 <ay...@yahoo.fr>
>>> >
>>> >>
>>> >> two profiles this is what i have done and this the profile for spring
>>> >> 2.0.8
>>> >>
>>> >> <profile>
>>> >>                        <id>legacy</id>
>>> >>                        <activation>
>>> >>                               
>>> <activeByDefault>false</activeByDefault>
>>> >>                                <jdk>1.5</jdk>
>>> >>                        </activation>
>>> >>                        <properties>
>>> >>                                <Spring.Version>2.0.8</Spring.Version>
>>> >>                        </properties>
>>> >>                        <build>
>>> >>                                <resources>
>>> >>                                        <resource>
>>> >>
>>> >>  <directory>src\main\resources\ressourcesDev</directory>
>>> >>                                        </resource>
>>> >>                                </resources>
>>> >>                                <plugins>
>>> >>                                        <plugin>
>>> >>
>>> >>  <groupId>org.apache.maven.plugins</groupId>
>>> >>
>>> >>  <artifactId>maven-war-plugin</artifactId>
>>> >>                                                <version>2.0</version>
>>> >>                                                <configuration>
>>> >>                                                        <webResources>
>>> >>
>>>  <resource>
>>> >>
>>> >>  <directory>WsService\ressources2</directory>
>>> >>
>>> >> </resource>
>>> >>                                                       
>>> </webResources>
>>> >>                                                </configuration>
>>> >>                                        </plugin>
>>> >>                                </plugins>
>>> >>                        </build>
>>> >>
>>> >>                </profile>
>>> >>
>>> >> but this seems not working since when i tape mvn dependency:resolve i
>>> >> only
>>> >> have spring2.5.6
>>> >> thanks for helping
>>> >>
>>> >>
>>> >> aymen83 wrote:
>>> >> >
>>> >> > hi
>>> >> >
>>> >> > i've been searching for a way to override the version of an
>>> Artifact
>>> >> using
>>> >> > profiles, is that possible?
>>> >> > the idea is to change the version of framework when compiling a
>>> >> project,
>>> >> > for instance, the project is compiled using spring 2.5 and i want
>>> to
>>> >> write
>>> >> > a profile to compile it with the version 2.0
>>> >> >
>>> >> >
>>> >>
>>> >> --
>>> >> View this message in context:
>>> >>
>>> http://www.nabble.com/questions-about-profiles--tp21088457p21093168.html
>>> >> Sent from the Maven - Users mailing list archive at Nabble.com.
>>> >>
>>> >>
>>> >> ---------------------------------------------------------------------
>>> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> >> For additional commands, e-mail: users-help@maven.apache.org
>>> >>
>>> >>
>>> >
>>> >
>>> > --
>>> > Baptiste <Batmat> MATHUS - http://batmat.net
>>> > Sauvez un arbre,
>>> > Mangez un castor !
>>> >
>>> >
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/questions-about-profiles--tp21088457p21123944.html
>>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/questions-about-profiles--tp21088457p21125503.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: questions about profiles?

Posted by aymen83 <ay...@yahoo.fr>.
i know that. I've done that way before but i was confused because it seem to
me not working thus instead of writing all dependencies i've chosen the one
that interests me   

Stephen Connolly-2 wrote:
> 
> Why even bother doing it that way.... you do know you can have
> dependencies
> in profiles!!!
> 
> <profile>
>   <id>legacy</id>
>   <!--  have this one inactive -->
>   <dependencies>
>      <!-- Spring 2.0.8 stuff -->
>   </dependencies>
> </profile>
> <profile>
>   <id>new</id>
>   <!-- have this one active by default -->
>   <dependencies>
>     <!-- Spring 2.5.6 stuff -->
>   </dependencies>
> </profile>
> 
> if you don't specify the profile on the command line, it will use 2.5.6,
> if
> you specify -Plegacy that will deactivate all other profiles, as
> specifying
> a profile on the command line deactivates any profiles that are active by
> default
> 
> -Stephen
> 
> 2008/12/22 aymen83 <ay...@yahoo.fr>
> 
>>
>> the property is used in another pom
>> <properties>
>>        <Spring.version>2.5.6</Spring.version>
>>        <Spring-WS.version>1.5.0</Spring-WS.version>
>>        <Aspectj.version>1.5.4</Aspectj.version>
>>        <Log4j.version>1.2.15</Log4j.version>
>>        <spring-batch.version>1.1.1.RELEASE</spring-batch.version>
>>     </properties>
>> what i want to do is to override the Spring.Verison properties using my
>> new
>> profile. Something like
>> --mvn clean install -Plegacy
>> and it's supposed to change the version of spring from 2.5.6 to 2.0.8
>> thanks for suggestions
>>
>>
>> Baptiste MATHUS-4 wrote:
>> >
>> > I might have missed something, but where did you use this property
>> > somewhere
>> > else in your pom? And how do you run maven? What did you put after -P?
>> >
>> > Cheers
>> >
>> > 2008/12/19 aymen83 <ay...@yahoo.fr>
>> >
>> >>
>> >> two profiles this is what i have done and this the profile for spring
>> >> 2.0.8
>> >>
>> >> <profile>
>> >>                        <id>legacy</id>
>> >>                        <activation>
>> >>                               
>> <activeByDefault>false</activeByDefault>
>> >>                                <jdk>1.5</jdk>
>> >>                        </activation>
>> >>                        <properties>
>> >>                                <Spring.Version>2.0.8</Spring.Version>
>> >>                        </properties>
>> >>                        <build>
>> >>                                <resources>
>> >>                                        <resource>
>> >>
>> >>  <directory>src\main\resources\ressourcesDev</directory>
>> >>                                        </resource>
>> >>                                </resources>
>> >>                                <plugins>
>> >>                                        <plugin>
>> >>
>> >>  <groupId>org.apache.maven.plugins</groupId>
>> >>
>> >>  <artifactId>maven-war-plugin</artifactId>
>> >>                                                <version>2.0</version>
>> >>                                                <configuration>
>> >>                                                        <webResources>
>> >>
>>  <resource>
>> >>
>> >>  <directory>WsService\ressources2</directory>
>> >>
>> >> </resource>
>> >>                                                        </webResources>
>> >>                                                </configuration>
>> >>                                        </plugin>
>> >>                                </plugins>
>> >>                        </build>
>> >>
>> >>                </profile>
>> >>
>> >> but this seems not working since when i tape mvn dependency:resolve i
>> >> only
>> >> have spring2.5.6
>> >> thanks for helping
>> >>
>> >>
>> >> aymen83 wrote:
>> >> >
>> >> > hi
>> >> >
>> >> > i've been searching for a way to override the version of an Artifact
>> >> using
>> >> > profiles, is that possible?
>> >> > the idea is to change the version of framework when compiling a
>> >> project,
>> >> > for instance, the project is compiled using spring 2.5 and i want to
>> >> write
>> >> > a profile to compile it with the version 2.0
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/questions-about-profiles--tp21088457p21093168.html
>> >> Sent from the Maven - Users mailing list archive at Nabble.com.
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> >> For additional commands, e-mail: users-help@maven.apache.org
>> >>
>> >>
>> >
>> >
>> > --
>> > Baptiste <Batmat> MATHUS - http://batmat.net
>> > Sauvez un arbre,
>> > Mangez un castor !
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/questions-about-profiles--tp21088457p21123944.html
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/questions-about-profiles--tp21088457p21125228.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: questions about profiles?

Posted by Stephen Connolly <st...@gmail.com>.
Why even bother doing it that way.... you do know you can have dependencies
in profiles!!!

<profile>
  <id>legacy</id>
  <!--  have this one inactive -->
  <dependencies>
     <!-- Spring 2.0.8 stuff -->
  </dependencies>
</profile>
<profile>
  <id>new</id>
  <!-- have this one active by default -->
  <dependencies>
    <!-- Spring 2.5.6 stuff -->
  </dependencies>
</profile>

if you don't specify the profile on the command line, it will use 2.5.6, if
you specify -Plegacy that will deactivate all other profiles, as specifying
a profile on the command line deactivates any profiles that are active by
default

-Stephen

2008/12/22 aymen83 <ay...@yahoo.fr>

>
> the property is used in another pom
> <properties>
>        <Spring.version>2.5.6</Spring.version>
>        <Spring-WS.version>1.5.0</Spring-WS.version>
>        <Aspectj.version>1.5.4</Aspectj.version>
>        <Log4j.version>1.2.15</Log4j.version>
>        <spring-batch.version>1.1.1.RELEASE</spring-batch.version>
>     </properties>
> what i want to do is to override the Spring.Verison properties using my new
> profile. Something like
> --mvn clean install -Plegacy
> and it's supposed to change the version of spring from 2.5.6 to 2.0.8
> thanks for suggestions
>
>
> Baptiste MATHUS-4 wrote:
> >
> > I might have missed something, but where did you use this property
> > somewhere
> > else in your pom? And how do you run maven? What did you put after -P?
> >
> > Cheers
> >
> > 2008/12/19 aymen83 <ay...@yahoo.fr>
> >
> >>
> >> two profiles this is what i have done and this the profile for spring
> >> 2.0.8
> >>
> >> <profile>
> >>                        <id>legacy</id>
> >>                        <activation>
> >>                                <activeByDefault>false</activeByDefault>
> >>                                <jdk>1.5</jdk>
> >>                        </activation>
> >>                        <properties>
> >>                                <Spring.Version>2.0.8</Spring.Version>
> >>                        </properties>
> >>                        <build>
> >>                                <resources>
> >>                                        <resource>
> >>
> >>  <directory>src\main\resources\ressourcesDev</directory>
> >>                                        </resource>
> >>                                </resources>
> >>                                <plugins>
> >>                                        <plugin>
> >>
> >>  <groupId>org.apache.maven.plugins</groupId>
> >>
> >>  <artifactId>maven-war-plugin</artifactId>
> >>                                                <version>2.0</version>
> >>                                                <configuration>
> >>                                                        <webResources>
> >>
>  <resource>
> >>
> >>  <directory>WsService\ressources2</directory>
> >>
> >> </resource>
> >>                                                        </webResources>
> >>                                                </configuration>
> >>                                        </plugin>
> >>                                </plugins>
> >>                        </build>
> >>
> >>                </profile>
> >>
> >> but this seems not working since when i tape mvn dependency:resolve i
> >> only
> >> have spring2.5.6
> >> thanks for helping
> >>
> >>
> >> aymen83 wrote:
> >> >
> >> > hi
> >> >
> >> > i've been searching for a way to override the version of an Artifact
> >> using
> >> > profiles, is that possible?
> >> > the idea is to change the version of framework when compiling a
> >> project,
> >> > for instance, the project is compiled using spring 2.5 and i want to
> >> write
> >> > a profile to compile it with the version 2.0
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/questions-about-profiles--tp21088457p21093168.html
> >> Sent from the Maven - Users mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >
> >
> > --
> > Baptiste <Batmat> MATHUS - http://batmat.net
> > Sauvez un arbre,
> > Mangez un castor !
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/questions-about-profiles--tp21088457p21123944.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: questions about profiles?

Posted by aymen83 <ay...@yahoo.fr>.
the property is used in another pom 
<properties>
        <Spring.version>2.5.6</Spring.version>
        <Spring-WS.version>1.5.0</Spring-WS.version>
        <Aspectj.version>1.5.4</Aspectj.version>
        <Log4j.version>1.2.15</Log4j.version>
        <spring-batch.version>1.1.1.RELEASE</spring-batch.version>
     </properties>
what i want to do is to override the Spring.Verison properties using my new
profile. Something like
--mvn clean install -Plegacy 
and it's supposed to change the version of spring from 2.5.6 to 2.0.8
thanks for suggestions
   

Baptiste MATHUS-4 wrote:
> 
> I might have missed something, but where did you use this property
> somewhere
> else in your pom? And how do you run maven? What did you put after -P?
> 
> Cheers
> 
> 2008/12/19 aymen83 <ay...@yahoo.fr>
> 
>>
>> two profiles this is what i have done and this the profile for spring
>> 2.0.8
>>
>> <profile>
>>                        <id>legacy</id>
>>                        <activation>
>>                                <activeByDefault>false</activeByDefault>
>>                                <jdk>1.5</jdk>
>>                        </activation>
>>                        <properties>
>>                                <Spring.Version>2.0.8</Spring.Version>
>>                        </properties>
>>                        <build>
>>                                <resources>
>>                                        <resource>
>>
>>  <directory>src\main\resources\ressourcesDev</directory>
>>                                        </resource>
>>                                </resources>
>>                                <plugins>
>>                                        <plugin>
>>
>>  <groupId>org.apache.maven.plugins</groupId>
>>
>>  <artifactId>maven-war-plugin</artifactId>
>>                                                <version>2.0</version>
>>                                                <configuration>
>>                                                        <webResources>
>>                                                                <resource>
>>
>>  <directory>WsService\ressources2</directory>
>>                                                               
>> </resource>
>>                                                        </webResources>
>>                                                </configuration>
>>                                        </plugin>
>>                                </plugins>
>>                        </build>
>>
>>                </profile>
>>
>> but this seems not working since when i tape mvn dependency:resolve i
>> only
>> have spring2.5.6
>> thanks for helping
>>
>>
>> aymen83 wrote:
>> >
>> > hi
>> >
>> > i've been searching for a way to override the version of an Artifact
>> using
>> > profiles, is that possible?
>> > the idea is to change the version of framework when compiling a
>> project,
>> > for instance, the project is compiled using spring 2.5 and i want to
>> write
>> > a profile to compile it with the version 2.0
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/questions-about-profiles--tp21088457p21093168.html
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> 
> -- 
> Baptiste <Batmat> MATHUS - http://batmat.net
> Sauvez un arbre,
> Mangez un castor !
> 
> 

-- 
View this message in context: http://www.nabble.com/questions-about-profiles--tp21088457p21123944.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: questions about profiles?

Posted by Baptiste MATHUS <ml...@batmat.net>.
I might have missed something, but where did you use this property somewhere
else in your pom? And how do you run maven? What did you put after -P?

Cheers

2008/12/19 aymen83 <ay...@yahoo.fr>

>
> two profiles this is what i have done and this the profile for spring 2.0.8
>
> <profile>
>                        <id>legacy</id>
>                        <activation>
>                                <activeByDefault>false</activeByDefault>
>                                <jdk>1.5</jdk>
>                        </activation>
>                        <properties>
>                                <Spring.Version>2.0.8</Spring.Version>
>                        </properties>
>                        <build>
>                                <resources>
>                                        <resource>
>
>  <directory>src\main\resources\ressourcesDev</directory>
>                                        </resource>
>                                </resources>
>                                <plugins>
>                                        <plugin>
>
>  <groupId>org.apache.maven.plugins</groupId>
>
>  <artifactId>maven-war-plugin</artifactId>
>                                                <version>2.0</version>
>                                                <configuration>
>                                                        <webResources>
>                                                                <resource>
>
>  <directory>WsService\ressources2</directory>
>                                                                </resource>
>                                                        </webResources>
>                                                </configuration>
>                                        </plugin>
>                                </plugins>
>                        </build>
>
>                </profile>
>
> but this seems not working since when i tape mvn dependency:resolve i only
> have spring2.5.6
> thanks for helping
>
>
> aymen83 wrote:
> >
> > hi
> >
> > i've been searching for a way to override the version of an Artifact
> using
> > profiles, is that possible?
> > the idea is to change the version of framework when compiling a project,
> > for instance, the project is compiled using spring 2.5 and i want to
> write
> > a profile to compile it with the version 2.0
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/questions-about-profiles--tp21088457p21093168.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


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

Re: questions about profiles?

Posted by aymen83 <ay...@yahoo.fr>.
two profiles this is what i have done and this the profile for spring 2.0.8

<profile>
  			<id>legacy</id>
  			<activation>
  				<activeByDefault>false</activeByDefault>
  				<jdk>1.5</jdk>
  			</activation>
  			<properties>
  				<Spring.Version>2.0.8</Spring.Version>
  			</properties>
  			<build>
				<resources>
					<resource>
						<directory>src\main\resources\ressourcesDev</directory>
					</resource>
				</resources>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-war-plugin</artifactId>
						<version>2.0</version>
						<configuration>
							<webResources>
								<resource>
									<directory>WsService\ressources2</directory>
								</resource>
							</webResources>
						</configuration>
					</plugin>
				</plugins>
			</build>
  			
  		</profile>

but this seems not working since when i tape mvn dependency:resolve i only
have spring2.5.6
thanks for helping


aymen83 wrote:
> 
> hi
> 
> i've been searching for a way to override the version of an Artifact using
> profiles, is that possible?
> the idea is to change the version of framework when compiling a project,
> for instance, the project is compiled using spring 2.5 and i want to write
> a profile to compile it with the version 2.0
> 
> 

-- 
View this message in context: http://www.nabble.com/questions-about-profiles--tp21088457p21093168.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: questions about profiles?

Posted by Heinrich Nirschl <he...@gmail.com>.
On Fri, Dec 19, 2008 at 10:43 AM, aymen83 <ay...@yahoo.fr> wrote:
>
> hi
>
> i've been searching for a way to override the version of an Artifact using
> profiles, is that possible?
> the idea is to change the version of framework when compiling a project, for
> instance, the project is compiled using spring 2.5 and i want to write a
> profile to compile it with the version 2.0

You will need two profiles, one for version 2.5 (make it active by
default) and one for version 2.0. Within the profiles, you can either
declare the the whole dependency or just a property with the version
number.

In the particular case from spring 2.0 to spring 2.5 it may be
slightly more complicated because the packaging into spring modules
was changed between the versions. This means you may need other
dependencies unless you use the full spring.jar.

- Henry

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