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

Incorrect org.osgi Maven-dependencies in generated pom of o.e.osgi.util #70

Closed
HannesWell opened this issue Jun 15, 2022 · 15 comments
Closed
Assignees

Comments

@HannesWell
Copy link
Member

Just like o.e.equinox.preferences (handled eclipse-equinox/equinox.bundles#54) org.eclipse.osgi.util also uses wrong groudIds (org.osgi.util instead of org.osgi) for the newly introduced osgi dependencies from Maven-Central:
https://repo1.maven.org/maven2/org/eclipse/platform/org.eclipse.osgi.util/3.7.0/org.eclipse.osgi.util-3.7.0.pom

Given that the publication processes was fixed already with eclipse-platform/eclipse.platform.releng#48 it likely only requires a re-build and re-publication of `org.eclipse.osgi.util.

@sravanlakkimsetti @akurtakov can you please take care of this again.

@HannesWell
Copy link
Member Author

HannesWell commented Jun 15, 2022

From this PR eclipse-equinox/equinox.bundles#26 the following bundles should be affected as well:

But their poms seem not to contain any dependency. Likely because the osgi-bundles are required via Import-Package and not require bundle. I wonder if this is an error in the generator as well.

@bjhargrave
Copy link
Member

I wonder if this is an error in the generator as well.

That would be bad and needs to be fixed. All the OSGi artifacts contain the maven metadata under META-INF/maven so a generator tool can always find the correct maven coordinates for an OSGi artifact.

@akurtakov
Copy link
Member

IMHO we should not use generator postfactum but during the build that would embed good pom.xml file in META-INF/maven at build time and later use this one to deploy.

@HannesWell
Copy link
Member Author

I wonder if this is an error in the generator as well.

That would be bad and needs to be fixed. All the OSGi artifacts contain the maven metadata under META-INF/maven so a generator tool can always find the correct maven coordinates for an OSGi artifact.

IIRC all jars deployed to Maven-Central have their pom embedded. So instead of relying on rules that have to be crafted for all dependencies the pom generator could check for those poms and derive the GAV from it.

@laeubi
Copy link
Member

laeubi commented Jun 15, 2022

I recommended that awhile ago but it has not got much attention (until today), the problem is that the post-script making some assumptions, and the jars in question either don't contain pom or just "bad pom" data at the moment.

@akurtakov
Copy link
Member

I wonder if this is an error in the generator as well.

That would be bad and needs to be fixed. All the OSGi artifacts contain the maven metadata under META-INF/maven so a generator tool can always find the correct maven coordinates for an OSGi artifact.

IIRC all jars deployed to Maven-Central have their pom embedded. So instead of relying on rules that have to be crafted for all dependencies the pom generator could check for those poms and derive the GAV from it.

Generator tool was written years ago at the time when using Maven Central was not directly usable and Orbit artifacts didn't contain this information. Unfortunately, it hasn't evolved since then and we are probably better relying on Tycho to do that part instead.

@bjhargrave
Copy link
Member

All the OSGi artifacts contain the maven metadata under META-INF/maven so a generator tool can always find the correct maven coordinates for an OSGi artifact.

➜  osgi git:(main) bnd view ~/.m2/repository/org/osgi/org.osgi.service.prefs/1.1.2/org.osgi.service.prefs-1.1.2.jar META-INF/maven/org.osgi/org.osgi.service.prefs/pom.properties
version=1.1.2
groupId=org.osgi
artifactId=org.osgi.service.prefs

IIRC all jars deployed to Maven-Central have their pom embedded.

This is not true and not required. Maven will embed the pom metadata by default (see addMavenDescriptor in https://maven.apache.org/shared/maven-archiver/index.html), but Gradle does not and you have to go out of your way to embed the pom metadata (for example: https://github.com/bndtools/bnd/blob/6730d70648fc61ceaad93f8f16e59a560d5514b1/gradle-plugins/biz.aQute.bnd.gradle/build.gradle.kts#L211-L215).

@mickaelistria
Copy link
Contributor

I recommended that awhile ago but it has not got much attention (until today)

It got attention and support; but no workforce as it wasn't a serious problem before today.

@laeubi
Copy link
Member

laeubi commented Jun 15, 2022

I recommended that awhile ago but it has not got much attention (until today)

It got attention and support; but no workforce as it wasn't a serious problem before today.

Don't wanted to accuse anyone here, just noted that the idea itself is not quite new, and I fear that the underlying problem (no workforce as it wasn't a serious problem) still remains.

Anyways I'll try starting with equinox but there will be probably some more to do at Tycho as well to support it best (e.g. eclipse-tycho/tycho#1015 ...)

@HannesWell
Copy link
Member Author

IIRC all jars deployed to Maven-Central have their pom embedded. So instead of relying on rules that have to be crafted for all dependencies the pom generator could check for those poms and derive the GAV from it.

Generator tool was written years ago at the time when using Maven Central was not directly usable and Orbit artifacts didn't contain this information. Unfortunately, it hasn't evolved since then and we are probably better relying on Tycho to do that part instead.

Relaying on Tycho sounds even better. And I didn't want to blame anyone, just suggest an improvement for the future. :)

@akurtakov
Copy link
Member

Relaying on Tycho sounds even better. And I didn't want to blame anyone, just suggest an improvement for the future. :)

Not taken as blaming someone at all. There are tons of things that are stale in the past combined with not many people trying to modernize things (in a graceful way!) and community slow on adapting new things and we came to what we see today.

@sravanlakkimsetti
Copy link
Member

sravanlakkimsetti added a commit to eclipse-platform/eclipse.platform.releng that referenced this issue Jun 15, 2022
sravanlakkimsetti added a commit to eclipse-platform/eclipse.platform.releng that referenced this issue Jun 15, 2022
@HannesWell
Copy link
Member Author

HannesWell commented Jun 15, 2022 via email

@sravanlakkimsetti
Copy link
Member

Raised https://issues.sonatype.org/browse/OSSRH-81766 to get offending artifacts removed. Lets wait for maven central to act there

@sravanlakkimsetti
Copy link
Member

Raised https://issues.sonatype.org/browse/OSSRH-81766 to get offending artifacts removed. Lets wait for maven central to act there

the offending artifacts have been removed from maven central. Please try now

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

No branches or pull requests

6 participants