maven-m2-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject cvs commit: maven-components/maven-plugins/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar JarMojo.java
Date Tue, 29 Mar 2005 06:02:57 GMT
brett       2005/03/28 22:02:57

  Modified:    maven-plugins/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar
                        JarMojo.java
  Log:
  allow empty JARs
  
  Revision  Changes    Path
  1.20      +10 -2     maven-components/maven-plugins/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/JarMojo.java
  
  Index: JarMojo.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugins/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/JarMojo.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- JarMojo.java	29 Mar 2005 05:55:10 -0000	1.19
  +++ JarMojo.java	29 Mar 2005 06:02:57 -0000	1.20
  @@ -159,7 +159,15 @@
   
           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,
  
  
  

Mime
View raw message