Bug 495937 - Impossible to override model properties when requesting artifact descriptor
Summary: Impossible to override model properties when requesting artifact descriptor
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Aether (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-11 15:40 EDT by Mantas Indrašius CLA
Modified: 2017-02-23 14:08 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mantas Indrašius CLA 2016-06-11 15:40:09 EDT
So I have a property in my pom model that I want to override by setting userProperties to the session.

Unfortunately this fails due to this line:
https://github.com/apache/maven/blob/3533599e42a4a563abca33a69ed0f34c19815479/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java#L304

So here both user and system properties are merged into 1.

Unfortunately this does not work in here where interpolation sets the model properties 1st, then looking at system props:
https://github.com/apache/maven/blob/d3da8c20903275a64b550c5c481f2ac7d38d0170/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/AbstractStringBasedModelInterpolator.java#L157

User properties are empty here because they were not set in DefaultArtifactDescriptorReader where they are merged to system properties.

I could make a patch/PR if confirmed this is a bug and it would make things faster.