Skip to content

fix(build): merge duplicate maven-antrun-plugin declarations - #435

Merged
bjagg merged 1 commit into
uPortal-Project:masterfrom
bjagg:fix/merge-duplicate-antrun
Nov 13, 2026
Merged

bjagg merged 1 commit into
uPortal-Project:masterfrom
bjagg:fix/merge-duplicate-antrun

Conversation

@bjagg

@bjagg bjagg commented Nov 13, 2026

Copy link
Copy Markdown
Member

Problem

pom.xml declares org.apache.maven.plugins:maven-antrun-plugin twice: one block for the schema-create (db-init) execution and a second for data-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:

[ERROR] '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
[ERROR] The build could not read 1 project

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.json change 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 two maven-antrun-plugin declarations into one.
    • schema-create, data-import and data-export now sit under a single <executions>.
    • The union of both plugin dependency sets — 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:

Result
mvn -N validate on master fails with the duplicate-declaration error above
mvn -N validate with this change BUILD SUCCESS
mvn -B package with this change BUILD SUCCESS, all tests passing

I also diffed the full list of <id> values before and after to confirm no execution was dropped, and verified the resulting pom.xml parses.

Notes

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.
@bjagg
bjagg merged commit 283b39a into uPortal-Project:master Nov 13, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant