[ 
https://issues.apache.org/jira/browse/MNG-8222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17876249#comment-17876249
 ] 

ASF GitHub Bot commented on MNG-8222:
-------------------------------------

cstamas commented on code in PR #1679:
URL: https://github.com/apache/maven/pull/1679#discussion_r1728889706


##########
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 like type safe things, so added "proto session"





> 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)

Reply via email to