Repository navigation
fix(build): merge duplicate maven-antrun-plugin declarations - #435
Merged
Merged
Conversation
Problem: pom.xml declares org.apache.maven.plugins:maven-antrun-plugin twice -- once for the schema-create (db-init) execution and again for data-import/data-export. Newer Maven validates this as a hard error, so the POM cannot be read at all: 'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin org.apache.maven.plugins:maven-antrun-plugin @ line 895, column 21 Every open PR against this repo is failing CI on that error, including two-line renovate.json changes that touch no build logic. Goal: make the POM readable by current Maven without changing what any execution does. Changes: - pom.xml: merge the two maven-antrun-plugin declarations into one. schema-create, data-import and data-export now sit under a single <executions>, and the union of both plugin dependency sets (javax.servlet-api, portlet-api, rhino:js) under a single <dependencies>. Notes: mirrors the fix applied to NewsReaderPortlet in #449. Those were the only two repos in the organization whose root pom.xml carried a duplicate antrun declaration. No GitHub issue exists for this -- it was found while diagnosing why unrelated PRs in this repo were red. Verified on Maven 3.10.0 / Java 11: mvn -N validate fails on upstream/master with the error above and succeeds with this change; mvn -B package is BUILD SUCCESS with all tests passing.
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
pom.xmldeclaresorg.apache.maven.plugins:maven-antrun-plugintwice: one block for theschema-create(db-init) execution and a second fordata-import/data-export.Maven 3 tolerated this as a warning. Current Maven validates it as a hard error, so the POM cannot be read at all:
This is currently failing CI on every open PR in this repo, including ones that touch no build logic at all — #430 is a two-line
renovate.jsonchange and is red for this reason. #414 and #423 are failing on the same error.Goal
Make the POM readable by current Maven without changing what any execution does.
Change
pom.xml: merge the twomaven-antrun-plugindeclarations into one.schema-create,data-importanddata-exportnow sit under a single<executions>.javax.servlet-api,portlet-api:2.0,rhino:js:1.7R2— sits under a single<dependencies>.No behavior change: the same three executions on the same custom phases, with the same plugin classpath.
Verification
On Maven 3.10.0 / Java 11:
mvn -N validateonmastermvn -N validatewith this changeBUILD SUCCESSmvn -B packagewith this changeBUILD SUCCESS, all tests passingI also diffed the full list of
<id>values before and after to confirm no execution was dropped, and verified the resultingpom.xmlparses.Notes
pom.xmlcarried a duplicate antrun declaration — I swept them all.