Skip to content

Commit f4efcaf

Browse files
springbootdemo: fix antrun phase and .mar overwrite for reliable builds
Two related fixes: - Move antrun execution from 'install' to 'prepare-package' phase so that 'mvn package' (not just 'mvn install') assembles the .aar services, copies axis2.xml, and creates the openapi .mar — the previous binding meant a 'mvn package -DskipTests' silently produced a stale deployment directory - Add overwrite="true" to both .mar copy tasks so a pre-existing .mar from a previous build is always replaced with the latest jar from .m2/repository Applied to both springbootdemo (WildFly) and springbootdemo-tomcat11. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 08a8b2b commit f4efcaf

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

  • modules/samples/userguide/src/userguide

modules/samples/userguide/src/userguide/springbootdemo-tomcat11/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@
353353
<executions>
354354
<execution>
355355
<id>install</id>
356-
<phase>install</phase>
356+
<phase>prepare-package</phase>
357357
<configuration>
358358
<target>
359359
<jar jarfile="${project.build.directory}/deploy/axis2-json-api.war/WEB-INF/services/Login.aar">

modules/samples/userguide/src/userguide/springbootdemo/pom.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@
354354
<executions>
355355
<execution>
356356
<id>install</id>
357-
<phase>install</phase>
357+
<phase>prepare-package</phase>
358358
<configuration>
359359
<target>
360360
<jar jarfile="${project.build.directory}/deploy/axis2-json-api.war/WEB-INF/services/Login.aar">
@@ -374,7 +374,8 @@
374374
<!-- Create openapi module archive for WEB-INF/modules -->
375375
<mkdir dir="${project.build.directory}/deploy/axis2-json-api.war/WEB-INF/modules"/>
376376
<copy file="${settings.localRepository}/org/apache/axis2/axis2-openapi/${axis2.version}/axis2-openapi-${axis2.version}.jar"
377-
tofile="${project.build.directory}/deploy/axis2-json-api.war/WEB-INF/modules/openapi-${axis2.version}.mar"/>
377+
tofile="${project.build.directory}/deploy/axis2-json-api.war/WEB-INF/modules/openapi-${axis2.version}.mar"
378+
overwrite="true"/>
378379
<unzip src="${project.build.directory}/axis2-json-api-0.0.1-SNAPSHOT.war" dest="${project.build.directory}/exploded"/>
379380
<jar jarfile="${project.build.directory}/exploded/WEB-INF/services/Login.aar">
380381
<metainf file="resources-axis2/login_resources/services.xml"/>
@@ -393,7 +394,8 @@
393394
<!-- Create openapi module archive for exploded WEB-INF/modules -->
394395
<mkdir dir="${project.build.directory}/exploded/WEB-INF/modules"/>
395396
<copy file="${settings.localRepository}/org/apache/axis2/axis2-openapi/${axis2.version}/axis2-openapi-${axis2.version}.jar"
396-
tofile="${project.build.directory}/exploded/WEB-INF/modules/openapi-${axis2.version}.mar"/>
397+
tofile="${project.build.directory}/exploded/WEB-INF/modules/openapi-${axis2.version}.mar"
398+
overwrite="true"/>
397399
</target>
398400
</configuration>
399401
<goals>

0 commit comments

Comments
 (0)