apache / apache/maven

[MNG-8543] Clarify profiles usage

Open
#10,687 0 comments 0 reactions 0 assignees View on GitHub
maintenance priority:major
Dominant language
Java
Stars
5.3k
Forks
3.1k
Avg merge
21h 11m
Merged PRs (30d)
312

Description

**[Guillaume Nodet](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=gnt)** opened **[MNG-8543](https://issues.apache.org/jira/browse/MNG-8543?redirect=false)** and commented

Profiles are mostly used at built time.

However, there are some use cases for profiles being used at runtime. An example is the `javafx` POM which have a profile used to add a dependency based on the OS name / architecture.

At the same time, file based profiles are also tested when building models for dependencies.  This does not make any sense and should be forbidden.

Properties-based profiles should also be more tightly controlled as leaking properties to the consumed model can lead to unexpected model changes.

The ModelBuilderRequest now has more context, and we do know if we are constructing a built time model or a consumer model (see https://github.com/apache/maven/blob/maven-4.0.0-rc-2/api/maven-api-core/src/main/java/org/apache/maven/api/services/ModelBuilderRequest.java#L59-L71).  So maybe we should restrict a bit more what we do here ?

---
No further details from [MNG-8543](https://issues.apache.org/jira/browse/MNG-8543?redirect=false)

Contributor guide

Open the contributing guide

Research direction

Start with api/maven-api-core/src/main/java/org/apache/maven/api/services/ModelBuilderRequest.java, especially the context described at lines 59-71, then trace where profiles are processed during model construction. The issue names no implementation files or tests; done would require agreed rules for build-time versus consumer-model profiles and verification of the resulting behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.