You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Piotr Bzdyl <pi...@bzdyl.net> on 2006/02/01 10:01:44 UTC
[m2] war plugin and warSourceExcludes not working for dependencies
Hello,
I tried to follow instructions from:
http://www.nabble.com/Maven-2-EAR%2C-WAR%2C-EJB-Common-Dependencies-t1013415.html
and
http://www.nabble.com/RE%3A-Best-Practice---Maven-with-WSAD-or-RAD6-p2509735.html
and
http://www.nabble.com/RE%3A-m2-war-dependencies-in-ear-p2222054.html
using following code in my war project's pom.xml:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<warSourceExcludes>WEB-INF/lib/*.jar</warSourceExcludes>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
</archive>
</configuration>
</plugin>
but it seems that it is not working for me. What I want to get is war
without its dependencies in the WEB-INF/lib, because I want to have them
in the EAR. What am I doing wrong?
Best regards,
Piotrek
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [m2] war plugin and warSourceExcludes not working for dependencies
Posted by Piotr Bzdyl <pi...@bzdyl.net>.
> Is it a bug in the maven-war-plugin?
From plugin sources:
for ( Iterator iter = artifacts.iterator(); iter.hasNext(); )
{
Artifact artifact = (Artifact) iter.next();
// TODO: utilise appropriate methods from project builder
ScopeArtifactFilter filter = new ScopeArtifactFilter(
Artifact.SCOPE_RUNTIME );
if ( !artifact.isOptional() && filter.include( artifact ) )
{
String type = artifact.getType();
if ( "tld".equals( type ) )
{
FileUtils.copyFileToDirectory( artifact.getFile(),
tldDirectory );
}
/* ################################################################### */
else if ( "jar".equals( type ) || "ejb".equals( type )
|| "ejb-client".equals( type ) )
{
FileUtils.copyFileToDirectory( artifact.getFile(),
libDirectory );
}
/* ################################################################### */
It seems that all dependencies are copied to the WEB-INF/lib - excludes
filter is not used here. Is this a bug or the plugin should work this
way? If this behavior is intended maybe there should be some flag or
other excludes filter for project dependencies? I tried to make all
dependencies <scope>provided</scope> but then they don't appear in the
manifest.mf Classpath :(
Best regards,
Piotrek
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [m2] war plugin and warSourceExcludes not working for dependencies
Posted by Piotr Bzdyl <pi...@bzdyl.net>.
>
> I tried to follow instructions from:
> http://www.nabble.com/Maven-2-EAR%2C-WAR%2C-EJB-Common-Dependencies-t1013415.html
>
> and
> http://www.nabble.com/RE%3A-Best-Practice---Maven-with-WSAD-or-RAD6-p2509735.html
>
> and
> http://www.nabble.com/RE%3A-m2-war-dependencies-in-ear-p2222054.html
>
> using following code in my war project's pom.xml:
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-war-plugin</artifactId>
> <configuration>
> <warSourceExcludes>WEB-INF/lib/*.jar</warSourceExcludes>
> <archive>
> <manifest>
> <addClasspath>true</addClasspath>
> <classpathPrefix>lib/</classpathPrefix>
> </manifest>
> </archive>
> </configuration>
> </plugin>
>
> but it seems that it is not working for me. What I want to get is war
> without its dependencies in the WEB-INF/lib, because I want to have
> them in the EAR. What am I doing wrong?
>
Is it a bug in the maven-war-plugin?
Best regards,
Piotrek
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org