karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (KARAF-5585) Verify mojo configure pax-url-mvn with non existent settings.xml
Date Wed, 31 Jan 2018 14:00:00 GMT

    [ https://issues.apache.org/jira/browse/KARAF-5585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16346865#comment-16346865
] 

ASF GitHub Bot commented on KARAF-5585:
---------------------------------------

splatch closed pull request #439: KARAF-5585 Do not provide maven settings for pax url if
they are gone.
URL: https://github.com/apache/karaf/pull/439
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/VerifyMojo.java
b/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/VerifyMojo.java
index 69b4a70014..1bfb8a7cdf 100644
--- a/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/VerifyMojo.java
+++ b/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/VerifyMojo.java
@@ -188,7 +188,11 @@ public void execute() throws MojoExecutionException, MojoFailureException
{
         getLog().info("Using repositories: " + remote.toString());
         config.put("maven.repositories", remote.toString());
         config.put("maven.localRepository", localRepo.getBasedir());
-        config.put("maven.settings", mavenSession.getRequest().getUserSettingsFile().toString());
+
+        if (mavenSession.getRequest().getUserSettingsFile().exists()) {
+            config.put("maven.settings", mavenSession.getRequest().getUserSettingsFile().toString());
+        }
+
         // TODO: add more configuration bits ?
         resolver = MavenResolvers.createMavenResolver(config, "maven");
         doExecute();
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 dd415cf1d4..0c2f4fa463 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,14 +129,6 @@ public MavenProjectHelper getProjectHelper() {
     // 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,


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Verify mojo configure pax-url-mvn with non existent settings.xml
> ----------------------------------------------------------------
>
>                 Key: KARAF-5585
>                 URL: https://issues.apache.org/jira/browse/KARAF-5585
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-tooling
>    Affects Versions: 4.1.4, 4.2.0.M1
>            Reporter: Łukasz Dywicki
>            Assignee: Łukasz Dywicki
>            Priority: Major
>             Fix For: 4.1.5, 4.2.0.M2
>
>
> Current verify mojo logic does not verify if user settings passed to pax-url handler
are valid at all. This may lead to situation that Aether Resolver gets invalid settings -
instead of proper global settings from maven installation it does use user settings which
are gone.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message