Index: src/main/java/org/apache/maven/plugin/war/AbstractWarMojo.java =================================================================== --- src/main/java/org/apache/maven/plugin/war/AbstractWarMojo.java (revision 388332) +++ src/main/java/org/apache/maven/plugin/war/AbstractWarMojo.java (working copy) @@ -377,7 +377,7 @@ for ( Iterator iter = artifacts.iterator(); iter.hasNext(); ) { Artifact artifact = (Artifact) iter.next(); - String targetFileName = artifact.getFile().getName(); + String targetFileName = convertToM2FileName( artifact ); getLog().debug( "Processing: " + targetFileName ); @@ -445,7 +445,7 @@ for ( Iterator iter = artifacts.iterator(); iter.hasNext(); ) { Artifact artifact = (Artifact) iter.next(); - String candidate = artifact.getFile().getName(); + String candidate = convertToM2FileName( artifact ); if ( identifiers.contains( candidate ) ) { duplicates.add( candidate ); @@ -731,4 +731,25 @@ } } + /** + * Converts the filename of an artifact to artifactId-version.type format. + * + * @param artifact + * @return converted filename of the artifact + */ + private String convertToM2FileName( Artifact artifact ) + { + String filename; + if ( !artifact.getFile().getName().equals( + artifact.getArtifactId() + "-" + artifact.getVersion() + "." + artifact.getType() ) ) + { + filename = artifact.getArtifactId() + "-" + artifact.getVersion() + "." + artifact.getType(); + } + else + { + filename = artifact.getFile().getName(); + } + return filename; + } + }