Skip to content

Commit 66042fc

Browse files
Fix maven-release-plugin to inherit module filters in forked Maven invocations (#358)
Co-authored-by: Thomas Turrell-Croft <thomasturrell@users.noreply.github.com>
1 parent 00558e6 commit 66042fc

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

.github/workflows/maven-publish.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ jobs:
3232
git config user.name "github-actions[bot]"
3333
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
3434
# Only release production modules, exclude all sample modules
35-
mvn -B -pl xapi-model,xapi-client,xapi-model-spring-boot-starter -am -batch-mode release:prepare release:perform --file pom.xml
35+
# Pass -pl/-am to forked Maven invocations via -Darguments
36+
mvn -B -batch-mode release:prepare release:perform --file pom.xml \
37+
-Darguments="-pl xapi-model,xapi-client,xapi-model-spring-boot-starter -am"
3638
env:
3739
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
3840
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}

.github/workflows/release.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,12 @@ jobs:
9595
# Run release:prepare with explicit release version
9696
# Maven will automatically calculate the next development version
9797
# Only prepare production modules, exclude all sample modules
98-
./mvnw -B -pl xapi-model,xapi-client,xapi-model-spring-boot-starter -am release:prepare \
98+
# Pass -pl/-am to forked Maven invocations via -Darguments
99+
./mvnw -B release:prepare \
99100
-DreleaseVersion="${VERSION}" \
100101
-Dtag="${TAG_NAME}" \
101-
-DpushChanges=false
102+
-DpushChanges=false \
103+
-Darguments="-pl xapi-model,xapi-client,xapi-model-spring-boot-starter -am"
102104
env:
103105
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
104106
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
@@ -110,9 +112,11 @@ jobs:
110112
111113
# Run release:perform to build and deploy
112114
# Only release production modules, exclude all sample modules
113-
./mvnw -B -pl xapi-model,xapi-client,xapi-model-spring-boot-starter -am release:perform \
115+
# Pass -pl/-am to forked Maven invocations via -Darguments
116+
./mvnw -B release:perform \
114117
-DlocalCheckout=true \
115-
-DeployAtEnd=true
118+
-DeployAtEnd=true \
119+
-Darguments="-pl xapi-model,xapi-client,xapi-model-spring-boot-starter -am"
116120
env:
117121
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
118122
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}

0 commit comments

Comments
 (0)