Hi Antonio,
Thanks for the link.  That lead me on to
http://maven.apache.org/plugins/maven-war-plugin/examples/skinny-wars.html
So I added a block like so:
<plugin>
  <artifactId>maven-war-plugin</artifactId>
  <configuration>
    <warSourceExcludes>WEB-INF/lib/MyLib*.jar</warSourceExcludes>        
  </configuration>
</plugin>

I use * to avoid duplication of my version (of course I could use
property here).
This prevents the JAR appearing in the WAR as I wish.  Unfortunately
this caused another issue.  All the transitive dependencies of my
artifact still appear in the WAR!  To prevent this would require more
duplication than my original alternative profile method.  Is there a way
to exclude from the WAR but specify dependency artifacts rather than
file patterns?  I'm guessing there isn't from the docs.

Thanks,
Martin

----- Original message -----
From: "Antonio Petrelli" <[EMAIL PROTECTED]>
To: "Maven Users List" <users@maven.apache.org>
Date: Tue, 11 Sep 2007 10:50:28 +0200
Subject: Re: Dependency scope

2007/9/11, Martin Gilday <[EMAIL PROTECTED]>:
>
> Is there a dependency scope which makes an artifact available for
> compilation of src/main/java and also on the test classpath, but not
> included in the resulting WAR?  I have tried provided which makes sense
> in excluding it from the WAR but then it is not available to my tests.
> The only solution I have found is to make another profile to use when
> testing which overwrites the provided scope to default scope.  This
> means duplicating all of the dependency blocks, so is far from ideal.



I think that you need to exclude it manually, in the WAR plugin
configuration:
http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html#dependentWarExcludes

HTH
Antonio

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to