Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a feature out of a maven-target location #280

Closed
laeubi opened this issue Jul 19, 2021 · 9 comments
Closed

Create a feature out of a maven-target location #280

laeubi opened this issue Jul 19, 2021 · 9 comments
Assignees
Labels
pde-integration M2Eclipse PDE Integration

Comments

@laeubi
Copy link
Member

laeubi commented Jul 19, 2021

There should be an option to create an autogenerated feature out of a maven target location that simply includes all (transitive) dependencies of that location.

That would help people to rapidly setup a maven dependency in case of feature based products. For finer grained control, user features can still be created/used.

@laeubi
Copy link
Member Author

laeubi commented Oct 12, 2021

This is currently blocked by https://bugs.eclipse.org/bugs/show_bug.cgi?id=576568

@HannesWell
Copy link
Contributor

Do you plan to support 'pom' modules as well?

@laeubi
Copy link
Member Author

laeubi commented Oct 12, 2021

Pom modules are already supported and will result in a gnerated feature from the maven information once PDE supports the dynamic generation of features (I'll propose a patch soon for this but we will need to wait until next release of PDE...).

@HannesWell
Copy link
Contributor

Yes, I meant to create a feature out of a pom-module. That will be a useful feature!
I think m2e itself could use it to include the embedded jars in m2e.archtype.common and m2e.maven.indexer as bundles because those two bundles actually only serve as 'group' of jars, which would actually be simply a feature.

@laeubi
Copy link
Member Author

laeubi commented Oct 13, 2021

My change is accepted and will hopefully be merged soon, I have created a local POC that converts a pom dependency to a feature

grafik

sadly PDE is not capable of displaying such a feature, so further changes are required to make this work more smoothly...

@laeubi
Copy link
Member Author

laeubi commented Oct 13, 2021

https://bugs.eclipse.org/bugs/show_bug.cgi?id=576610 is also a requirement for this.

This then allows open the feature inside PDE:

grafik
grafik

@HannesWell
Copy link
Contributor

That looks great! Really looking forward to this one.
I'm curious, how does one specify that and how the feature is created? Do I just have to flip a switch for a Maven-Target location and say create a feature for all bundles in this location? For example by specifying the feature-name as attribute of the target location? And will the feature then include all bundles of that target? Or will there be a dedicated "create-feature"-element in a Maven target where you can specify other data (like licence or URLs etc.) of the feature as well?

If you prefer, we can also discuss those things in a (draft) PR once your POC is successful and all PDE requirements are met.

@laeubi
Copy link
Member Author

laeubi commented Oct 14, 2021

The feature is currently in an experimental stage and the first goal would be to have anything generated that could be used as a feature, but there is also some time to decide an all of this as we have to wait for the next PDE release in December anyways, so first GA will be the 2022-03 eclipse release.

I really would like to have Bug 576610 merged as it simplifies inspecting the feature generated but will create a draft PR with a first version then and if you like any Alpha-Testing would be appreciated.

My current plans are as follows:

  • if we have a pom-dependency an automatic feature is generated with the name <groupid>.<artifactid>.pom and version of the pom (that's what shown at the screenshot), depending on the "include dependencies" flag of the location it will contain only direct or all transitive dependencies. currently I do not plan any further customization here as the user is free to ignore that feature if it does not fit
  • for a location I'd like to have a <feature> child element that uses the syntax of the feature-file xml (so we can parse it using PDE) and it will then simply add all bundles in that location as additional plugins, so the user is free to define it in whatever way he wants, but this part is a bit vague at the moment as I have to think how this could be represented in the UI in an appealing manner (there is probably a chance to reuse the PDE editor for this, this will also require Bug 576610 as well).
  • I also like to derive a description and license information from the dependent artifacts like description, license information and alike if not specified by the user.

This hopefully will allow people to define pom-as-a-feature that could easily be used in targets as an alternative to update-sites for smaller projects with just a few related artifacts and thanks to maven resolving dependent items as well will reduce task of define self-contained features.

laeubi added a commit to laeubi/m2e-core that referenced this issue Oct 14, 2021
First POC for transforming a pom into a feature

Signed-off-by: Christoph Läubrich <laeubi@laeubi-soft.de>
@laeubi
Copy link
Member Author

laeubi commented Oct 29, 2021

I now added basic UI to generate a feature for non-pom maven locations

grafik

If the option is checked the wizzard contains a new page to enter basic infos

grafik

If one likes he can add additional plugins as well that should be mentioned in the feature (but this step is optional)

grafik

Afterwards this will end up in the target source and one can add/edit/adjust additional data, effectivly everything the feature.xml supports is allowed here:

grafik

@laeubi laeubi self-assigned this Oct 29, 2021
@laeubi laeubi linked a pull request Dec 3, 2021 that will close this issue
laeubi added a commit to laeubi/m2e-core that referenced this issue Dec 8, 2021
Signed-off-by: Christoph Läubrich <laeubi@laeubi-soft.de>
laeubi added a commit to laeubi/m2e-core that referenced this issue Dec 9, 2021
Signed-off-by: Christoph Läubrich <laeubi@laeubi-soft.de>
@laeubi laeubi closed this as completed in d0c6401 Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pde-integration M2Eclipse PDE Integration
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants