Skip to content

Commit

Permalink
fix(install): force system properties in build request
Browse files Browse the repository at this point in the history
  • Loading branch information
rbioteau committed Dec 2, 2024
1 parent 0386e06 commit 77ca4f6
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
12 changes: 12 additions & 0 deletions plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,18 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.sisu</groupId>
<artifactId>sisu-maven-plugin</artifactId>
<executions>
<execution>
<id>generate-index</id>
<goals>
<goal>main-index</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public class InstallProjectStoreMojo extends AbstractMojo {
private static final String VERSION = "version";
private static final String ARTIFACT_ID = "artifactId";

static final String DEFAULT_INSTALL_PLUGIN_VERSION = "3.1.1";
static final String DEFAULT_INSTALL_PLUGIN_VERSION = "3.1.3";
static final String INITIAL_INSTALL_PLUGIN_VERSION = "2.4";
private static final String INSTALL_PLUGIN_GROUP_ID = "org.apache.maven.plugins";
private static final String INSTALL_PLUGIN_ARTIFACT_ID = "maven-install-plugin";
Expand Down Expand Up @@ -353,6 +353,7 @@ MavenExecutionRequest newInstallFileExecutionRequest(Artifact artifact,
INSTALL_PLUGIN_ARTIFACT_ID,
installPluginVersion)));
executionRequest.setLocalRepository(localRepository);
executionRequest.setSystemProperties(System.getProperties());
Properties installFileProperties = new Properties();
installFileProperties.setProperty(GROUP_ID, artifact.getGroupId());
installFileProperties.setProperty(ARTIFACT_ID, artifact.getArtifactId());
Expand Down Expand Up @@ -387,6 +388,7 @@ private ProjectBuildingRequest newResolveArtifactProjectBuildingRequest() {
ProjectBuildingRequest buildingRequest = new DefaultProjectBuildingRequest(session.getProjectBuildingRequest());

buildingRequest.setRemoteRepositories(remoteRepositories);
buildingRequest.setSystemProperties(System.getProperties());

return buildingRequest;
}
Expand Down
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
<spotless-maven-plugin.version>2.38.0</spotless-maven-plugin.version>
<gitflow-maven-plugin.version>1.20.0</gitflow-maven-plugin.version>
<versions-maven-plugin.version>2.16.0</versions-maven-plugin.version>
<sisu-maven-plugin.version>0.3.5</sisu-maven-plugin.version>
<!-- Test -->
<junit-jupiter-engine.version>5.10.0</junit-jupiter-engine.version>
<junit-platform-runner.version>1.7.0</junit-platform-runner.version>
Expand Down Expand Up @@ -199,6 +200,11 @@
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.sisu</groupId>
<artifactId>sisu-maven-plugin</artifactId>
<version>${sisu-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
Expand Down

0 comments on commit 77ca4f6

Please sign in to comment.