You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Thierry Lach <th...@gmail.com> on 2007/01/05 20:39:39 UTC
Different scopes for same jar depending on profile?
I'm putting together a build process in which I want to be able to customize
the war build to optionally exclude certain jars under certain profiles.
Specifically, I want to exclude the junit jar from WEB-INF/lib if (and only
if) I'm building using the profile jboss, triggered by -Djboss-build on the
command line.
So I want <scope>provided</scope> when building for jboss, but
<scope>compile</scope> when not. Is there any way that I can accomplish
this?
Re: Different scopes for same jar depending on profile?
Posted by Wayne Fay <wa...@gmail.com>.
I would just solve this with 2 profiles and a shared variable ie
${myscope} which is set in the profiles to be "provided" or "compile".
Then in the various poms, I'd specify the dependency as
<scope>${myscope}</scope>.
Alternatively you can specify the dependencies themselves in the profiles [0].
[0] http://docs.codehaus.org/display/MAVEN/Build+Profiles
Wayne
On 1/8/07, Thierry Lach <th...@gmail.com> wrote:
> OK I think I found out how to do this. I wouldn't be using different
> scopes, but I would be using different assemblies. Correct or not?
>
> On 1/5/07, Thierry Lach <th...@gmail.com> wrote:
> >
> > I'm putting together a build process in which I want to be able to
> > customize the war build to optionally exclude certain jars under certain
> > profiles. Specifically, I want to exclude the junit jar from WEB-INF/lib if
> > (and only if) I'm building using the profile jboss, triggered by
> > -Djboss-build on the command line.
> >
> > So I want <scope>provided</scope> when building for jboss, but
> > <scope>compile</scope> when not. Is there any way that I can accomplish
> > this?
> >
> >
> >
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Different scopes for same jar depending on profile?
Posted by Thierry Lach <th...@gmail.com>.
OK I think I found out how to do this. I wouldn't be using different
scopes, but I would be using different assemblies. Correct or not?
On 1/5/07, Thierry Lach <th...@gmail.com> wrote:
>
> I'm putting together a build process in which I want to be able to
> customize the war build to optionally exclude certain jars under certain
> profiles. Specifically, I want to exclude the junit jar from WEB-INF/lib if
> (and only if) I'm building using the profile jboss, triggered by
> -Djboss-build on the command line.
>
> So I want <scope>provided</scope> when building for jboss, but
> <scope>compile</scope> when not. Is there any way that I can accomplish
> this?
>
>
>