Skip to content

Commit c522335

Browse files
michaeloffnerclaude
andcommitted
fix CI build: effective.goal defaults to install when -Dgoal not passed
When mvn runs without -Dgoal, Maven passes the literal string "${goal}" to Ant, bypassing the default property. Rewrote the goal logic to use Ant property immutability: set effective.goal=deploy only when is.deploy is true and artifact doesn't already exist on Central, then fall through to install as the unconditional default. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent e6ca1fb commit c522335

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

build.xml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
Build EHCache Extension
55
</description>
66

7-
<!-- default goal when not passed by Maven (e.g. local mvn package run) -->
8-
<property name="maven.goal" value="install"/>
9-
107
<property name="srcCFML" location="source/CFML/src"/>
118
<property name="srcImg" location="source/images"/>
129
<property name="temp" location="temp"/>
@@ -30,19 +27,26 @@
3027
<equals arg1="${maven.goal}" arg2="deploy"/>
3128
</condition>
3229

33-
<!-- Check if artifact already exists in Maven Central -->
30+
<!-- Check if artifact already exists in Maven Central (only relevant when deploying) -->
3431
<condition property="artifact.exists">
3532
<and>
3633
<equals arg1="${is.deploy}" arg2="true"/>
3734
<http url="https://repo1.maven.org/maven2/${mvnGroupPath}/${mvnArtifactId}/${bundleversion}/${mvnArtifactId}-${bundleversion}.pom"/>
3835
</and>
3936
</condition>
4037

41-
<!-- Set effective goal based on whether artifact exists -->
42-
<!-- if artifact already on Central, downgrade to install to avoid re-deploying -->
43-
<condition property="effective.goal" value="install" else="${maven.goal}">
44-
<istrue value="${artifact.exists}"/>
38+
<!--
39+
effective.goal logic:
40+
- deploy requested AND artifact not yet on Central → deploy
41+
- anything else (package, install, unresolved ${goal}, artifact already exists) → install
42+
-->
43+
<condition property="effective.goal" value="deploy">
44+
<and>
45+
<equals arg1="${is.deploy}" arg2="true"/>
46+
<not><istrue value="${artifact.exists}"/></not>
47+
</and>
4548
</condition>
49+
<property name="effective.goal" value="install"/>
4650

4751
<echo>goal:${maven.goal}</echo>
4852
<echo>effective.goal:${effective.goal}</echo>

0 commit comments

Comments
 (0)