tycho to publish p2 site with a history of features for installation
Asked Answered
W

1

-1

I would like to ask about how to preserve the history of available plugins for download with tycho.

Here's the scenario:

  1. I have a few versions of a feature (feature.1.0.0, feature.2.0.0, etc) being built with Eclipse "Build Site" feature.
  2. The metadata, content.jar and artifacts.jar were created from Eclipse, by reading the site.xml.
  3. Now I have maven tycho to automate the p2 repository creation.
  4. I saw how tycho generate the p2 repo with category.xml.
  5. But I don't understand how to include the history, because tycho (or actually the library called by tycho, internal.p2.director.Projector) does not like the history of features in category.xml.

When I ran mvn package:



    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:120)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:483)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: java.lang.RuntimeException: No solution found because the problem is unsatisfiable.: [Unable to satisfy dependency from com.myfeature.releng.p2 raw:0.0.0.'SNAPSHOT'/format(n[.n=0;[.n=0;[-S]]]):0.0.0-SNAPSHOT to com.myfeature.plugin.feature.feature.group [13.7.0,13.7.1).; Unable to satisfy dependency from com.myfeature.releng.p2 raw:0.0.0.'SNAPSHOT'/format(n[.n=0;[.n=0;[-S]]]):0.0.0-SNAPSHOT to com.myfeature.plugin.feature.feature.group [13.8.0,13.8.1).; Unable to satisfy dependency from com.myfeature.releng.p2 raw:0.0.0.'SNAPSHOT'/format(n[.n=0;[.n=0;[-S]]]):0.0.0-SNAPSHOT to com.myfeature.feature.group [13.8.1,13.8.2).; Unable to satisfy dependency from com.myfeature.releng.p2 raw:0.0.0.'SNAPSHOT'/format(n[.n=0;[.n=0;[-S]]]):0.0.0-SNAPSHOT to com.myfeature.feature.group [13.8.2,13.8.3).; ]
    at org.eclipse.tycho.p2.util.resolution.AbstractResolutionStrategy.newResolutionException (AbstractResolutionStrategy.java:98)
    at org.eclipse.tycho.p2.util.resolution.ProjectorResolutionStrategy.resolve (ProjectorResolutionStrategy.java:88)
    at org.eclipse.tycho.p2.util.resolution.AbstractResolutionStrategy.resolve (AbstractResolutionStrategy.java:63)
    at org.eclipse.tycho.p2.resolver.P2ResolverImpl.resolveDependencies (P2ResolverImpl.java:166)
    at org.eclipse.tycho.p2.resolver.P2ResolverImpl.resolveDependencies (P2ResolverImpl.java:103)

How to build a production p2 site (with history of features) with tycho?

My package structure is based on this fabulous blog

Thanks!

Wiseman answered 27/3, 2018 at 21:36 Comment(0)
W
-1

I finally figured out...

And put everything into production...

  1. https://eclipse.org/package-drone/
  2. To install, https://wiki.eclipse.org/PackageDrone/Installation
  3. Now it's up and running. Create an user name you can login in other than admin.
  4. Login to create a channel, say the channel name is "my_payload"
  5. Within the channel, assign a deploy group and a deploy key
  6. (Most Important) The channel must have the following aspects:
    • OSGi
    • P2 Repository
    • P2 Unzip
    • Mime
    • Hasher
  7. (Must do before #8) Upload a category.xml

    <site>
        <description name="my update site" url="http://your-p2-repo/my_channel/">
         My update site
        </description>
        <category-def name="my company's extensions for you" label="my company extension"/>
    </site>
    
  8. Use the REST call to upload the tycho generated p2 repo zip.

  9. Notice that, when you query from "Install New Software" in your app, the category will consolidate a history of versions together. The p2 repo will generate the metadata for you.

Hope you get it going! I will write a blog at some point on the details!

Wiseman answered 16/4, 2018 at 21:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.