[tycho] Return non-existant expected local path when resolution fails.

Roland Grunberg rgrunber at fedoraproject.org
Wed Jul 2 17:34:04 UTC 2014


commit b41d1a76465567eb1c989b894cb16846d33c9082
Author: Roland Grunberg <rgrunber at redhat.com>
Date:   Wed Jul 2 12:33:45 2014 -0400

    Return non-existant expected local path when resolution fails.
    
    - Resolves: rhbz#1114120

 tycho-maven-delegation.patch |   26 +++++++++++++++-----------
 tycho.spec                   |    6 +++++-
 2 files changed, 20 insertions(+), 12 deletions(-)
---
diff --git a/tycho-maven-delegation.patch b/tycho-maven-delegation.patch
index e41d1d4..c337db9 100644
--- a/tycho-maven-delegation.patch
+++ b/tycho-maven-delegation.patch
@@ -1,4 +1,4 @@
-From 0a635ab621a72f9911d159e93cd18c92c4a27b8b Mon Sep 17 00:00:00 2001
+From 3fac4c5513d3bf5c1ba1d625f3d0cba9d63feff2 Mon Sep 17 00:00:00 2001
 From: Roland Grunberg <rgrunber at redhat.com>
 Date: Wed, 18 Jun 2014 13:01:31 -0400
 Subject: [PATCH] Tycho should always delegate artifact resolution to Maven.
@@ -34,12 +34,12 @@ Change-Id: Ib6453720b46f64ae87dfabf829df8fad38d0cedc
  .../p2/target/PomDependencyCollectorImpl.java      |  2 +-
  .../p2/target/TargetPlatformBundlePublisher.java   | 15 ++++---
  .../p2/repository/LocalRepositoryP2Indices.java    |  4 ++
- .../tycho/p2/repository/LocalRepositoryReader.java | 52 +++-------------------
+ .../tycho/p2/repository/LocalRepositoryReader.java | 52 +++++-----------------
  .../local/testutil/MavenRepositorySystemStub.java  | 30 +++++++++++++
  .../testutil/TemporaryLocalMavenRepository.java    |  3 +-
  .../adapters/MavenRepositorySystemAdapter.java     | 37 +++++++++++++++
  .../configuration/MavenContextConfigurator.java    |  8 +++-
- 23 files changed, 163 insertions(+), 70 deletions(-)
+ 23 files changed, 167 insertions(+), 66 deletions(-)
  create mode 100644 tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/facade/MavenRepositorySystem.java
  create mode 100644 tycho-bundles/org.eclipse.tycho.test.utils/src/main/java/org/eclipse/tycho/repository/local/testutil/MavenRepositorySystemStub.java
  create mode 100644 tycho-core/src/main/java/org/eclipse/tycho/osgi/adapters/MavenRepositorySystemAdapter.java
@@ -484,10 +484,10 @@ index 2122578..54c46fc 100644
 +
  }
 diff --git a/tycho-bundles/org.eclipse.tycho.p2.resolver.shared/src/main/java/org/eclipse/tycho/p2/repository/LocalRepositoryReader.java b/tycho-bundles/org.eclipse.tycho.p2.resolver.shared/src/main/java/org/eclipse/tycho/p2/repository/LocalRepositoryReader.java
-index b5c8c55..8091db6 100644
+index b5c8c55..64dac9c 100644
 --- a/tycho-bundles/org.eclipse.tycho.p2.resolver.shared/src/main/java/org/eclipse/tycho/p2/repository/LocalRepositoryReader.java
 +++ b/tycho-bundles/org.eclipse.tycho.p2.resolver.shared/src/main/java/org/eclipse/tycho/p2/repository/LocalRepositoryReader.java
-@@ -11,57 +11,19 @@
+@@ -11,57 +11,27 @@
  package org.eclipse.tycho.p2.repository;
  
  import java.io.File;
@@ -498,12 +498,12 @@ index b5c8c55..8091db6 100644
  
  public class LocalRepositoryReader implements RepositoryReader {
  
--    private final File localMavenRepositoryRoot;
+     private final File localMavenRepositoryRoot;
 +    private final MavenRepositorySystem repositorySystem;
  
 -    public LocalRepositoryReader(File localMavenRepositoryRoot) {
--        this.localMavenRepositoryRoot = localMavenRepositoryRoot;
 +    public LocalRepositoryReader(File localMavenRepositoryRoot, MavenRepositorySystem repositorySystem) {
+         this.localMavenRepositoryRoot = localMavenRepositoryRoot;
 +        this.repositorySystem = repositorySystem;
      }
  
@@ -544,12 +544,16 @@ index b5c8c55..8091db6 100644
 -                }
 -            } catch (Exception e) {
 -                e.printStackTrace();
--            }
--        }
++        File ret = new File(localMavenRepositoryRoot, RepositoryLayoutHelper.getRelativePath(gav, classifier, extension));
++        if (repositorySystem != null) {
++            File tmp = repositorySystem.resolve(gav.getGroupId(), gav.getArtifactId(), gav.getVersion(), extension, classifier);
++            if (tmp != null) {
++                ret = tmp;
+             }
+         }
 -        return file;
 -
-+        return repositorySystem != null ? repositorySystem.resolve(gav.getGroupId(), gav.getArtifactId(),
-+                gav.getVersion(), extension, classifier) : null;
++        return ret;
      }
  }
 diff --git a/tycho-bundles/org.eclipse.tycho.test.utils/src/main/java/org/eclipse/tycho/repository/local/testutil/MavenRepositorySystemStub.java b/tycho-bundles/org.eclipse.tycho.test.utils/src/main/java/org/eclipse/tycho/repository/local/testutil/MavenRepositorySystemStub.java
diff --git a/tycho.spec b/tycho.spec
index 79d7649..64f992f 100644
--- a/tycho.spec
+++ b/tycho.spec
@@ -19,7 +19,7 @@
 
 Name:           tycho
 Version:        0.20.0
-Release:        16%{?dist}
+Release:        17%{?dist}
 Summary:        Plugins and extensions for building Eclipse plugins and OSGI bundles with Maven
 
 Group:          Development/Libraries
@@ -343,6 +343,10 @@ install -m 644 $osgiStateJarPath $RPM_BUILD_ROOT%{_javadir}/%{name}/osgi.compati
 %{_javadocdir}/%{name}
 
 %changelog
+* Wed Jul 02 2014 Roland Grunberg <rgrunber at redhat.com> - 0.20.0-17
+- Return non-existant expected local path when resolution fails.
+- Resolves: rhbz#1114120
+
 * Fri Jun 27 2014 Roland Grunberg <rgrunber at redhat.com> - 0.20.0-16
 - Tycho should always delegate artifact resolution to Maven.
 


More information about the scm-commits mailing list