Index: plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/AbstractWarMojo.java =================================================================== --- plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/AbstractWarMojo.java (revision 388897) +++ plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/AbstractWarMojo.java (working copy) @@ -272,7 +272,7 @@ return StringUtils.split( StringUtils.defaultString( dependentWarIncludes ), "," ); } - public void buildExplodedWebapp( File webappDirectory ) + public void buildExplodedWebapp( File webappDirectory, boolean bundle ) throws MojoExecutionException { getLog().info( "Exploding webapp..." ); @@ -289,7 +289,7 @@ { copyResources( getWarSourceDirectory(), webappDirectory, getWebXml(), getContainerConfigXML() ); - buildWebapp( getProject(), webappDirectory ); + buildWebapp( getProject(), webappDirectory, bundle ); } catch ( IOException e ) { @@ -352,7 +352,7 @@ * @param webappDirectory * @throws java.io.IOException if an error occured while building the webapp */ - public void buildWebapp( MavenProject project, File webappDirectory ) + public void buildWebapp( MavenProject project, File webappDirectory, boolean bundle ) throws MojoExecutionException, IOException { getLog().info( "Assembling webapp " + project.getArtifactId() + " in " + webappDirectory ); @@ -397,11 +397,11 @@ { copyFileIfModified( artifact.getFile(), new File( tldDirectory, targetFileName ) ); } - else if ( "jar".equals( type ) || "ejb".equals( type ) || "ejb-client".equals( type ) ) + else if ( bundle && ( "jar".equals( type ) || "ejb".equals( type ) || "ejb-client".equals( type ) ) ) { copyFileIfModified( artifact.getFile(), new File( libDirectory, targetFileName ) ); } - else if ( "par".equals( type ) ) + else if ( bundle && "par".equals( type ) ) { targetFileName = targetFileName.substring( 0, targetFileName.lastIndexOf( '.' ) ) + ".jar"; Index: plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarExplodedMojo.java =================================================================== --- plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarExplodedMojo.java (revision 388897) +++ plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarExplodedMojo.java (working copy) @@ -30,7 +30,8 @@ { public void execute() throws MojoExecutionException { - buildExplodedWebapp( getWebappDirectory() ); + boolean bundle = true; + buildExplodedWebapp( getWebappDirectory(), bundle ); } } \ No newline at end of file Index: plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarInPlaceMojo.java =================================================================== --- plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarInPlaceMojo.java (revision 388897) +++ plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarInPlaceMojo.java (working copy) @@ -31,6 +31,7 @@ { getLog().info( "Generating webapp in source directory... " + getWarSourceDirectory() ); - buildExplodedWebapp( getWarSourceDirectory() ); + boolean bundle = true; + buildExplodedWebapp( getWarSourceDirectory(), bundle ); } } \ No newline at end of file Index: plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarMojo.java =================================================================== --- plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarMojo.java (revision 388897) +++ plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarMojo.java (working copy) @@ -148,7 +148,8 @@ throws IOException, ArchiverException, ManifestException, DependencyResolutionRequiredException, MojoExecutionException { - buildExplodedWebapp( getWebappDirectory() ); + boolean bundle = !archive.getManifest().isAddClasspath(); + buildExplodedWebapp( getWebappDirectory(), bundle ); //generate war file getLog().info( "Generating war " + warFile.getAbsolutePath() );