You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Sonar, Nishant" <ni...@wachovia.com> on 2007/10/15 00:35:13 UTC

profiles qustion

Hi

 

We work with profiles in maven as 

 

Mvn -Pprofile1,profile2

 

On pom

 

<profiles>

<profile>

            <id>profile1</id>

<build>

<plugin>

...         

</plugin>

</build>

<profile>

<profile>

            <id>profile2</id>

<build>

<plugin>

...         

</plugin>

</build>

<profile>

</profiles>

 

In this case both the builds are different .Consider a case where we have a comman build tasks in 

Both tasks but some ½ different build tasks (plugins) to be different , Is there a way to specify one common build which

Will always execute and one which will execute plugins on basis of profile

 

 

Thanks

nishant

 


Re: profiles qustion

Posted by Victor Cardona <v....@sbcglobal.net>.
Sonar, Nishant wrote:
> Hi
> 
>  
> 
> We work with profiles in maven as 
> 
>  
> 
> Mvn -Pprofile1,profile2
> 
>  
> 
> On pom
> 
>  
> 
> <profiles>
> 
> <profile>
> 
>             <id>profile1</id>
> 
> <build>
> 
> <plugin>
> 
> ...         
> 
> </plugin>
> 
> </build>
> 
> <profile>
> 
> <profile>
> 
>             <id>profile2</id>
> 
> <build>
> 
> <plugin>
> 
> ...         
> 
> </plugin>
> 
> </build>
> 
> <profile>
> 
> </profiles>
> 
>  
> 
> In this case both the builds are different .Consider a case where we have a comman build tasks in 
> 
> Both tasks but some ½ different build tasks (plugins) to be different , Is there a way to specify one common build which
> 
> Will always execute and one which will execute plugins on basis of profile
> 
>  
> 
>  
> 
> Thanks
> 
> nishant
> 
>  
> 
> 

Factor out the common parts of the profiles and put that in the POM's
build section.  Then just use the profiles to override or add to that.

For instance, by default my project builds with standard debug settings
and no optimization.  This is specified in the build section of the POM.
 However, I created a release profile that overrides some of the
compiler plugin settings.

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


Re: profiles qustion

Posted by Wayne Fay <wa...@gmail.com>.
If you just move the "common" stuff out of the profiles, and into the
normal <build> section of the pom, then it will be shared by both
profiles.

Wayne

On 10/14/07, Sonar, Nishant <ni...@wachovia.com> wrote:
> Hi
>
>
>
> We work with profiles in maven as
>
>
>
> Mvn -Pprofile1,profile2
>
>
>
> On pom
>
>
>
> <profiles>
>
> <profile>
>
>            <id>profile1</id>
>
> <build>
>
> <plugin>
>
> ...
>
> </plugin>
>
> </build>
>
> <profile>
>
> <profile>
>
>            <id>profile2</id>
>
> <build>
>
> <plugin>
>
> ...
>
> </plugin>
>
> </build>
>
> <profile>
>
> </profiles>
>
>
>
> In this case both the builds are different .Consider a case where we have a comman build tasks in
>
> Both tasks but some ½ different build tasks (plugins) to be different , Is there a way to specify one common build which
>
> Will always execute and one which will execute plugins on basis of profile
>
>
>
>
>
> Thanks
>
> nishant
>
>
>
>

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