Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The project builder should be given the correct system properties #75

Merged
merged 1 commit into from
Jul 11, 2024

Conversation

gnodet
Copy link
Contributor

@gnodet gnodet commented Jul 10, 2024

The project builder must be given the correct system properties
in order to be able to properly compute profile activation.
See apache/maven#1603

Copy link
Member

@michael-o michael-o left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have checked other mojos and plugins, they seem clean, but looking at that code why not this directly:

diff --git a/src/main/java/org/apache/maven/report/projectinfo/IndexReport.java b/src/main/java/org/apache/maven/report/projectinfo/IndexReport.java
index 8c15bf2..b079705 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/IndexReport.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/IndexReport.java
@@ -30,0 +31 @@ import org.apache.maven.project.ProjectBuilder;
+import org.apache.maven.project.ProjectBuildingRequest;
@@ -68,0 +70 @@ public class IndexReport extends AbstractProjectInfoReport {
+                getSession().getProjectBuildingRequest(),
@@ -108,0 +111 @@ public class IndexReport extends AbstractProjectInfoReport {
+                ProjectBuildingRequest buildingRequest,
@@ -117 +120 @@ public class IndexReport extends AbstractProjectInfoReport {
-            super(sink, project, reactorProjects, projectBuilder, localRepository, i18n, locale, log, siteTool);
+            super(sink, project, reactorProjects, projectBuilder, buildingRequest, localRepository, i18n, locale, log, siteTool);
diff --git a/src/main/java/org/apache/maven/report/projectinfo/ModulesReport.java b/src/main/java/org/apache/maven/report/projectinfo/ModulesReport.java
index 15854ff..a173cde 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/ModulesReport.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/ModulesReport.java
@@ -69,0 +70 @@ public class ModulesReport extends AbstractProjectInfoReport {
+                        getSession().getProjectBuildingRequest(),
@@ -104,0 +106,2 @@ public class ModulesReport extends AbstractProjectInfoReport {
+        protected ProjectBuildingRequest buildingRequest;
+
@@ -113,0 +117 @@ public class ModulesReport extends AbstractProjectInfoReport {
+                ProjectBuildingRequest buildingRequest,
@@ -123,0 +128 @@ public class ModulesReport extends AbstractProjectInfoReport {
+            this.buildingRequest = buildingRequest;
@@ -160 +165 @@ public class ModulesReport extends AbstractProjectInfoReport {
-            ProjectBuildingRequest buildingRequest = new DefaultProjectBuildingRequest();
+            ProjectBuildingRequest buildingRequest = new DefaultProjectBuildingRequest(this.buildingRequest);

@michael-o
Copy link
Member

I have created the appropriate JIRA issue for this. Please update the PR.
Link: https://issues.apache.org/jira/browse/MPIR-466

@michael-o
Copy link
Member

Let me know how to process with my proposed patch. I would create a release today for this.

michael-o pushed a commit to gnodet/maven-project-info-reports-plugin that referenced this pull request Jul 11, 2024
michael-o pushed a commit to gnodet/maven-project-info-reports-plugin that referenced this pull request Jul 11, 2024
@asfgit asfgit merged commit 67ecd33 into apache:master Jul 11, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants