Browse Source

fix regression in <ear> that would allow multiple application.xml files. PR 6836

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@908464 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 15 years ago
parent
commit
923ce185dd
3 changed files with 9 additions and 2 deletions
  1. +4
    -0
      WHATSNEW
  2. +4
    -2
      src/main/org/apache/tools/ant/taskdefs/Ear.java
  3. +1
    -0
      src/tests/antunit/taskdefs/ear-test.xml

+ 4
- 0
WHATSNEW View File

@@ -18,6 +18,10 @@ Fixed bugs:
the first one.
Bugzilla Report 48715.

* Regression: The <ear> task would allow multiple
META-INF/application.xml files to be added.
Bugzilla Report 6836.

Other changes:
--------------



+ 4
- 2
src/main/org/apache/tools/ant/taskdefs/Ear.java View File

@@ -40,6 +40,8 @@ public class Ear extends Jar {
private File deploymentDescriptor;
private boolean descriptorAdded;
private static final String XML_DESCRIPTOR_PATH = "META-INF/application.xml";
private static final String XML_DESCRIPTOR_PATH_LC =
XML_DESCRIPTOR_PATH.toLowerCase(Locale.ENGLISH);

/**
* Create an Ear task.
@@ -126,8 +128,8 @@ public class Ear extends Jar {
// file is specified by the "appxml" attribute and in a
// <fileset> element.
String vPathLowerCase = vPath.toLowerCase(Locale.ENGLISH);
if (XML_DESCRIPTOR_PATH.equals(vPathLowerCase)) {
if (deploymentDescriptor != null
if (XML_DESCRIPTOR_PATH_LC.equals(vPathLowerCase)) {
if (deploymentDescriptor == null
|| !FILE_UTILS.fileNameEquals(deploymentDescriptor, file)
|| descriptorAdded) {
logWhenWriting("Warning: selected " + archiveType


+ 1
- 0
src/tests/antunit/taskdefs/ear-test.xml View File

@@ -26,5 +26,6 @@
<ear destfile="${output}/test.ear" appxml="${input}/x.xml">
<fileset dir="${input}"/>
</ear>
<au:assertLogContains text="Warning: selected ear files include a META-INF/application.xml which will be ignored (please use appxml attribute to ear task)"/>
</target>
</project>

Loading…
Cancel
Save