apache / apache/maven-enforcer

[MENFORCER-518] RequirePluginVersions fails for plugins in profiles when using properties

Open
#870 0 comments 0 reactions 0 assignees View on GitHub
bug priority:major
Dominant language
Java
Stars
161
Forks
180
Avg merge
1d 20m
Merged PRs (30d)
8

Description

**[Juan Farré](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=JIRAUSER308727)** opened **[MENFORCER-518](https://issues.apache.org/jira/browse/MENFORCER-518?redirect=false)** and commented

I defined a plugin inside a profile, using a property for the artifactId.

See [^pom.xml]

I got the following error:

!error3.9.9.PNG!

This was with Maven 3.9.9 and it also fails with Maven 4.0.0-rc-2:

!error4.0.0.PNG!

The problem was reproduced with versions 3.0.0 and 3.5.0 of the plugin.

With version 1.4.1 it also fails, even though it reports the correct version:

!error1.4.1.PNG!

It's also worth mentioning that there doesn't seem to be any problem when you specify the version using a property, only when you specify the artifactId with a property.

 

---

**Affects:** 1.4.1, 3.0.0, 3.5.0

**Attachments:**
- [error1.4.1.PNG](https://issues.apache.org/jira/secure/attachment/13074849/error1.4.1.PNG) (_27.63 kB_)
- [error3.9.9.PNG](https://issues.apache.org/jira/secure/attachment/13074851/error3.9.9.PNG) (_34.46 kB_)
- [error4.0.0.PNG](https://issues.apache.org/jira/secure/attachment/13074850/error4.0.0.PNG) (_35.78 kB_)
- [pom.xml](https://issues.apache.org/jira/secure/attachment/13074852/pom.xml) (_2.69 kB_)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the attached pom.xml and reproduce the RequirePluginVersions failure for a plugin inside a profile whose artifactId uses a property, using the Maven and plugin versions listed in the report. Trace the rule's handling of the profile and property; done means the valid configuration is accepted, while version properties continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.