tycho-p2-repository-plugin:assemble-maven-repository ignores eclipse-feature artifacts and omits feature.group IUs #5220
Replies: 5 comments 2 replies
-
@ssirsika-tibco the best way would be to provide an integration-test to demonstrate the issue. I think this can be enhanced to include features as well, but as only bundles are published I really wonder how features could be a problem at all. Also keep in mind that a feature usually is only meta-data for Tycho and the jar only becomes relevant when installing it. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your response @laeubi .
When I was checking standard p2 sites like https://download.eclipse.org/releases/2021-03/202103171000/, I could see that content.xml does contain feature group entries like org.eclipse.cdt.native.feature.group and artifacts.xml has mapping entries like
I could get around my problem even if I can achieve older “warn and continue” behavior which was present in the Tycho 2.7.5 where even if feature-group is not present in the p2 site, it used to pass. Do we have any flag in Tycho 4.0.13 which tells Tycho to ignore the missing feature.group while building the IU? Or is there any configuration in the latest Tycho which will allow me to mock the missing 'feature.group'? As you have already mentioned, feature jars are just a metadata and really doesn't matter even if it's not present while building the feature. I will go through the instructions you have provided to create an integration-test but that may consume some time. So thought of checking any workaround which can unblock my Tycho 4.013 build first? Thanks |
Beta Was this translation helpful? Give feedback.
-
@ssirsika-tibco without more details its impossible to guess what could be a workaround. As mentioned and as you noticed the tycho-p2-repository:assemble-maven-repository only publish bundles (what might be enhanced), but this is not an error, so it is unclear what warning/error you see and where it fails. So in general when your feature build references features not present and it was not a problem for you in the past one might wonder why not remove these unneeded feature references at all. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your reply. So there are two aspects for this discussion. First is about the tycho-p2-repository:assemble-maven-repository to publish the feature and which can be done through enhancement. Second aspect is broken functionality between Tycho 2.7.5 and 4.0.13. So let's discuss more on this aspect for now. I have a feature (com.sample.main.feature) which depends on another dependent feature (com.sample.dep.feature) via dependency mentioned in feature.xml. Dependent com.sample.dep.feature is published via p2 repository which only contains 'osgi.bundle' entries (because of aspect one mentioned above). On Using Tycho 2.7.5, I could successfully build com.sample.main.feature even though I used to get following in the console log
But when I tried to build same com.sample.main.feature using Tycho 4.0.13 (mvn clean install), it throws errors as
You can see that com.sample.main.data is a plugin which depends on plugin present in com.sample.dep.feature and published via p2 repository. Tycho is able to resolve the dependent bundle and build is successfully but it fails to resolve the feature.gruop as as it's not published via p2 repository. So now it fails while building com.sample.main.feature. But same build was successful on Tycho 2.7.5. So here I wanted to know if there is any workaround so that build will work by ignoring missing feature.group ( same as what was happening on 2.7.5). Please let me know if you need more information. Thanks. |
Beta Was this translation helpful? Give feedback.
-
Sorry if I there is some confusion. com.sample.main.feature depends on com.sample.dep.feature via feature.xml as
Why are you suggesting to remove the feature dependency from feature.xml? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Summery:
When driving the tycho-p2-repository-plugin:assemble-maven-repository mojo on a Maven aggregator that declares entries of type eclipse-feature, Tycho only generates OSGi bundle entries under /plugins and completely omits feature JARs under /features as well as their metadata in content.jar.
Background :
On Tycho version 2.7.5, I was using tycho-p2-repository:assemble-maven-repository to build the p2 site which points to my remote maven repository on Nexus. assemble-maven-repository generates the maven coordinates for OSGi bundle artifacts successfully. But it did not generated any entries in content.jar for 'eclipse-feature' package type. So you will not find any entries like metadata in content.jar. Also artifacts.jar does not include mapping rules for classifier=eclipse.feature. It only have mapping rule for classifier=osgi.bundle.
Even if 'feature.group' entries for eclipse feature was missing in the generated p2 site, I was successfully able to build my feature and plugins as Tycho 2.7.5 was ignoring the missing features from update site and was producing the successful build. Tycho 2.7.5 was just give warning about the missing dependent feature from feature.xml but could able to build the feature by ignoring those missing features.
But after moving to Tycho 4.0.13, feature build started failing if required features from feature.xml is not present in the generated p2 site. So because of limitation in tycho-p2-repository:assemble-maven-repository I am not able to generate feature.group entry in the content.xml like
<unit id='org.eclipse.pde.source.feature.group' version='3.14.700.v20210303-1800' singleton='false'>
This caused my feature build to fail on 4.0.13 as now missing feature group IU is treated as error.
Question :
Beta Was this translation helpful? Give feedback.
All reactions