allow empty JARs

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163702 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-03-29 06:02:57 +00:00
parent b512b2e7a2
commit e3c15069c5
1 changed files with 9 additions and 1 deletions

View File

@ -159,7 +159,15 @@ public void execute()
try
{
archiver.getArchiver().addDirectory( new File( outputDirectory ), DEFAULT_INCLUDES, DEFAULT_EXCLUDES );
File contentDirectory = new File( outputDirectory );
if ( !contentDirectory.exists() )
{
getLog().warn( "JAR will be empty - no content was marked for inclusion!" );
}
else
{
archiver.getArchiver().addDirectory( contentDirectory, DEFAULT_INCLUDES, DEFAULT_EXCLUDES );
}
// create archive
Manifest configuredManifest = archiver.getManifest( project, mainClass, packageName,