Peter Kahn
Peter Kahn

Reputation: 13026

How to setup a local mirror of eclipse artifacts for mvn tycho plugin?

If this is due to a timeout, then how can I setup an internal mirror to improve performance and reduce risk of timeout

Problem Maven build downloads eclipse p2 artifacts via tycho plugin and times out during the build.

[ERROR] Internal error: org.eclipse.tycho.core.osgitools.OsgiManifestParserException:
Exception parsing OSGi MANIFEST /opt/atlassian/bamboo-agent-home/xml-data/build-dir/m2repo
/p2/osgi/bundle/org.eclipse.swt/3.100.1.v4234e/org.eclipse.swt-3.100.1.v4234e.jar: 
error in opening zip file -> [Help 1]

Upvotes: 2

Views: 2043

Answers (1)

Peter Kahn
Peter Kahn

Reputation: 13026

Nexus Pro can handle p2 repositories but I don't think Nexus OSS can.

  1. Create P2 Repository in Nexus Pro (url http://download.eclipse.org/releases/juno/)
  2. Create P2 Repository group in Nexus Pro
  3. Add P2 Repository to P2 Repository group
  4. Modify your settings.xml to add in a p2 mirror

The first mirror is for maven, the 2nd for tycho eclipse p2 repositories

    <mirrors>
      <mirror>
        <id>internal-repository</id>
        <name>Maven Repository Manager running on repo.mycompany.com</name>
        <url>http://localhost:8081/nexus/content/groups/public/</url>
        <mirrorOf>*</mirrorOf>
      </mirror>
      <mirror>
        <id>p2-repository</id>
        <name>p2 Repository mirror</name>
        <url>http://localhost:8081/nexus/content/groups/p2groups/</url>
        <layout>p2</layout>
        <mirrorOfLayouts>p2</mirrorOfLayouts>
        <mirrorOf>*</mirrorOf>
      </mirror>
    </mirrors>

Upvotes: 3

Related Questions