Skip to content

Conversation

@fipro78
Copy link
Contributor

@fipro78 fipro78 commented Jun 24, 2025

With this PR the following changes are intended:

  • Update the versions of the NatTable dependencies
  • Handle the changes needed for the Eclipse Collections update
  • Change the features to not include the third-party dependencies anymore

@merks and @laeubi

Are these the changes we discussed in the Eclipse Collections PR? Or should I change something to make NatTable better consumeable and integrateable?

Comment on lines 23 to 24
<import plugin="org.eclipse.collections.api"/>
<import plugin="org.eclipse.collections.impl"/>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<import plugin="org.eclipse.collections.api"/>
<import plugin="org.eclipse.collections.impl"/>
<import plugin="org.eclipse.collections.impl"/>

I assume the API is already referenced somehow and does not needs to be listed explicitly?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think one doesn't generally need to specify such things in the feature.xml if some bundle already has such a dependency anyway and if both these things are needed then the bundle should require both...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typically the impl bundle is not referenced directly but only the api bundle. In the older versions of Eclipse Collections the factory.primitive bundle was not available in the api bundle, which is why there is such a dependency to impl in NatTable. But it seems that was fixed with 11.1.0 already. So I will change that now too.

Copy link

@laeubi laeubi Jun 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typically the impl bundle is not referenced directly but only the api bundle

From OSGi point of view it would be good to have a require capability and corresponding provided capability then, e.g. like we did for SWT here:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They have pretty extensive capability headers.

Require-Capability: osgi.extender;filter:="(&(osgi.extender=osgi.service
 loader.processor)(version>=1.0.0)(!(version>=2.0.0)))",osgi.serviceload
 er;filter:="(osgi.serviceloader=org.eclipse.collections.api.factory.bag
 .ImmutableBagFactory)";...
Provide-Capability: osgi.service;objectClass:List<String>="org.eclipse.c
 ollections.api.factory.bag.ImmutableBagFactory";effective:=active,...

That was actually my main contribution to Eclipse Collections. Using bndtools to generate the manifest files for correct SPI headers.

Does that mean I can also remove the IMPL dependency?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to be the case ...

Comment on lines 22 to 25
<requires>
<import plugin="ca.odell.glazedlists"/>
<import plugin="org.apache.commons.commons-codec"/>
</requires>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<requires>
<import plugin="ca.odell.glazedlists"/>
<import plugin="org.apache.commons.commons-codec"/>
</requires>
<requires>
<import plugin="ca.odell.glazedlists"/>
<import plugin="org.apache.commons.commons-codec"/>
</requires>

I would assume both are anyways required by some import-package/require bundle so no need to list them here.

Comment on lines 22 to 28
<requires>
<import plugin="org.apache.commons.lang3"/>
<import plugin="org.apache.commons.text"/>
<import plugin="org.eclipse.nebula.cwt"/>
<import plugin="org.eclipse.nebula.widgets.cdatetime"/>
<import plugin="org.eclipse.nebula.widgets.richtext"/>
</requires>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<requires>
<import plugin="org.apache.commons.lang3"/>
<import plugin="org.apache.commons.text"/>
<import plugin="org.eclipse.nebula.cwt"/>
<import plugin="org.eclipse.nebula.widgets.cdatetime"/>
<import plugin="org.eclipse.nebula.widgets.richtext"/>
</requires>

These are also likely not independently required?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, less is more.

Comment on lines 22 to 33
<requires>
<import plugin="org.apache.commons.commons-collections4"/>
<import plugin="org.apache.commons.commons-compress"/>
<import plugin="org.apache.commons.commons-io"/>
<import plugin="org.apache.logging.log4j.api"/>
<import plugin="org.apache.commons.math3"/>
<import plugin="org.apache.xmlbeans"/>
<import plugin="org.apache.poi"/>
<import plugin="org.apache.poi.ooxml"/>
<import plugin="org.apache.poi.ooxml.schemas"/>
<import plugin="com.zaxxer.sparsebits"/>
</requires>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least some here seem not needed as they are already transitively required.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move all such 3rd party things to a feature not consumed by end users.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it need to be a feature, or can those dependencies also be added as bundles in a new category?

Comment on lines 33 to 35
<unit id="org.eclipse.collections.api" version="12.0.0"/>
<unit id="org.eclipse.collections.impl" version="12.0.0"/>
<unit id="org.apache.aries.spifly.dynamic.bundle" version="0.0.0"/>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these really be consumed from nat table or are these more dependencies of this project and can be added e.g. as maven coordinates or consumed from the original update sites directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the 12.0.0 version there is no original update site. Seems that was missed and is only available for the 13.0.0. But of course I can use the maven coordinates.

Copy link
Contributor

@merks merks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see no changes to the category.xml so I doubt very much your repository will contain all the necessary 3rd party (non-project) dependencies that are needed by nattable. It's of course fine not to include things from the Platform, but you really need to ensure that folks can install or create a target platform from nattable and all the transitive dependencies.

@fipro78 fipro78 force-pushed the dependency_update branch from d3206ff to 7d3d85f Compare June 25, 2025 09:29
@fipro78
Copy link
Contributor Author

fipro78 commented Jun 25, 2025

@laeubi
I have adapted the PR according to your suggestions. Would you say it is ok now?

@merks
I have added the third-party dependencies to a new category, but without a new feature. With the automatic resolving of a target platform, I get the things resolved and can build a product in a clean environment. But of course it will resolve the Eclipse Collections 11.1.0 from the SimRel currently if I do not explicitly include the 12.0.0 in my target. I suppose this gets solved once Eclipse Collections is removed from the SimRel repo, correct?

Is the state of this PR now fine, or should I modify something? In the past I would have added something like "third-party-dependency-features", but if I understand correctly, this is not really necessary anymore, right?

@laeubi
Copy link

laeubi commented Jun 25, 2025

@fipro78 just in case instead of adding a handcrafted set of dependencies to a category.xml (and therefore duplicating content, increasing the load on the storage server and so on) I would these days recommend the following:

  1. Enable includeAllDependencies to make P2 consider all transitive of dependencies of your plugins
  2. Enable includeAllSources if you want to be nice and distribute all available sources
  3. Enable addIUTargetRepositoryReferences to reference what you have consumed
  4. Enable filterProvided to remove everything already provided by other update sites

That way you will end up with a minimal update site where user can install whatever is required transitively (if not already there) optionally including the sources.

@fipro78
Copy link
Contributor Author

fipro78 commented Jun 25, 2025

@laeubi

If I change the packaging to p2-maven-repository and add this plugin configuration in the update-site pom.xml

<plugin>
    <groupId>org.eclipse.tycho</groupId>
    <artifactId>tycho-p2-repository-plugin</artifactId>
    <version>${tycho-version}</version>
    <configuration>
        <includeAllDependencies>true</includeAllDependencies>
        <includeAllSources>true</includeAllSources>
        <addIUTargetRepositoryReferences>true</addIUTargetRepositoryReferences>
        <filterProvided>true</filterProvided>
        <categoryName>NatTable</categoryName>
    </configuration>
</plugin>

I get an almost empty update site. I only see the DataSet category and there are only the artifacts.xml and the content.xml file. So probably I am doing things wrong. Any hints?

@laeubi
Copy link

laeubi commented Jun 25, 2025

If I change the packaging to p2-maven-repository

This mostly is to be used for plain maven builds (well it should also work for Tycho builds ...), just keep everything as before (e.g. category.xml and packing) and just remove any third party stuff :-)

@fipro78 fipro78 force-pushed the dependency_update branch from 7d3d85f to 298b515 Compare June 26, 2025 08:35
@fipro78
Copy link
Contributor Author

fipro78 commented Jun 26, 2025

@laeubi
I have updated the PR according to your suggestions. Looks ok to me. Now the NatTable repository only contains the NatTable artifacts. If I use it in a new project, the dependencies are resolved automatically. Well, of course only if the automatic dependency resolution is enabled. But IMHO this should give users the same convenient experience as before (especially with the same automation feature in the .product file), but provides the ability to customize in case different versions of the dependencies should be used.

@merks
What do you think?

@fipro78 fipro78 merged commit 23309d2 into master Jul 14, 2025
2 checks passed
@fipro78 fipro78 deleted the dependency_update branch August 8, 2025 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants