diff --git a/WHATSNEW b/WHATSNEW
index 0a5122872..70b9d2951 100644
--- a/WHATSNEW
+++ b/WHATSNEW
@@ -24,6 +24,10 @@ Fixed bugs:
that only one test could be running at the same time - this is not
necessarily true, see junit.extensions.ActiveTestSuite.
+* 's whenEmpty attribute is useless as JARs are never empty, they
+ contain at least a manifest file, therefore it will now print a
+ warning and do nothing.
+
Other changes:
--------------
diff --git a/docs/manual/CoreTasks/ear.html b/docs/manual/CoreTasks/ear.html
index a1184ceed..dc4a05d44 100644
--- a/docs/manual/CoreTasks/ear.html
+++ b/docs/manual/CoreTasks/ear.html
@@ -97,11 +97,6 @@ attributes of zipfilesets in a Zip or Jar task.)
the destination file if it already exists.
No |
-
- whenempty |
- Behavior to use if no files match. |
- No |
-
Nested elements
metainf
diff --git a/docs/manual/CoreTasks/jar.html b/docs/manual/CoreTasks/jar.html
index 6f14da36f..8182dd278 100644
--- a/docs/manual/CoreTasks/jar.html
+++ b/docs/manual/CoreTasks/jar.html
@@ -38,10 +38,6 @@ JAR file already exists. When set to yes
, the JAR file is
updated with the files specified. When set to no
(the
default) the JAR file is overwritten. An example use of this is
provided in the Zip task documentation.
-The whenempty
parameter controls what happens when no files match.
-If create
(the default), the JAR is created anyway with only a manifest.
-If skip
, the JAR is not created and a warning is issued.
-If fail
, the JAR is not created and the build is halted with an error.
(The Jar task is a shortcut for specifying the manifest file of a JAR file.
The same thing can be accomplished by using the fullpath
attribute of a zipfileset in a Zip task. The one difference is that if the
@@ -124,11 +120,6 @@ include an empty one for you.)
the destination file if it already exists.
No |
-
- whenempty |
- Behavior to use if no files match. |
- No |
-
Nested elements
metainf
diff --git a/docs/manual/CoreTasks/war.html b/docs/manual/CoreTasks/war.html
index 50214aa4c..65e8aedbd 100644
--- a/docs/manual/CoreTasks/war.html
+++ b/docs/manual/CoreTasks/war.html
@@ -99,11 +99,6 @@ attributes of zipfilesets in a Zip or Jar task.)
the destination file if it already exists.
No |
-
- whenempty |
- Behavior to use if no files match. |
- No |
-
Nested elements
lib
diff --git a/src/main/org/apache/tools/ant/taskdefs/Jar.java b/src/main/org/apache/tools/ant/taskdefs/Jar.java
index 54d7aa199..dfef46af0 100644
--- a/src/main/org/apache/tools/ant/taskdefs/Jar.java
+++ b/src/main/org/apache/tools/ant/taskdefs/Jar.java
@@ -91,6 +91,11 @@ public class Jar extends Zip {
setEncoding("UTF8");
}
+ public void setWhenempty(WhenEmpty we) {
+ log("JARs are never empty, they contain at least a manifest file",
+ Project.MSG_WARN);
+ }
+
/**
* @deprecated use setFile(File) instead.
*/