-1

We are using Maven (with Tycho) and Nexus to build our Eclipse plugins. While we are continuously digging deeper into it, we are still learning how to use Maven with Nexus best. Our plugins will have to run on Eclipse 3.6 or better, so we defined bundle requirements pointing to Eclipse 3.6. We are running our own Nexus which should act as a mirror to the public repository, but there seem to be only the latest versions available on repo.eclipse.org, not the older 3.6 we need, as we keep getting

[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: our.own.plugin 3.0.0.qualifier
[ERROR]   Missing requirement: our.own.plugin 3.0.0.qualifier requires 'bundle org.eclipse.core.runtime 3.6.0' but it could not be found

Is there a public Nexus repository available for older versions? If not, where can we get the 3.6 artifacts to upload them on our local Nexus?


After some more investigation, I find that after I added a proxy from download.eclipse.org/eclipse/updates/3.6/ as remote repository to Nexus, the build keeps saying

[INFO] Fetching p2.index from http://192.168.205.205:8081/nexus/content/groups/public-p2/ (0B of 134B at 0B/s)
[INFO] Fetching p2.index from http://192.168.205.205:8081/nexus/content/groups/public-p2/ (134B of 134B at 0B/s)
[INFO] Loading repository 'http://192.168.205.205:8081/nexus/content/repositories/eclipse-4.4' from mirror 'nexus-p2' at '192.168.205.205:8081/nexus/content/groups/public-p2/'

and finally fails after a while with

Exception in thread "main" java.lang.StackOverflowError
at     org.eclipse.equinox.internal.p2.transport.ecf.RepositoryTransport.download(RepositoryTransport.java:111)
at org.eclipse.equinox.internal.p2.transport.ecf.RepositoryTransport.download(RepositoryTransport.java:156)
at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadIndexFile(AbstractRepositoryManager.java:735)
at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository(AbstractRepositoryManager.java:657)
at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:96)
at org.eclipse.tycho.p2.remote.RemoteMetadataRepositoryManager.loadRepository(RemoteMetadataRepositoryManager.java:59)
at org.eclipse.tycho.p2.remote.RemoteMetadataRepositoryManager.loadRepository(RemoteMetadataRepositoryManager.java:52)
at 
...

What is the problem?

I noticed that the remote Eclipse 3.6 repository does not have a p2.index file, so I tried Eclipse 4.4, but I receive the same result.


I use Nexus as a mirror for all repositories by adding the following configuration to .m2/settings.xml:

<mirror>
    <id>nexus</id>
    <mirrorOf>*</mirrorOf>
    <url>http://192.168.205.205:8081/nexus/content/groups/public/</url>
</mirror>
<mirror>
    <id>nexus-p2</id>
    <mirrorOf>*</mirrorOf>
    <mirrorOfLayouts>p2</mirrorOfLayouts>
    <url>http://192.168.205.205:8081/nexus/content/groups/public-p2/</url>
    <layout>p2</layout>
</mirror>

Maybe something is wrong with this configurations? I suspect that maybe Nexus tries to mirror its own repository, leading to endless requests?

oberlies
  • 11,503
  • 4
  • 63
  • 110
not2savvy
  • 2,902
  • 3
  • 22
  • 37
  • Tycho can directly read any p2 repository which you specify in the repositories section of your pom. So, why do you want to go through nexus? Is it for company policy or s.t. technical? – Stephan Herrmann May 24 '15 at 19:04
  • I just find it convenient to manage all dependency repositories in one place, and I did not expect this too be more complex than to create a local repository. But if we do it locally, how to setup a local p2 repository? Can it be downloaded from eclipse.org? – not2savvy May 24 '15 at 19:26
  • I was thinking of directly referring to the original repository on download.eclipse.org or such. If you need it locally, you can also mirror the repo, see https://wiki.eclipse.org/Equinox_p2_Repository_Mirroring – Stephan Herrmann May 24 '15 at 20:39
  • Ok, I tried this by adding a repository entry to http://download.eclipse.org/eclipse/updates/3.6/ to the POM and removing the mirror entry in .m2/settings.xml. But now I keep getting "cannot resolve project dependencies". In debug mode, I see the repository is being added, but either this repository does not work or Maven is ignoring it for some reason. I don't see why. Any hints? – not2savvy May 24 '15 at 23:48
  • Sorry, I just found out that I did not properly read the error message. The Eclipse dependencies are in fact resolved now. It's some emf dependencies that are still missing. So this actually works, even though I did not manage to setup the Nexus proxy. Thanks anyway! – not2savvy May 25 '15 at 11:28
  • While the question "how to get Nexus p2 repository mirror" working may be a good question in principal, this post is not good: You didn't properly isolate the issue by trying out if your build works without the Nexus mirror, and it is lacking information like the configuration of the "nexus/content/groups/public-p2" repository. – oberlies Jun 17 '15 at 11:03
  • I'm not quite sure if I understand your point. I did try using the p2 repo directly from the POM, and I did describe it so. I admit I mixed two questions when I was not aware of it, but I had hoped to clarify the problem when I edited the question. If this is not the case, please be more specific what you miss. – not2savvy Jun 17 '15 at 11:29
  • If you want to fix this question, it needs to become more readable. E.g. remove the things you did wrong at first because they are just confusing. And isolate the problem, e.g. first describe the setup that works (without nexus), then describe which (small!) changes lead to the described error. – oberlies Jun 19 '15 at 14:04

2 Answers2

2

To access eclipse artifacts from a tycho build, the easiest approach is to include a repository section in your pom like this:

<repository>
    <id>eclipse-helios</id>
    <url>http://download.eclipse.org/releases/helios</url>
    <layout>p2</layout>
</repository>

The shown url contains all content from the so-called simultaneous release train, and by this is should normally contain all your depedencies from a single location (it does contain EMF 2.6) (Helios corresponds to Eclipse 3.6).

This repository is big, containing one release and two service releases. To narrow it down to, e.g., Helios SR2, you may want to use

<url>http://download.eclipse.org/releases/helios/201102250900</url>
Stephan Herrmann
  • 7,963
  • 2
  • 27
  • 38
  • The provided URL works here when used in the pom as shown above, including EMF. However, if I use the same URL in a Nexus proxy repository and use it as a mirror, I get the effects listed in my original post - endlessly fetching p2.index until a java.lang.StackOverflowError occurs. – not2savvy May 26 '15 at 08:40
0

If you define the plugin as requiring exactly 3.6.0 you will only be able to run it on Eclipse 3.6 and not on any later version. You should specify the version as 3.6.0 or later if you want to run on newer versions.

Older versions of Eclipse including 3.6 are available on the Eclipse archive download site http://archive.eclipse.org/eclipse/downloads/

greg-449
  • 109,219
  • 232
  • 102
  • 145
  • The plugin is not defined as using exactly 3.6.0, but only as minimum requirement. However, as far as I understand it, the build should be run with 3.6 to make sure that we do not use apis not supported under 3.6, right? Thank you for the link to the older versions, but I am not sure, if and how any of these can be used for a proxy or local P2 repository in Nexus? – not2savvy May 24 '15 at 14:39
  • Sorry but I don't know anything about Nexus – greg-449 May 24 '15 at 14:45