You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Marco Mistroni <mm...@gmail.com> on 2006/09/18 17:03:17 UTC

profiles / ear content . how to do this?

hi all,
  i have a usecase in which i have to deploy an ear..
if the .ear is set to production, i have to include modules 1, 2 and 3
if the .ear is set to test/qa, i have to include modules 1,2,3,4

i was wondering if having profiles could help....but i fail to see how to
achieve
to include only certain modules in an .ear, unless i provide myself the
application.xml for thte two
different configurations

has anyone any idea / tips on how to do it properly?

thanks in advance and regards
 marco

Re: profiles / ear content . how to do this?

Posted by Pete <pe...@gmail.com>.
I did this on a previous project like this :-

EAR pom.xml

<webModule>
	<groupId>mygroup</groupId>
	<artifactId>myartifact</artifactId>
	<contextRoot>/myroot</contextRoot>
	<bundleFileName>name</bundleFileName>
	<excluded>${myartifact.optional.war.excluded}</excluded>
</webModule>

then either in the parent pom.xml or in settings.xml you can define a
property with a different setting per profile e.g.

<profile>
	<id>env_dev</id>
	<activation>
		<activeByDefault>true</activeByDefault>
	</activation>
	<properties>
		<profile.name>env_dev</profile.name>
		<myartifact.optional.war.excluded>false</myartifact.optional.war.excluded>		
	</properties>
</profile>
<profile>
	<id>env_live</id>
	<properties>
		<profile.name>env_live</profile.name>
		<myartifact.optional.war.excluded>true</myartifact.optional.war.excluded>
	</properties>
</profile>

this also works for EAR <javaModule> and <ejbModule>

Pete
On 18/09/06, Eric Redmond <er...@gmail.com> wrote:
> http://maven.apache.org/plugins/maven-ear-plugin/howto.html
>
> The ear plugin configuration to generate the application.xml can be
> different per profile.
>
> Eric
>
> On 9/18/06, Marco Mistroni <mm...@gmail.com> wrote:
> >
> > hi all,
> >   i have a usecase in which i have to deploy an ear..
> > if the .ear is set to production, i have to include modules 1, 2 and 3
> > if the .ear is set to test/qa, i have to include modules 1,2,3,4
> >
> > i was wondering if having profiles could help....but i fail to see how to
> > achieve
> > to include only certain modules in an .ear, unless i provide myself the
> > application.xml for thte two
> > different configurations
> >
> > has anyone any idea / tips on how to do it properly?
> >
> > thanks in advance and regards
> > marco
> >
> >
>
>
> --
> Eric Redmond
> http://codehaus.org/~eredmond
>
>

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


Re: profiles / ear content . how to do this?

Posted by Eric Redmond <er...@gmail.com>.
http://maven.apache.org/plugins/maven-ear-plugin/howto.html

The ear plugin configuration to generate the application.xml can be
different per profile.

Eric

On 9/18/06, Marco Mistroni <mm...@gmail.com> wrote:
>
> hi all,
>   i have a usecase in which i have to deploy an ear..
> if the .ear is set to production, i have to include modules 1, 2 and 3
> if the .ear is set to test/qa, i have to include modules 1,2,3,4
>
> i was wondering if having profiles could help....but i fail to see how to
> achieve
> to include only certain modules in an .ear, unless i provide myself the
> application.xml for thte two
> different configurations
>
> has anyone any idea / tips on how to do it properly?
>
> thanks in advance and regards
> marco
>
>


-- 
Eric Redmond
http://codehaus.org/~eredmond