Index: /home/jwi/workspace/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java
===================================================================
--- /home/jwi/workspace/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java	(revision 411469)
+++ /home/jwi/workspace/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java	(working copy)
@@ -86,6 +86,13 @@
     private MavenProjectHelper projectHelper;
 
     /**
+     * Whether an empty archive shall be created.
+     *
+     * @parameter
+     */
+    private boolean createEmptyArchive;
+
+    /**
      * Return the specific output directory to serve as the root for the archive.
      */
     protected abstract File getClassesDirectory();
@@ -114,6 +121,11 @@
         return new File( basedir, finalName + classifier + ".jar" );
     }
 
+    protected boolean isCreatingEmptyArchives()
+    {
+        return createEmptyArchive;
+    }
+
     /**
      * Generates the JAR.
      *
@@ -135,12 +147,14 @@
             File contentDirectory = getClassesDirectory();
             if ( !contentDirectory.exists() )
             {
+                if (!isCreatingEmptyArchives())
+                {
+                    getLog().debug( "Empty JAR file is not created, set createEmptyArchive=true to override this." );
+                    return null;
+                }
                 getLog().warn( "JAR will be empty - no content was marked for inclusion!" );
             }
-            else
-            {
-                archiver.getArchiver().addDirectory( contentDirectory, DEFAULT_INCLUDES, DEFAULT_EXCLUDES );
-            }
+            archiver.getArchiver().addDirectory( contentDirectory, DEFAULT_INCLUDES, DEFAULT_EXCLUDES );
 
             archiver.createArchive( project, archive );
 
@@ -163,14 +177,17 @@
     {
         File jarFile = createArchive();
 
-        String classifier = getClassifier();
-        if ( classifier != null )
+        if ( jarFile != null )
         {
-            projectHelper.attachArtifact( getProject(), "jar", classifier, jarFile );
-        }
-        else
-        {
-            getProject().getArtifact().setFile( jarFile );
+            String classifier = getClassifier();
+            if ( classifier != null )
+            {
+                projectHelper.attachArtifact( getProject(), "jar", classifier, jarFile );
+            }
+            else
+            {
+                getProject().getArtifact().setFile( jarFile );
+            }
         }
     }
 }

