You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
dependencyfilesets ignores the mavenProjectId attribute (hardcoded 'maven.project' reference) #371
DependencyFilesetsTask ignores the mavenProjectId attribute: the null-check uses the configurable field, but the actual lookup uses a hardcoded getReference("maven.project"). Setting mavenProjectId to anything other than the default breaks the task, and using the task outside the antrun mojo causes an NPE.
if (this.getProject().getReference(mavenProjectId) == null) {
thrownewBuildException("Maven project reference not found: " + mavenProjectId);
}
MavenProjectmavenProject = this.getProject().getReference("maven.project");
Problem
Two inconsistencies:
The existence check at line 54 uses the configurable mavenProjectId field, but the project is then fetched with the hardcoded "maven.project" reference at line 58. Setting mavenProjectId to any non-default value therefore either throws a spurious Maven project reference not found: <id> (when that id is not a registered reference), or is silently ignored and the default project is used anyway.
The hardcoded "maven.project" reference is only registered by the AntRunMojo. If the task is invoked standalone (e.g. from an external build.xml via the <ant> task), the reference is null and line 61 mavenProject.getArtifacts() throws an NPE.
Result: BuildException: Maven project reference not found: nonexistent.ref, although the default maven.project reference exists.
Expected behavior
The attribute should either be honored consistently (both check and lookup) or removed; the lookup should not silently depend on a hardcoded reference id.
Activity