Author: peterreilly
Date: Mon Aug 20 09:34:52 2007
New Revision: 567745
URL: http://svn.apache.org/viewvc?rev=567745&view=rev
Log:
sync
Modified:
ant/core/branches/ANT_17_BRANCH/WHATSNEW
ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/War.java
ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/Zip.java
Modified: ant/core/branches/ANT_17_BRANCH/WHATSNEW
URL:
http://svn.apache.org/viewvc/ant/core/branches/ANT_17_BRANCH/WHATSNEW?rev=567745&r1=567744&r2=567745&view=diff
==============================================================================
--- ant/core/branches/ANT_17_BRANCH/WHATSNEW (original)
+++ ant/core/branches/ANT_17_BRANCH/WHATSNEW Mon Aug 20 09:34:52 2007
@@ -111,6 +111,9 @@
* Regression: Path subclasses that overrode list() stopped working in
resourceCollection contexts in Ant 1.7.0. Bugzilla 42967.
+* War task failed with "No WEB-INF/web.xml file was added" when called
+ a second time. Bugzilla 43121.
+
Other changes:
--------------
* <script> now has basic support for JavaFX scripts
Modified:
ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/War.java
URL:
http://svn.apache.org/viewvc/ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/War.java?rev=567745&r1=567744&r2=567745&view=diff
==============================================================================
---
ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/War.java
(original)
+++
ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/War.java
Mon Aug 20 09:34:52 2007
@@ -219,7 +219,8 @@
if (addedWebXmlFile == null
&& deploymentDescriptor == null
&& needxmlfile
- && !isInUpdateMode()) {
+ && !isInUpdateMode()
+ && hasUpdatedFile()) {
throw new BuildException("No WEB-INF/web.xml file was added.\n"
+ "If this is your intent, set needxmlfile='false' ");
}
Modified:
ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/Zip.java
URL:
http://svn.apache.org/viewvc/ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/Zip.java?rev=567745&r1=567744&r2=567745&view=diff
==============================================================================
---
ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/Zip.java
(original)
+++
ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/Zip.java
Mon Aug 20 09:34:52 2007
@@ -97,6 +97,10 @@
// CheckStyle:VisibilityModifier ON
+ // This boolean is set if the task detects that the
+ // target is outofdate and has written to the target file.
+ private boolean updatedFile = false;
+
/**
* true when we are adding new files into the Zip file, as opposed
* to adding back the unchanged files
@@ -412,6 +416,16 @@
}
/**
+ * Get the value of the updatedFile attribute.
+ * This should only be called after executeMain has been
+ * called.
+ * @return true if executeMain has written to the zip file.
+ */
+ protected boolean hasUpdatedFile() {
+ return updatedFile;
+ }
+
+ /**
* Build the zip file.
* This is called twice if doubleFilePass is true.
* @throws BuildException on error
@@ -450,6 +464,7 @@
if (!state.isOutOfDate()) {
return;
}
+ updatedFile = true;
if (!zipFile.exists() && state.isWithoutAnyResources()) {
createEmptyZip(zipFile);
return;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]