Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 347303 - additional goal to call org.eclipse.equinox.p2.publisher.CategoryPublisher from tycho-p2-extras-plugin
Summary: additional goal to call org.eclipse.equinox.p2.publisher.CategoryPublisher fr...
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Tycho (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement with 4 votes (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-26 08:38 EDT by Lars Fischer CLA
Modified: 2021-04-28 16:55 EDT (History)
3 users (show)

See Also:


Attachments
a patch adding the new PublishCategoryMojo to provide the new goal "publish-category" (13.44 KB, application/octet-stream)
2011-05-26 08:38 EDT, Lars Fischer CLA
no flags Details
new patch based on f6e13aea310f136e20c0dcd5489faf17227bb38e (13.61 KB, patch)
2011-06-10 05:23 EDT, Lars Fischer CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Fischer CLA 2011-05-26 08:38:27 EDT
Created attachment 196654 [details]
a patch adding the new PublishCategoryMojo to provide the new goal "publish-category"

The tycho-p2-extras-plugin provides a goal to call the org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher from a Tycho build.

Eclipse provides the org.eclipse.equinox.p2.publisher.CategoryPublisher to apply the content of a category.xml file on a P2 repository.

With an additional goal of the tycho-p2-extras-plugin, the CategoryPublisher could also be used to have categories on repositories created by Tycho.
Comment 1 Lars Fischer CLA 2011-06-10 05:23:36 EDT
Created attachment 197761 [details]
new patch based on f6e13aea310f136e20c0dcd5489faf17227bb38e
Comment 2 Tobias Oberlies CLA 2011-06-10 12:15:00 EDT
Why do you need this? You could just use eclipse-repository for defining categories. Just set up a second reactor that references the result of the FeaturesAndBundlesPublisher, and define the categories you need there.
Comment 3 Lars Fischer CLA 2011-06-14 04:47:29 EDT
(In reply to comment #2)
> Why do you need this? You could just use eclipse-repository for defining
> categories. Just set up a second reactor that references the result of the
> FeaturesAndBundlesPublisher, and define the categories you need there.

Some months ago, I asked for a way to use categories when publishing self build bundles/features. The answer was, that this could be done by the Eclipse CategoryPublisher. But at this time there was no Mojo to call it easily from a Tycho build and some one has to provide an implementation of such a Mojo.

Now, here it is.

But I will have a look at the way you mentioned.
Comment 4 Lars Fischer CLA 2011-06-22 06:49:21 EDT
I tried to use a second reactor with packaging=eclipse-repository. But this does not solve my goal to create a P2 repository, containing features and bundles from pom-first-dependencies and have them categorized.

With eclipse-repository, only bundles in existing P2 repositories could be resolved. Unfortunately, there is no way to use a file based URL when defining P2 repositories. So I would need to make the local created and temp-repository available through http. I think this is the wrong direction.

Why not keep things simple? Providing a way to call the Eclipse CategoryPublisher from a Tycho build, we could update an existing P2 repo with a packaging=eclipse-feature project containing pom-first-dependencies and put the feature into a category.
Comment 5 Tobias Oberlies CLA 2011-06-24 07:05:09 EDT
(In reply to comment #4)
> I tried to use a second reactor with packaging=eclipse-repository. But this does
> not solve my goal to create a P2 repository, containing features and bundles
> from pom-first-dependencies and have them categorized.
This was indeed an issue in 0.11 and 0.12, but it has been fixed in 0.13.0-SNAPSHOT (see bug 342851): It is now possible to include bundles via pomDependency=consider in an eclipse-repository.

What do you mean with a feature from pom-first-dependency? A feature built by Tycho and referenced from a second reactor through a POM dependency? (This works.) Or a feature built with a different Maven build tool? (This probably doesn't work today.)
Comment 6 Lars Fischer CLA 2011-10-21 07:07:59 EDT
> This was indeed an issue in 0.11 and 0.12, but it has been fixed in
> 0.13.0-SNAPSHOT (see bug 342851): It is now possible to include bundles via
> pomDependency=consider in an eclipse-repository.

Yes, but maven pom dependencies are not allowed to have two different versions at the same time.


> What do you mean with a feature from pom-first-dependency? A feature built by
> Tycho and referenced from a second reactor through a POM dependency? (This
> works.) 

Yes this works for a single feature. But I would like to create a larger p2 repository using maven. This repository should contain different versions of the same feature. There is no way to specify such pom dependencies.


My way would be:
- create separate features using packaging=eclipse-feature from pom dependencies
- publish them into a p2 repository using the "publish-features-and-bundles" goal
- then additional use the new CategoryPublisher to add category information to this repository
Comment 7 Lars Fischer CLA 2011-10-21 07:18:07 EDT
(In reply to comment #4)
> 
> With eclipse-repository, only bundles in existing P2 repositories could be
> resolved. Unfortunately, there is no way to use a file based URL when defining
> P2 repositories. 
> 

I think this restriction is very unhandy. It would be much easier, if I can create a local temp-repository, which is accessible as file without the need to use a http access.
Comment 8 Tobias Oberlies CLA 2011-10-21 09:48:10 EDT
(In reply to comment #6)
> Yes this works for a single feature. But I would like to create a larger p2
> repository using maven. This repository should contain different versions of the
> same feature. There is no way to specify such pom dependencies.
Will it be possible to install these features into one eclipse installation, or will they be mutually exclusive? I am asking, because Tycho is currently limited to the former - and changing this is probably beyond the two large changes bug 348586 and bug 353889.
Comment 9 Tobias Oberlies CLA 2014-04-25 09:26:57 EDT
Another use case for a CategoryPublisher or UpdateSitePublisher is the use case of converting an update site to a p2 repository including the categories [1]

@Lars: Are you still interested in contributing your patch? If yes, please push it to Gerrit [2]. This saves us from having to go through the IP process manually.

[1] http://dev.eclipse.org/mhonarc/lists/tycho-user/msg05605.html
[2] http://wiki.eclipse.org/Tycho/Contributor_Guide
Comment 10 Mickael Istria CLA 2021-04-08 18:08:45 EDT
Eclipse Tycho is moving away from this bugs.eclipse.org issue tracker to https://github.com/eclipse/tycho/issues/ instead. If this issue is relevant to you, your action is required.
0. Verify this issue is still happening with latest Tycho 2.4.0-SNAPSHOT
  if issue has disappeared, please change status of this issue to "CLOSED WORKFORME" with some details about your testing environment and how you did verify the issue; and you're done
  if issue is still present when latest release:
* Create a new issue at https://github.com/eclipse/tycho/issues/
  ** Use as title in GitHub the title of this Bugzilla ticket (may include the bug number or not, at your own convenience)
  ** In the GitHub description, start with a link to this bugzilla ticket
  ** Optionally add new content to the description if it can helps towards resolution
  ** Submit GitHub issue
* Update bugzilla ticket
  ** Add to "See also" property (up right column) the link to the newly created GitHub issue
  ** Add a comment "Migrated to <link-to-newly-created-GitHub-issue>"
  ** Set status as CLOSED MOVED
  ** Submit

All issues that remain open will be automatically closed next week or so. Then the Bugzilla component for Tycho will be archived and made read-only.