This is an automated email from the ASF dual-hosted git repository.

ldywicki pushed a commit to branch karaf-4.0.x
in repository https://gitbox.apache.org/repos/asf/karaf.git


The following commit(s) were added to refs/heads/karaf-4.0.x by this push:
     new f0c396c  KARAF-5994 karaf-maven-plugin use user supplied settings.xml
f0c396c is described below

commit f0c396cede58acbee98041abde7de4e315b36dca
Author: Paul Campbell <paul.campb...@cloudsoft.io>
AuthorDate: Fri Sep 28 16:49:20 2018 +0100

    KARAF-5994 karaf-maven-plugin use user supplied settings.xml
---
 .../src/main/java/org/apache/karaf/tooling/utils/MojoSupport.java | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git 
a/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/utils/MojoSupport.java
 
b/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/utils/MojoSupport.java
index 6794f8b..a77d8cd 100644
--- 
a/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/utils/MojoSupport.java
+++ 
b/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/utils/MojoSupport.java
@@ -129,6 +129,14 @@ public abstract class MojoSupport extends AbstractMojo {
     // called by Plexus when injecting the mojo's session
     public void setMavenSession(MavenSession mavenSession) {
         this.mavenSession = mavenSession;
+
+        if (mavenSession != null) {
+            // check for custom settings.xml and pass it onto pax-url-aether
+            File settingsFile = 
mavenSession.getRequest().getUserSettingsFile();
+            if (settingsFile != null && settingsFile.isFile()) {
+                System.setProperty("org.ops4j.pax.url.mvn.settings", 
settingsFile.getPath());
+            }
+        }
     }
 
     protected Map createManagedVersionMap(String projectId,

Reply via email to