Skip to content

Commit

Permalink
Merge pull request #10741 from aloubyansky/maven-home-property
Browse files Browse the repository at this point in the history
Added maven.settings system property
  • Loading branch information
aloubyansky authored Jul 16, 2020
2 parents b663ebf + 092db1f commit 71cd43e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/src/main/asciidoc/getting-started-testing.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,8 @@ Most IDEs offer the possibility to run a selected class as JUnit test directly.

* `maven.home` (only if there are any custom settings in `${maven.home}/conf/settings.mxl`, see link:maven-tooling[Maven Guide])

* `maven.settings` (in case a custom version of `settings.xml` file should be used for the tests)

=== Eclipse separate JRE definition

Copy your current "Installed JRE" definition into a new one, where you will add the properties as a new VM arguments:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public class BootstrapMavenContext {
private static final String MAVEN_DOT_HOME = "maven.home";
private static final String MAVEN_HOME = "MAVEN_HOME";
private static final String MAVEN_PROJECTBASEDIR = "MAVEN_PROJECTBASEDIR";
private static final String MAVEN_SETTINGS = "maven.settings";
private static final String SETTINGS_XML = "settings.xml";

private static final String userHome = PropertyUtils.getUserHome();
Expand Down Expand Up @@ -145,7 +146,11 @@ public BootstrapMavenContext(BootstrapMavenContextConfig<?> config)
}
userSettings = config.userSettings == null
? resolveSettingsFile(getCliOptions().getOptionValue(BootstrapMavenOptions.ALTERNATE_USER_SETTINGS),
() -> new File(userMavenConfigurationHome, SETTINGS_XML))
() -> {
final String quarkusMavenSettings = PropertyUtils.getProperty(MAVEN_SETTINGS);
return quarkusMavenSettings == null ? new File(userMavenConfigurationHome, SETTINGS_XML)
: new File(quarkusMavenSettings);
})
: config.userSettings;
globalSettings = resolveSettingsFile(getCliOptions().getOptionValue(BootstrapMavenOptions.ALTERNATE_GLOBAL_SETTINGS),
() -> {
Expand Down

0 comments on commit 71cd43e

Please sign in to comment.