Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Building with Tycho offline

I made a small reproducible example project for my own testing and thought I'd share in case it's useful for someone else. Using this bundle I'm able to reproduce the failing issue on build.eclipse.org using Maven 3.0.5 and JDK 1.7.0_25 in /shared/common. I've also attached my Tycho patch with adds the print statement.

Steps I used to reproduce are:

1. mvn clean verify
2. mvn clean verify -o


As for reproducing a working build I'm not sure but it works on my Laptop which is running Arch Linux with Maven 3.0.5 and JDK 1.7.0_25.


Thanh


On 25/07/13 03:05 PM, Thanh Ha wrote:
I was curious so I made a custom Tycho to add a print string to print the "prefix" and "repositoryLocation" at the beginning of this function [1]. What I noticed was on the working system the prefix is calculated to be "compositeContent" while on the system that is failing the prefix is calculated to be "content" as shown below.

How does the prefix get calculated? and why would it be calculated differently on different systems?



Working system:

[INFO] Adding repository http://download.eclipse.org/modeling/emf/emf/updates/2.8.x
+++++++++++++ compositeContent -- http://download.eclipse.org/modeling/emf/emf/updates/2.8.x --
+++++++++++++ compositeContent -- http://download.eclipse.org/modeling/emf/emf/updates/2.8.x/core --
+++++++++++++ content -- http://download.eclipse.org/modeling/emf/emf/updates/2.8.x/core/R201209170436 --
+++++++++++++ content -- http://download.eclipse.org/modeling/emf/emf/updates/2.8.x/core/R201301250826 --
+++++++++++++ compositeContent -- http://download.eclipse.org/modeling/emf/emf/updates/2.8.x/xcore --
+++++++++++++ content -- http://download.eclipse.org/modeling/emf/emf/updates/2.8.x/xcore/R201208220329 --
+++++++++++++ content -- http://download.eclipse.org/modeling/emf/emf/updates/2.8.x/xcore/R201209170741 --
+++++++++++++ content -- http://download.eclipse.org/modeling/emf/emf/updates/2.8.x/xcore/R201302120719 --



Failing system:

[INFO] Adding repository http://download.eclipse.org/modeling/emf/emf/updates/2.8.x
+++++++++++++ content -- http://download.eclipse.org/modeling/emf/emf/updates/2.8.x --
[ERROR] Internal error: java.lang.RuntimeException: Failed to load p2 repository with ID 'emf' from location http://download.eclipse.org/modeling/emf/emf/updates/2.8.x/: Repository system is offline and no local cache available for http://download.eclipse.org/modeling/emf/emf/updates/2.8.x -> [Help 1]



[1] http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/tree/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/remote/RemoteRepositoryCacheManager.java#n49



Thanh


On 24/07/13 03:17 PM, Thanh Ha wrote:
On 24/07/13 10:57 AM, Jeff MAURY wrote:
Can you try on your failing machine after you deleted the local Maven repo ?


I tried this but it did not help. I even tried zipping up the local repo from the working machine and copying it over but that didn't seem to affect anything either.


Thanh


Jeff


On Wed, Jul 24, 2013 at 3:49 PM, Thanh Ha <thanh.ha@xxxxxxxxxxx> wrote:
Hi Everyone,

I ran into an issue trying to do an offline build with Tycho and was wondering if anyone ran into this before. Basically when I build on one system in offline mode I'm returned with "Repository system is offline and no local cache available for ..." (Snippet below) which as far as I can tell is a Tycho message.

I built this cache by first building normally to create the cache and then on my 2nd run I enabled Maven's --offline mode.

What's strange is that when I build on a different system following the same steps doing a normal build first to build the cache and then enabling offline mode, it works as expected. On both systems I'm building the same code and using the same version of JDK and Maven so I'm not sure what could be different between the 2 systems that would cause the error to appear in 1 but not the other.

Maybe there's some environment settings I can look at?


Thanks,


Thanh
[INFO] o.h.m.e.h.MavenExecutionResultHandler - Build failed with exception(s)
[INFO] o.h.m.e.h.MavenExecutionResultHandler - [1] org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: org.eclipse.equinox.p2.core.ProvisionException: Repository system is offline and no local cache available for http://download.eclipse.org/modeling/emf/emf/updates/2.8.x
[DEBUG] Closing connection to remote
[ERROR] Internal error: java.lang.RuntimeException: org.eclipse.equinox.p2.core.ProvisionException: Repository system is offline and no local cache available for http://download.eclipse.org/modeling/emf/emf/updates/2.8.x -> [Help 1]


Attachment: p2example.zip
Description: Zip archive

diff --git a/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/remote/RemoteRepositoryCacheManager.java b/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/remote/RemoteRepositoryCacheManager.java
index 707b1c5..cf720a4 100644
--- a/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/remote/RemoteRepositoryCacheManager.java
+++ b/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/remote/RemoteRepositoryCacheManager.java
@@ -48,6 +48,9 @@ class RemoteRepositoryCacheManager extends CacheManager {
     @Override
     public File createCache(URI repositoryLocation, String prefix, IProgressMonitor monitor) throws IOException,
             ProvisionException {
+        
+        System.out.println("+++++++++++++ " + prefix + " -- " + repositoryLocation.toString() + " -- ");
+        
         File cacheFile = getCache(repositoryLocation, prefix);
         if (offline) {
             if (cacheFile != null) {

Back to the top