You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2022/10/05 20:01:25 UTC

[GitHub] [maven] pzygielo opened a new pull request, #809: Consider inactive profiles for validation

pzygielo opened a new pull request, #809:
URL: https://github.com/apache/maven/pull/809

   I propose this cosmetic (key change is in new line 485, two other changes - CS:LineLength).
   This allows to deactivate profiles from settings and from pom with the same id, and avoid confusing warning:
   ```
   $ mvn -P \!XYZ verify
   ...
   [WARNING] The requested profile "XYZ" could not be activated because it does not exist.
   ...
   ```
   
   Similar issues
   - MNG-7211 (done in unspecified version, while MNG-7051 fixed in v4)
   
   --- 
   
   Following this checklist to help us incorporate your
   contribution quickly and easily:
   
    - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/MNG) filed
          for the change (usually before you start working on it).  Trivial changes like typos do not
          require a JIRA issue. Your pull request should address just this issue, without
          pulling in other changes.
    - [ ] Each commit in the pull request should have a meaningful subject line and body.
    - [ ] Format the pull request title like `[MNG-XXX] SUMMARY`, where you replace `MNG-XXX`
          and `SUMMARY` with the appropriate JIRA issue. Best practice is to use the JIRA issue
          title in the pull request title and in the first line of the commit message.
    - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
    - [ ] Run `mvn clean verify` to make sure basic checks pass. A more thorough check will
          be performed on your pull request automatically.
    - [ ] You have run the [Core IT][core-its] successfully.
   
   If your pull request is about ~20 lines of code you don't need to sign an
   [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure
   please ask on the developers list.
   
   To make clear that you license your contribution under
   the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   you have to acknowledge this by using the following check-box.
   
    - [ ] I hereby declare this contribution to be licenced under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   
    - [ ] In any other case, please file an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   [core-its]: https://maven.apache.org/core-its/core-it-suite/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] pzygielo commented on pull request #809: Consider inactive profiles for validation

Posted by GitBox <gi...@apache.org>.
pzygielo commented on PR #809:
URL: https://github.com/apache/maven/pull/809#issuecomment-1273440622

   > Can you verify what the behaviour is for Maven 4? 
   
   Using maven 4 (2a9f39336cec1d8e52d30cc48503d51ed8672536) it works fine - build succeeds and does not complain about missing profile. 
   
   > Perhaps we have already solved this in a similar way.
   
   I think there is no similar change needed there.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] pzygielo commented on a diff in pull request #809: Consider inactive profiles for validation

Posted by GitBox <gi...@apache.org>.
pzygielo commented on code in PR #809:
URL: https://github.com/apache/maven/pull/809#discussion_r991376962


##########
maven-core/src/main/java/org/apache/maven/DefaultMaven.java:
##########
@@ -466,7 +468,9 @@ private void validatePrerequisitesForNonMavenPluginProjects( List<MavenProject>
         }
     }
 
-    private void validateActivatedProfiles( List<MavenProject> projects, List<String> activeProfileIds )
+    private void validateActivatedProfiles( List<MavenProject> projects,
+                                            List<String> activeProfileIds,
+                                            List<String> inactiveProfiles )

Review Comment:
   I followed the name of method used in the call. I agree that local naming style should be preserved here - will update that.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] MartinKanters commented on a diff in pull request #809: Consider inactive profiles for validation

Posted by GitBox <gi...@apache.org>.
MartinKanters commented on code in PR #809:
URL: https://github.com/apache/maven/pull/809#discussion_r991365450


##########
maven-core/src/main/java/org/apache/maven/DefaultMaven.java:
##########
@@ -466,7 +468,9 @@ private void validatePrerequisitesForNonMavenPluginProjects( List<MavenProject>
         }
     }
 
-    private void validateActivatedProfiles( List<MavenProject> projects, List<String> activeProfileIds )
+    private void validateActivatedProfiles( List<MavenProject> projects,
+                                            List<String> activeProfileIds,
+                                            List<String> inactiveProfiles )

Review Comment:
   Let's name this inactiveProfileIds for consistency



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] pzygielo commented on a diff in pull request #809: Consider inactive profiles for validation

Posted by GitBox <gi...@apache.org>.
pzygielo commented on code in PR #809:
URL: https://github.com/apache/maven/pull/809#discussion_r992288862


##########
maven-core/src/main/java/org/apache/maven/DefaultMaven.java:
##########
@@ -466,7 +468,9 @@ private void validatePrerequisitesForNonMavenPluginProjects( List<MavenProject>
         }
     }
 
-    private void validateActivatedProfiles( List<MavenProject> projects, List<String> activeProfileIds )
+    private void validateActivatedProfiles( List<MavenProject> projects,
+                                            List<String> activeProfileIds,
+                                            List<String> inactiveProfiles )

Review Comment:
   This has been implemented.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] MartinKanters merged pull request #809: [MNG-7568] Consider inactive profiles for validation

Posted by GitBox <gi...@apache.org>.
MartinKanters merged PR #809:
URL: https://github.com/apache/maven/pull/809


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] pzygielo commented on pull request #809: [MNG-7568] Consider inactive profiles for validation

Posted by GitBox <gi...@apache.org>.
pzygielo commented on PR #809:
URL: https://github.com/apache/maven/pull/809#issuecomment-1288908714

   Here is similar 
   - https://github.com/apache/maven/pull/850
   
   for 3.9.x.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] pzygielo commented on pull request #809: [MNG-7568] Consider inactive profiles for validation

Posted by GitBox <gi...@apache.org>.
pzygielo commented on PR #809:
URL: https://github.com/apache/maven/pull/809#issuecomment-1279324333

   > I think we should create a very small unit/IT for the sake of regression testing.
   
   Here it is:
   - https://github.com/apache/maven-integration-testing/pull/205
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] pzygielo commented on pull request #809: [MNG-7568] Consider inactive profiles for validation

Posted by GitBox <gi...@apache.org>.
pzygielo commented on PR #809:
URL: https://github.com/apache/maven/pull/809#issuecomment-1288089277

   > This does not appear in master or 3.9.x?
   
   if (this == this issue) - no such problem in master.
   Never heard of maven 3.9.x.
   
   if (this == this change) - not proposed for master as there is no such problem.
   I didn't test with maven 3.9.x. Feel free to pick this there is there is need.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] michael-o commented on pull request #809: [MNG-7568] Consider inactive profiles for validation

Posted by GitBox <gi...@apache.org>.
michael-o commented on PR #809:
URL: https://github.com/apache/maven/pull/809#issuecomment-1288087207

   This does not appear in master or 3.9.x?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] MartinKanters commented on pull request #809: Consider inactive profiles for validation

Posted by GitBox <gi...@apache.org>.
MartinKanters commented on PR #809:
URL: https://github.com/apache/maven/pull/809#issuecomment-1273421800

   I think it's a nice change, but I'm not sure if it's fully compatible with the changes we did in master (for Maven 4). Can you verify what the behaviour is for Maven 4? Perhaps we have already solved this in a similar way.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org