-
Notifications
You must be signed in to change notification settings - Fork 21
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
Import-Package and other requirements not translated as Maven #71
Conversation
Note that this requires the latest tools from https://download.eclipse.org/cbi/updates/p2-aggregator/tools/nightly/latest to try it in the IDE. Installing these will allow to edit both the resources in their structured editors: I used the analyzer to ensure that every dependency maps to an artifact and that every version range resolves to an actual version that actually exists in Maven. The view gives an overview of all the generated poms. Here you can see how a package import is mapped to a dependency: The log will contain information about potential problems or cases where a mapping is no longer needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See question inline. Overall, I'm questioning whether the fact of adding more rules is a good smell.
<mavenMappings namePattern="org.w3c.dom.events" groupId="org.eclipse.orbit.bundles" artifactId="org.w3c.dom.events"/> | ||
<mavenMappings namePattern="org.w3c.dom.smil" groupId="org.eclipse.orbit.bundles" artifactId="org.w3c.dom.smil"/> | ||
<mavenMappings namePattern="org.w3c.dom.svg" groupId="org.eclipse.orbit.bundles" artifactId="org.w3c.dom.svg"/> | ||
<mavenMappings namePattern=".*" groupId="\$maven-groupId\$" artifactId="\$maven-artifactId\$" versionPattern=".*" versionTemplate="\$maven-version\$"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather not having such rule explicitly defined. Is there any chance someone needs/wants to set things differently? It seems to me we don't want to offer flexibility here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I asked via email for your feedback in here but none was forthcoming:
eclipse-cbi/p2repo-aggregator#11
I think we/you can live with this explicit opt-in rule. I want to offer that flexibility to ensure that new behavior is opt-in rather than "we think this is best for you so you get it whether you want it or not."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"we think this is best for you so you get it whether you want it or not."
IMO, this usually results in better results. More configuration is more complexity, more room for errors; it is often less productive. I think this is the case here, and I don't see addition of this rule as an added-value over the current state (where this rule is hardcoded as default when possible) but more as an extra complication that doesn't make maintenance of this .aggr file, nor of the aggregator itself, easier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<mavenDependencyMapping iuNamePattern="(?!.*(org\.eclipse\.)).*|org\.eclipse\.emf.*|org\.eclipse\.ecf.*|org\.eclipse\.jetty.*" namespacePattern=".*" namePattern=".*" groupId="!" artifactId="!"/> | ||
<mavenDependencyMapping namespacePattern="java\.package" namePattern="(org.eclipse.jdt).internal.(compiler\.(apt|tool))" groupId="$1" artifactId="$1.$2"/> | ||
<mavenDependencyMapping namespacePattern="java\.package" namePattern="(org.eclipse.jdt).internal.(compiler\.apt)\..*" groupId="$1" artifactId="$1.$2"/> | ||
<mavenDependencyMapping namespacePattern="java\.package" namePattern="(org.eclipse.jdt)(.internal|.core)?.compiler.*" groupId="$1" artifactId="$1.core"/> | ||
<mavenDependencyMapping namespacePattern="java\.package" namePattern=".*" groupId="*" artifactId="*" versionRangePattern="(.*)"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't fully get why those parts would be necessary over what's existing.The CBI aggregator resolves a requirement to a bundle and the mavenMappings resolve those into a GAV. Why is this extra type/configuration necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This (mapping of package requirements and requirements in general) was described here:
eclipse-cbi/p2repo-aggregator#11 (comment)
But I already drew attention to that in the comment of this PR.
e5222f8
to
0836891
Compare
dependencies when generating pom Reduce the number of MavenMappings. Use the new CBI aggregator's features described here to map based Maven metadata in p2 and to build Maven dependencies from java.package requirements: eclipse-cbi/p2repo-aggregator#11 Disable the validation repositories because they're not needed given the platform repository itself contains all requirements, and keeping them also results analysis anomalies because Orbit IUs are resolved where direct-from-Maven IUs are actually in the repository.
This version I've checked with the aggregator analysis editor that all generated Maven dependencies resolve to ones that exist in Maven. The ones that don't are marked with ** and from the wrapped search you can see only the new never-before-published-to-maven plugin is marked that way: This additionally generates dependencies based on package imports which seems important given how much bundle requirements are being replaced by package imports. Publishing should of course use the latest version of the aggregator for the package import support (as well as for the new support to use the Maven coordinates from the p2 metadata): https://download.eclipse.org/cbi/updates/p2-aggregator/products/nightly/latest |
@akurtakov Should I merge this now? |
I would defer the decision to @mickaelistria or @sravanlakkimsetti as they spent time in this cycle to investigate publishing. |
While I have shared some concerns about the current approach compared to my "ideal" expectation, I still trust that @merks tested this well, and I reckon the current state is an improvement over current state. So I would be fine merging it if Ed is confident as well. |
I'd like to understand the maven publishing process better. Where can I learn more about how it works? The steps for EMF publishing to Maven are really quite complicated, and I only publish a small subset... |
There is https://wiki.eclipse.org/Platform-releng/Publish_To_Maven_Central which is more or less up-to-date. The effective entry point is /eclipse.platform.releng/publish-to-maven-central/CBIaggregator.sh , it does contain a bit of documentation inline about the process. |
One concern I have is with the pom enriching logic... In particular I think this assumes that there is not already a Lines 66 to 71 in b25099b
That method is called from here which assumes there is necessarily a Lines 76 to 82 in b25099b
I changed the logic to properly populate the name element and the description element, but plugins generally don't generally have a description so that element would be missing. I ran into this issue publishing EMF to Maven yesterday where the final Nexus check complained about the description being missing. I modified the EMF pom enhancer to set the description to the name if the description was missing, but now I've also restored the logic in the aggregator such that if there is no description the name will be used as the description, so the aggregator produces a pom like this: This is what leads me to be concerned that the current enhancer logic will create two Note too that org.eclipse.platform.releng.maven.pom.ArtifactInfo is full of assumptions about git.eclipse.org as the SCM. I suppose it would be better to create a new issue... |
@merks can you please open a dedicated issue about the name/description concerns? |
I’m out of the office the rest of the day with only my iPhone. So not until much later. |
dependencies when generating pom
Reduce the number of MavenMappings.
Use the new CBI aggregators features described here to map based Maven
metadata in p2 and to build Maven dependencies from java.package
requirements:
eclipse-cbi/p2repo-aggregator#11
Disable the validation repositories because they're not needed given the
platform repository itself contains all requirements, and keeping them
also results analysis anomalies because Orbit IUs are resolved where
direct-from-Maven IUs are actually in the repository.
#67