Skip to content

Commit 59b0db4

Browse files
AXIS2-5965 Add duplicate=preserve to jar tasks in codegen Ant templates
The generated build.xml jar targets packed .class files up to 3 times when multiple filesets overlapped, tripling the output JAR size. Add duplicate="preserve" to all <jar> tasks across all 5 Ant build templates (adb, default, jaxbri, jaxme, xmlbeans) so the first occurrence wins and duplicates are silently skipped.
1 parent 451e80f commit 59b0db4

5 files changed

Lines changed: 12 additions & 12 deletions

File tree

modules/codegen/src/org/apache/axis2/wsdl/template/general/adbAntBuildTemplate.xsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@
170170
<include><xsl:attribute name="name">*.xsd</xsl:attribute></include>
171171
</fileset>
172172
</copy>
173-
<jar>
173+
<jar duplicate="preserve">
174174
<xsl:attribute name="destfile">${lib}/${name}.aar</xsl:attribute>
175175
<fileset>
176176
<xsl:attribute name="excludes">**/Test.class</xsl:attribute>
@@ -191,7 +191,7 @@
191191
<xsl:attribute name="depends">compile.test</xsl:attribute>
192192
</xsl:otherwise>
193193
</xsl:choose>
194-
<jar>
194+
<jar duplicate="preserve">
195195
<xsl:attribute name="destfile">${lib}/${name}-test-client.jar</xsl:attribute>
196196
<fileset>
197197
<xsl:attribute name="dir">${classes}</xsl:attribute>

modules/codegen/src/org/apache/axis2/wsdl/template/general/defaultAntBuildTemplate.xsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
<xsl:attribute name="depends">compile.test</xsl:attribute>
162162
</xsl:otherwise>
163163
</xsl:choose>
164-
<jar>
164+
<jar duplicate="preserve">
165165
<xsl:attribute name="destfile">${lib}/${name}-client.jar</xsl:attribute>
166166
<fileset>
167167
<xsl:attribute name="dir">${classes}</xsl:attribute>
@@ -203,7 +203,7 @@
203203
</include>
204204
</fileset>
205205
</copy>
206-
<jar>
206+
<jar duplicate="preserve">
207207
<xsl:attribute name="destfile">${lib}/${name}.aar</xsl:attribute>
208208
<fileset>
209209
<xsl:attribute name="excludes">**/Test.class</xsl:attribute>

modules/codegen/src/org/apache/axis2/wsdl/template/general/jaxbriAntBuildTemplate.xsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@
182182
<exclude><xsl:attribute name="name">**/schemaorg_apache_xmlbean/**</xsl:attribute></exclude>
183183
</fileset>
184184
</copy>
185-
<jar>
185+
<jar duplicate="preserve">
186186
<xsl:attribute name="destfile">${lib}/${name}.aar</xsl:attribute>
187187
<fileset>
188188
<xsl:attribute name="excludes">**/Test.class</xsl:attribute>
@@ -202,7 +202,7 @@
202202
</xsl:otherwise>
203203
</xsl:choose>
204204

205-
<jar>
205+
<jar duplicate="preserve">
206206
<xsl:attribute name="destfile">${lib}/${name}-test-client.jar</xsl:attribute>
207207
<fileset>
208208
<xsl:attribute name="dir">${classes}</xsl:attribute>

modules/codegen/src/org/apache/axis2/wsdl/template/general/jaxmeAntBuildTemplate.xsl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999

100100
<target name="jar.xbeans">
101101
<!-- jar the XMLbeans stuff to the lib folder-->
102-
<jar>
102+
<jar duplicate="preserve">
103103
<xsl:attribute name="basedir">${resources}</xsl:attribute>
104104
<xsl:attribute name="destfile">${lib}/${xbeans.packaged.jar.name}</xsl:attribute>
105105
<xsl:attribute name="excludes">**/services.xml, **/*.xsd</xsl:attribute>
@@ -192,7 +192,7 @@
192192
<xsl:attribute name="file">${lib}/${xbeans.packaged.jar.name}</xsl:attribute>
193193
<xsl:attribute name="toDir">${classes}/lib</xsl:attribute>
194194
</copy>
195-
<jar>
195+
<jar duplicate="preserve">
196196
<xsl:attribute name="destfile">${lib}/${name}.aar</xsl:attribute>
197197
<fileset>
198198
<xsl:attribute name="excludes">**/Test.class</xsl:attribute>
@@ -201,7 +201,7 @@
201201
</jar>
202202
</target>
203203
<target name="jar.client" depends="compile.test" if="jars.ok">
204-
<jar>
204+
<jar duplicate="preserve">
205205
<xsl:attribute name="destfile">${lib}/${name}-test-client.jar</xsl:attribute>
206206
<fileset>
207207
<xsl:attribute name="dir">${classes}</xsl:attribute>

modules/codegen/src/org/apache/axis2/wsdl/template/general/xmlbeansAntBuildTemplate.xsl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107

108108
<target name="jar.xbeans">
109109
<!-- jar the XMLbeans stuff to the lib folder-->
110-
<jar>
110+
<jar duplicate="preserve">
111111
<xsl:attribute name="basedir">${resources}</xsl:attribute>
112112
<xsl:attribute name="destfile">${lib}/${xbeans.packaged.jar.name}</xsl:attribute>
113113
<xsl:attribute name="excludes">**/services.xml, **/*.xsd</xsl:attribute>
@@ -204,7 +204,7 @@
204204
<xsl:attribute name="file">${lib}/${xbeans.packaged.jar.name}</xsl:attribute>
205205
<xsl:attribute name="toDir">${classes}/lib</xsl:attribute>
206206
</copy>
207-
<jar>
207+
<jar duplicate="preserve">
208208
<xsl:attribute name="destfile">${lib}/${name}.aar</xsl:attribute>
209209
<fileset>
210210
<xsl:attribute name="excludes">**/Test.class</xsl:attribute>
@@ -224,7 +224,7 @@
224224
</xsl:otherwise>
225225
</xsl:choose>
226226

227-
<jar>
227+
<jar duplicate="preserve">
228228
<xsl:attribute name="destfile">${lib}/${name}-test-client.jar</xsl:attribute>
229229
<fileset>
230230
<xsl:attribute name="dir">${classes}</xsl:attribute>

0 commit comments

Comments
 (0)