Discussion:
tycho-p2-extras-plugin FeaturesAndBundlesPublisher - still no visible installable units?
(too old to reply)
motes motes
2011-11-09 20:55:53 UTC
Permalink
I am using tycho 0.13 and the tycho-p2-extras-plugin to create a p2
site from a bunch of bundles:

<plugin>
<groupId>org.eclipse.tycho.extras</groupId>
<artifactId>tycho-p2-extras-plugin</artifactId>
<version>0.12.0</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>publish-features-and-bundles</goal>
</goals>
</execution>
</executions>
<configuration>
<compress>false</compress>
</configuration>
</plugin>

<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-bundles-for-publishing</id>
<phase>process-resources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>bla</groupId>
<artifactId>bla</artifactId>
<version>1.0</version>
</artifactItem>
...
</artifactItems>
<outputDirectory>${project.basedir}/target/source/plugins</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>

The generated p2 repository can be consumed by tycho just fine. But it
cannot be used inside the eclipse IDE - eg. added to a target
definition - because it has no "visible" installable units. As I
understand the category publisher needs to be executed to take of
this. One solutions is to add it as a directory but it could be nice
to refer to is as a p2 site.

Are there any plans to make bundles in the p2 repo created by the
tycho-p2-extras-plugin visible inside eclipse?
Dahanne, Anthony
2011-11-09 21:16:19 UTC
Permalink
Did you uncheck group items by category ?[1]
So that you can see them from eclipse
Also did you define a category.xml, so that you'll be able to see them categorized in the ide ?[2]
I am not sure I understand what you are trying to do (compared to the basic use of <packaging>eclipse-repository</packaging>)

HTH
Anthony
[1] attached picture
[2] https://github.com/eclipse/tycho/blob/master/tycho-demo/itp04-rcp/eclipse-repository/category.xml










 
Le contenu de ce courriel s'adresse au destinataire seulement. Il contient de l'information pouvant être confidentielle. Vous ne devez ni le copier ni l'utiliser ni le divulguer à qui que ce soit à moins que vous soyez le destinataire ou une personne désignée autorisée. Si vous le receviez par erreur, veuillez nous aviser immédiatement et le détruire.
 
The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it.
 

De : tycho-user-***@eclipse.org [mailto:tycho-user-***@eclipse.org] De la part de motes motes
Envoyé : 9 novembre 2011 15:56
À : Tycho user list
Objet : [tycho-user] tycho-p2-extras-plugin FeaturesAndBundlesPublisher - still no visible installable units?

I am using tycho 0.13 and the tycho-p2-extras-plugin to create a p2
site from a bunch of bundles:

<plugin>
<groupId>org.eclipse.tycho.extras</groupId>
<artifactId>tycho-p2-extras-plugin</artifactId>
<version>0.12.0</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>publish-features-and-bundles</goal>
</goals>
</execution>
</executions>
<configuration>
<compress>false</compress>
</configuration>
</plugin>

<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-bundles-for-publishing</id>
<phase>process-resources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>bla</groupId>
<artifactId>bla</artifactId>
<version>1.0</version>
</artifactItem>
...
</artifactItems>
<outputDirectory>${project.basedir}/target/source/plugins</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>

The generated p2 repository can be consumed by tycho just fine. But it
cannot be used inside the eclipse IDE - eg. added to a target
definition - because it has no "visible" installable units. As I
understand the category publisher needs to be executed to take of
this. One solutions is to add it as a directory but it could be nice
to refer to is as a p2 site.

Are there any plans to make bundles in the p2 repo created by the
tycho-p2-extras-plugin visible inside eclipse?
motes motes
2011-11-09 21:34:44 UTC
Permalink
I am using this project:

https://docs.sonatype.org/display/TYCHO/Tycho-extras+-+FeaturesAndBundlesPublisher

At compile time specified artifacts are downloaded from eg. nexus to a
temp folder and the the FeaturesAndBundlePublisher is run to create a
p2 repo from these downloaded bundles. The resulting p2 site can be
found in the eclipse IDE (eg. specifying a new p2 site and point to
the locally created p2 repo). But its not possible to add any of the
created bundles - I have also tried to uncheck the "Group items by
Category".

As I remember the FeaturesAndBundlePublisher creates a "valid" p2 site
but this does not necessarily mean that the contained bundles are
visible inside the eclipse IDE. See:

http://wiki.eclipse.org/Equinox/p2/Publisher#Features_And_Bundles_Publisher_Application


So it would makes sense to specify a category.xml file eg. one that
simply shows all bundles:


<?xml version="1.0" encoding="UTF-8"?>
<site>
<category-def name="all" label="All Bundles"/>
<iu>
<category name="all"/>
<query><expression type="match">providedCapabilities.exists(p |
p.namespace == 'osgi.bundle')</expression></query>
</iu>

</site>

But does a newer version than 0.12 of the tycho-p2-extras-plugin supports this?



On Wed, Nov 9, 2011 at 10:16 PM, Dahanne, Anthony
Post by Dahanne, Anthony
Did you uncheck group items by category ?[1]
So that you can see them from eclipse
Also did you define a category.xml, so that you'll be able to see them categorized in the ide ?[2]
I am not sure I understand what you are trying to do (compared to the basic use of <packaging>eclipse-repository</packaging>)
HTH
Anthony
[1] attached picture
[2] https://github.com/eclipse/tycho/blob/master/tycho-demo/itp04-rcp/eclipse-repository/category.xml
Le contenu de ce courriel s'adresse au destinataire seulement. Il contient de l'information pouvant être confidentielle. Vous ne devez ni le copier ni l'utiliser ni le divulguer à qui que ce soit à moins que vous soyez le destinataire ou une personne désignée autorisée. Si vous le receviez par erreur, veuillez nous aviser immédiatement et le détruire.
The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it.
Envoyé : 9 novembre 2011 15:56
À : Tycho user list
Objet : [tycho-user] tycho-p2-extras-plugin FeaturesAndBundlesPublisher - still no visible installable units?
I am using tycho 0.13 and the tycho-p2-extras-plugin to create a p2
                       <plugin>
                               <groupId>org.eclipse.tycho.extras</groupId>
                               <artifactId>tycho-p2-extras-plugin</artifactId>
                               <version>0.12.0</version>
                               <executions>
                                       <execution>
                                               <phase>prepare-package</phase>
                                               <goals>
                                                       <goal>publish-features-and-bundles</goal>
                                               </goals>
                                       </execution>
                               </executions>
                               <configuration>
                                       <compress>false</compress>
                               </configuration>
                       </plugin>
                       <plugin>
                               <artifactId>maven-dependency-plugin</artifactId>
                               <executions>
                                       <execution>
                                               <id>copy-bundles-for-publishing</id>
                                               <phase>process-resources</phase>
                                               <goals>
                                                       <goal>copy</goal>
                                               </goals>
                                               <configuration>
                                                       <artifactItems>
                                                               <artifactItem>
                                                                       <groupId>bla</groupId>
                                                                       <artifactId>bla</artifactId>
                                                                       <version>1.0</version>
                                                               </artifactItem>
                                                                      ...
                                                       </artifactItems>
                                                       <outputDirectory>${project.basedir}/target/source/plugins</outputDirectory>
                                               </configuration>
                                       </execution>
                               </executions>
                       </plugin>
The generated p2 repository can be consumed by tycho just fine. But it
cannot be used inside the eclipse IDE -  eg. added to a target
definition - because it has no "visible" installable units. As I
understand the category publisher needs to be executed to take of
this. One solutions is to add it as a directory but it could be nice
to refer to is as a p2 site.
Are there any plans to make bundles in the p2 repo created by the
tycho-p2-extras-plugin visible inside eclipse?
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
Oberlies, Tobias
2011-11-14 14:42:36 UTC
Permalink
Post by motes motes
But does a newer version than 0.12 of the tycho-p2-extras-plugin supports this?
This has been requested here [1], but I haven't heard any convincing use case yet.

Regards
Tobias


[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=347303
Lars Fischer
2011-11-15 10:24:49 UTC
Permalink
Hello,
Post by Oberlies, Tobias
Post by motes motes
But does a newer version than 0.12 of the tycho-p2-extras-plugin supports this?
This has been requested here [1], but I haven't heard any convincing use case yet.
One use case is to enable the usage of the CategoryPublisher from maven.
When deploying (publishing) additional features and bundles into an
EXISTING p2 repository, they are not put inside a category and they
are not visible in the IDE, if "Group items by category" is activated.
This is convincing to me...

I don't know why parts of the P2 tooling are supported
(FeaturesAndBundlesPublisher) and other parts on same level are
ignored (CategoryPublisher).

Regards,
Lars
Oberlies, Tobias
2011-11-15 10:38:49 UTC
Permalink
Post by motes motes
Post by Oberlies, Tobias
Post by motes motes
But does a newer version than 0.12 of the tycho-p2-extras-plugin
supports
Post by Oberlies, Tobias
Post by motes motes
this?
This has been requested here [1], but I haven't heard any convincing use
case yet.
One use case is to enable the usage of the CategoryPublisher from maven.
When deploying (publishing) additional features and bundles into an
EXISTING p2 repository, they are not put inside a category and they
are not visible in the IDE, if "Group items by category" is activated.
This is convincing to me...
You can produce categories in the Tycho build and mirror these categories into a multi-version repository (if this is your use case). Categories have synthetic IDs, so there can be more than one IU with the same category label. If labels match, they are merged in the p2 IU.
Post by motes motes
I don't know why parts of the P2 tooling are supported
(FeaturesAndBundlesPublisher) and other parts on same level are
ignored (CategoryPublisher).
The p2 tooling has mostly been developed to retrofit the build results of non-p2 aware build systems with p2 metadata. With Tycho, you therefore should not need these tools.

I understand that the category publisher is in fact something you may want to call outside the build. The FeaturesAndBundlesPublisher is rather a hack and should be deleted.

Regards
Tobias
Lars Fischer
2011-11-15 11:06:26 UTC
Permalink
Post by Oberlies, Tobias
Post by Lars Fischer
One use case is to enable the usage of the CategoryPublisher from maven.
When deploying (publishing) additional features and bundles into an
EXISTING p2 repository, they are not put inside a category and they
are not visible in the IDE, if "Group items by category" is activated.
This is convincing to me...
You can produce categories in the Tycho build and mirror these categories
into a multi-version repository (if this is your use case).
Ok, I will try this.
Post by Oberlies, Tobias
I understand that the category publisher is in fact something you may want
to call outside the build. The FeaturesAndBundlesPublisher is rather a hack
and should be deleted.
Do you talk about the Maven Mojo or the P2 tools?
Without the P2 FeaturesAndBundlesPublisher, how could I mirror a local
created P2 repo in to an other multi-version repo?
And the Mojo is very handy for this operation. So why should them be deleted?

Regards,
Lars
Oberlies, Tobias
2011-11-15 12:05:53 UTC
Permalink
Post by Lars Fischer
Post by Oberlies, Tobias
I understand that the category publisher is in fact something you may
want
Post by Oberlies, Tobias
to call outside the build. The FeaturesAndBundlesPublisher is rather a
hack
Post by Oberlies, Tobias
and should be deleted.
Do you talk about the Maven Mojo or the P2 tools?
Without the P2 FeaturesAndBundlesPublisher, how could I mirror a local
created P2 repo in to an other multi-version repo?
And the Mojo is very handy for this operation. So why should them be deleted?
In short, because people will do what you appear to be doing.

In order to aggregate the content from multiple p2 repositories into one, you should use the mirror tool (either stand-alone or as mojo). You should not just copy the artifacts together and call the FeaturesAndBundlesPublisher! The reason is that this may create installable units with duplicate id+version but different content - which violates a basic assumption of p2 and therefore may break you users - and that with problems that can be very hard to understand. It may work without problems - but you won't know when it doesn't.

Therefore, re-creating p2 metadata of artifacts which already have p2 metadata from the build shall not be done. This happens way to easy with the FeaturesAndBundlesPublisher, and therefore we should really delete the mojo.

Regards
Tobias
Lars Fischer
2011-11-15 13:40:25 UTC
Permalink
Post by Oberlies, Tobias
In short, because people will do what you appear to be doing.
In order to aggregate the content from multiple p2 repositories
into one, you should use the mirror tool (either stand-alone or
as mojo). You should not just copy the artifacts together and
call the FeaturesAndBundlesPublisher! The reason is that this
may create installable units with duplicate id+version but different
content - which violates a basic assumption of p2 and therefore
may break you users - and that with problems that can be very
hard to understand. It may work without problems - but you
won't know when it doesn't.
Therefore, re-creating p2 metadata of artifacts which already
have p2 metadata from the build shall not be done. This happens
way to easy with the FeaturesAndBundlesPublisher, and
therefore we should really delete the mojo.
Yes, mirroring should be done by the mirror tool as the name says.

But I use the FeaturesAndBundlesPublisher not to re-create existing data.
My exact usage is to create a P2 repository of third party libs, which
are not available in other public P2 repositories.
This P2 repo is used for Tycho based builds and as source for target
platform configurations. Similar to the Eclipse Orbit repository, but
created by Maven/Tycho.

Therefore I use Tycho feature projects with pom-first dependencies to
some OSGi ready libs. The feature project creates a local p2 repo,
which I do publish into the existing main repo. This is done only
once. This way I only need Maven/Tycho to reproducable create my
"Orbit"-repo without the need to have a headless eclipse or other
build tools to be prepared.

But I will try to switch to the mirror mojo, which you suggested.

Regards,
Lars
Lars Fischer
2011-11-16 16:12:44 UTC
Permalink
Post by Lars Fischer
But I will try to switch to the mirror mojo, which you suggested.
Using the mirror mojo, I run into the next problem:

I have multiple versions of a feature, which have dependecies to one
third bundle of only one version.
Mirroring the first version of the feature works fine.
But the next version fails, because the third bundle already exists in
the target repo.

So I'm not able to mirror the feature with two versions into the target repo.

Is there a way to solve this?

Regards,
Lars
Sievers, Jan
2011-11-16 16:28:25 UTC
Permalink
see https://bugs.eclipse.org/bugs/show_bug.cgi?id=360474

-----Original Message-----
From: tycho-user-***@eclipse.org [mailto:tycho-user-***@eclipse.org] On Behalf Of Lars Fischer
Sent: Mittwoch, 16. November 2011 17:13
To: Tycho user list
Subject: Re: [tycho-user] tycho-p2-extras-plugin FeaturesAndBundlesPublisher - still no visible installable units?
Post by Lars Fischer
But I will try to switch to the mirror mojo, which you suggested.
Using the mirror mojo, I run into the next problem:

I have multiple versions of a feature, which have dependecies to one
third bundle of only one version.
Mirroring the first version of the feature works fine.
But the next version fails, because the third bundle already exists in
the target repo.

So I'm not able to mirror the feature with two versions into the target repo.

Is there a way to solve this?

Regards,
Lars
Lars Fischer
2011-11-16 16:46:53 UTC
Permalink
Post by Sievers, Jan
see https://bugs.eclipse.org/bugs/show_bug.cgi?id=360474
Thank you. I will watch it.

Regards,
Lars

Loading...