[
https://issues.apache.org/jira/browse/MNG-8222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17876237#comment-17876237
]
ASF GitHub Bot commented on MNG-8222:
-------------------------------------
gnodet commented on code in PR #1679:
URL: https://github.com/apache/maven/pull/1679#discussion_r1728833841
##########
api/maven-api-spi/src/main/java/org/apache/maven/api/spi/PropertyContributor.java:
##########
@@ -33,9 +34,12 @@
@Consumer
public interface PropertyContributor extends SpiService {
/**
- * Invoked just before session is created with a mutable map that carries
collected user properties so far.
+ * Invoked just before session is created.
*
- * @param userProperties The mutable user properties, never {@code null}.
+ * @param systemProperties Immutable map of system properties, never
{@code null}.
+ * @param userProperties Immutable map of user properties, never {@code
null}.
+ * @param topDirectory The path of top directory, never {@code null}.
*/
- void contribute(Map<String, String> userProperties);
+ Map<String, String> contribute(
+ Map<String, String> systemProperties, Map<String, String>
userProperties, Path topDirectory);
Review Comment:
I'd use a `Map<String, String>` for paths, to store all required paths,
similar to
https://github.com/apache/maven/blob/6ac914d6f97517d827f51afa7aaa41e5acdbe023/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java#L620-L626,
as we probably also need the `rootDirectory`.
> Provide more information to PropertyContributors
> ------------------------------------------------
>
> Key: MNG-8222
> URL: https://issues.apache.org/jira/browse/MNG-8222
> Project: Maven
> Issue Type: Improvement
> Components: API
> Affects Versions: 4.0.0-beta-3
> Reporter: Tamas Cservenak
> Priority: Major
> Fix For: 4.0.0-beta-4
>
>
> The property contributor lacks a lot of "contextual" data. It would be better
> if it could:
> * inspect "so far discovered user properties" -- this is OK, they are in the
> passed in map
> * inspect "maven discovered Java System Properties" -- to not touch
> System.getProperty method
> * inspect maybe things like topDirectory, cwd etc?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)