Skip to content

Honor the mavenProjectId attribute in DependencyFilesetsTask (#371) - #378

Open
elharo wants to merge 2 commits into
masterfrom
fix-371-dependencyfilesets-mavenprojectid
Open

Honor the mavenProjectId attribute in DependencyFilesetsTask (#371)#378
elharo wants to merge 2 commits into
masterfrom
fix-371-dependencyfilesets-mavenprojectid

Conversation

@elharo

@elharo elharo commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Fixes #371

Summary

DependencyFilesetsTask ignored the mavenProjectId attribute: the existence check used the configurable field, but the project lookup used a hardcoded "maven.project" reference. Setting mavenProjectId to anything other than the default was silently ignored, and invoking the task standalone (without the maven.project reference registered by AntRunMojo) threw an NPE.

Changes

  • DependencyFilesetsTask.java: look up the MavenProject via the configured mavenProjectId reference instead of the hardcoded "maven.project" string.
  • New unit test DependencyFilesetsTaskTest with two cases:
    • honorsConfiguredMavenProjectId — when both the default and a custom project reference exist, the custom one is used.
    • worksWithoutDefaultMavenProjectReference — the task works standalone with a custom mavenProjectId, instead of throwing an NPE.

Verification

  • Both tests fail on unpatched master (NPE on the hardcoded reference; custom attribute ignored) and pass with the fix.
  • mvn verify (rat, checkstyle, spotless, unit tests, javadoc) passes.
  • mvn verify -Prun-its passes: all 29 integration tests succeed.

@elharo elharo added the bug Something isn't working label Aug 5, 2026
@elharo
elharo requested a review from slawekjaranowski August 6, 2026 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dependencyfilesets ignores the mavenProjectId attribute (hardcoded 'maven.project' reference)

1 participant