Index: src/main/java/org/apache/maven/plugin/jar/JarMojo.java =================================================================== --- src/main/java/org/apache/maven/plugin/jar/JarMojo.java (wersja 545340) +++ src/main/java/org/apache/maven/plugin/jar/JarMojo.java (kopia robocza) @@ -49,6 +49,14 @@ { return classifier; } + + /** + * @return type of the generated artifact + */ + protected String getType() + { + return "jar"; + } /** * Return the main classes directory, so it's used as the root of the jar. Index: src/main/java/org/apache/maven/plugin/jar/TestJarMojo.java =================================================================== --- src/main/java/org/apache/maven/plugin/jar/TestJarMojo.java (wersja 545340) +++ src/main/java/org/apache/maven/plugin/jar/TestJarMojo.java (kopia robocza) @@ -44,6 +44,14 @@ } /** + * @return type of the generated artifact + */ + protected String getType() + { + return "test-jar"; + } + + /** * Return the test-classes directory, to serve as the root of the tests jar. */ protected File getClassesDirectory() Index: src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java =================================================================== --- src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java (wersja 545340) +++ src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java (kopia robocza) @@ -107,6 +107,11 @@ * Overload this to produce a test-jar, for example. */ protected abstract String getClassifier(); + + /** + * Overload this to produce a test-jar, for example. + */ + protected abstract String getType(); protected static File getJarFile( File basedir, String finalName, String classifier ) { @@ -172,11 +177,11 @@ throws MojoExecutionException { File jarFile = createArchive(); - + String classifier = getClassifier(); if ( classifier != null ) { - projectHelper.attachArtifact( getProject(), "jar", classifier, jarFile ); + projectHelper.attachArtifact( getProject(), getType(), classifier, jarFile ); } else {