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

[Build] Define all MANIFEST.MF entries through the bnd-maven-plugin #517

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions maven-resolver-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@
<description>The application programming interface for the repository system.</description>

<properties>
<Automatic-Module-Name>org.apache.maven.resolver</Automatic-Module-Name>
<Bundle-SymbolicName>${Automatic-Module-Name}.api</Bundle-SymbolicName>
<bnd.instructions.additions><![CDATA[
Automatic-Module-Name: org.apache.maven.resolver
]]></bnd.instructions.additions>
</properties>

<dependencies>
Expand Down
5 changes: 0 additions & 5 deletions maven-resolver-connector-basic/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@
<name>Maven Artifact Resolver Connector Basic</name>
<description>A repository connector implementation for repositories using URI-based layouts.</description>

<properties>
<Automatic-Module-Name>org.apache.maven.resolver.connector.basic</Automatic-Module-Name>
<Bundle-SymbolicName>${Automatic-Module-Name}</Bundle-SymbolicName>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
Expand Down
3 changes: 0 additions & 3 deletions maven-resolver-generator-gnupg/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
<description>A generator implementation for GnuPG signatures.</description>

<properties>
<Automatic-Module-Name>org.apache.maven.resolver.generator.gnupg</Automatic-Module-Name>
<Bundle-SymbolicName>${Automatic-Module-Name}</Bundle-SymbolicName>

<javaVersion>17</javaVersion>
<bouncycastleVersion>1.78.1</bouncycastleVersion>
</properties>
Expand Down
5 changes: 0 additions & 5 deletions maven-resolver-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@
<name>Maven Artifact Resolver Implementation</name>
<description>An implementation of the repository system.</description>

<properties>
<Automatic-Module-Name>org.apache.maven.resolver.impl</Automatic-Module-Name>
<Bundle-SymbolicName>${Automatic-Module-Name}</Bundle-SymbolicName>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
Expand Down
5 changes: 0 additions & 5 deletions maven-resolver-named-locks-hazelcast/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@
<name>Maven Artifact Resolver Named Locks using Hazelcast</name>
<description>A synchronization utility implementation using Hazelcast.</description>

<properties>
<Automatic-Module-Name>org.apache.maven.resolver.named.hazelcast</Automatic-Module-Name>
<Bundle-SymbolicName>${Automatic-Module-Name}</Bundle-SymbolicName>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
Expand Down
3 changes: 0 additions & 3 deletions maven-resolver-named-locks-redisson/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
<description>A synchronization utility implementation using Redisson.</description>

<properties>
<Automatic-Module-Name>org.apache.maven.resolver.named.redisson</Automatic-Module-Name>
<Bundle-SymbolicName>${Automatic-Module-Name}</Bundle-SymbolicName>

<testcontainersVersion>1.19.8</testcontainersVersion>
</properties>

Expand Down
5 changes: 0 additions & 5 deletions maven-resolver-named-locks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@
<name>Maven Artifact Resolver Named Locks</name>
<description>A synchronization utility implementation using Named locks.</description>

<properties>
<Automatic-Module-Name>org.apache.maven.resolver.named</Automatic-Module-Name>
<Bundle-SymbolicName>${Automatic-Module-Name}</Bundle-SymbolicName>
</properties>

<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
Expand Down
5 changes: 0 additions & 5 deletions maven-resolver-spi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@
<name>Maven Artifact Resolver SPI</name>
<description>The service provider interface for repository system implementations and repository connectors.</description>

<properties>
<Automatic-Module-Name>org.apache.maven.resolver.spi</Automatic-Module-Name>
<Bundle-SymbolicName>${Automatic-Module-Name}</Bundle-SymbolicName>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
Expand Down
5 changes: 3 additions & 2 deletions maven-resolver-supplier-mvn3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@
<description>A helper module to provide RepositorySystem instances.</description>

<properties>
<Automatic-Module-Name>org.apache.maven.resolver.supplier</Automatic-Module-Name>
<Bundle-SymbolicName>${Automatic-Module-Name}</Bundle-SymbolicName>
<bnd.instructions.additions><![CDATA[
Bundle-SymbolicName: org.apache.maven.resolver.supplier
]]></bnd.instructions.additions>
</properties>

<dependencies>
Expand Down
6 changes: 3 additions & 3 deletions maven-resolver-supplier-mvn4/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@

<properties>
<javaVersion>17</javaVersion>

<Automatic-Module-Name>org.apache.maven.resolver.supplier</Automatic-Module-Name>
<Bundle-SymbolicName>${Automatic-Module-Name}</Bundle-SymbolicName>
<bnd.instructions.additions><![CDATA[
Bundle-SymbolicName: org.apache.maven.resolver.supplier
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the behaviour since maven-resolver-supplier-mvn3 and maven-resolver-supplier-mvn4 end up with the same symbolic name / module name ? Isn't that a problem ?

Copy link
Member

Choose a reason for hiding this comment

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

my "non-expert" opinion: IMO no, as only one can be used at one time, or in other words, I see no use case when you want both in the same container?

Copy link
Contributor

Choose a reason for hiding this comment

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

Well, that's OSGi, so it's supposed to support different versions of the same packages/services to be deployed in the same container...

Copy link
Contributor

Choose a reason for hiding this comment

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

@HannesWell is there any real OSGi use case ? like pax-url or something like that ? Or is that just to be able to use Maven inside Eclipse ?
More specifically, is there any use of OSGi services, or just the package wiring layer ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When using both in the same OSGi runtime it could indeed become a challenge and will probably depend on the runtime configuration how multiple bundles with same ID and version are handled.
If they had different version, e.g. aligned with the targeted maven version it wouldn't be a problem, but I don't think that's what you want and also what's suitable here.

Solutions could be to say that one should only use one of both or we add a corresponding name suffix like for the maven artifactId?
I can implement it as you prefer.

Copy link
Contributor

@gnodet gnodet Jun 25, 2024

Choose a reason for hiding this comment

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

Fwiw, the maven 4 based supplier is a bit off. It should now looks like
https://github.com/apache/maven/blob/master/maven-api-impl/src/test/java/org/apache/maven/internal/impl/standalone/RepositorySystemSupplier.java
That said, I don't think it's a good idea to tie a resolver jar so closely with maven private implementation classes... It should really be the opposite and the supplier should be provided by maven.
IIRC, those two suppliers are mostly for demos, right @cstamas ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That said, I don't think it's a good idea to tie a resolver jar so closely with maven private implementation classes... It should really be the opposite and the supplier should be provided by maven.

I have to say that I just learned the resolver last week from the nice demos (I new it exists and what it does longer before but have not worked with it) so my opinions are probably not that qualified.
But yes I understood the supplier as 'standalone' integration of the resolver with maven (as you say in the doc, in general the resolver can work with any kind of back-end and Maven is just one, probably the most prominent and driving one).
From that POV it is indeed a back-reference in the dependency graph to have maven-resolver-supplier in maven-resolver.
In maven there is already the maven-resolver-provider, would it make sense to merge the maven-resolver-supplier into that?

Copy link
Member

Choose a reason for hiding this comment

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

@HannesWell are you aware of https://github.com/maveniverse/mima ? As it's maybe what you really need, as Resolver supplier provides really only the "basic experience". Also, see here:
https://issues.apache.org/jira/browse/MNG-8163?focusedCommentId=17856703&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17856703

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@HannesWell are you aware of https://github.com/maveniverse/mima ? As it's maybe what you really need, as Resolver supplier provides really only the "basic experience".

Not yet. Thanks for the hint. I'll have a closer look at it.

Also, see here:
https://issues.apache.org/jira/browse/MNG-8163?focusedCommentId=17856703&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17856703

Yes that's an interesting discussion and I follow it. I just couldn't contribute anything useful (yet).
But after thinking again about this discussion, the argument that the supplier uses resolver-impl also made me wonder if moving that part to maven is really the right step.
But from your comment in that issue I assume that this is a bigger discussion that might only be solved in resolver 3.0.

Btw. should we have another issue or just PR to have different names for the bundles for resolver-supper for maven 3 and 4? Or do you think we should keep it as it is now?

Copy link
Contributor

Choose a reason for hiding this comment

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

@HannesWell are you aware of https://github.com/maveniverse/mima ? As it's maybe what you really need, as Resolver supplier provides really only the "basic experience".

Not yet. Thanks for the hint. I'll have a closer look at it.

Also, see here:
https://issues.apache.org/jira/browse/MNG-8163?focusedCommentId=17856703&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17856703

Yes that's an interesting discussion and I follow it. I just couldn't contribute anything useful (yet). But after thinking again about this discussion, the argument that the supplier uses resolver-impl also made me wonder if moving that part to maven is really the right step. But from your comment in that issue I assume that this is a bigger discussion that might only be solved in resolver 3.0.

Btw. should we have another issue or just PR to have different names for the bundles for resolver-supper for maven 3 and 4? Or do you think we should keep it as it is now?

We also need to take into account the Maven 4 API which kinda hides the resolver API... it may be easier to integrate in the near future.

]]></bnd.instructions.additions>
</properties>

<dependencies>
Expand Down
3 changes: 0 additions & 3 deletions maven-resolver-test-http/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
<description>A collection of utility classes to ease testing of HTTP transports.</description>

<properties>
<Automatic-Module-Name>org.apache.maven.resolver.test.http</Automatic-Module-Name>
<Bundle-SymbolicName>${Automatic-Module-Name}</Bundle-SymbolicName>

<javaVersion>11</javaVersion>
</properties>

Expand Down
5 changes: 0 additions & 5 deletions maven-resolver-test-util/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@
<name>Maven Artifact Resolver Test Utilities</name>
<description>A collection of utility classes to ease testing of the repository system.</description>

<properties>
<Automatic-Module-Name>org.apache.maven.resolver.test.util</Automatic-Module-Name>
<Bundle-SymbolicName>${Automatic-Module-Name}</Bundle-SymbolicName>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
Expand Down
3 changes: 0 additions & 3 deletions maven-resolver-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
<properties>
<javaVersion>17</javaVersion>
<maven.deploy.skip>true</maven.deploy.skip>

<Automatic-Module-Name>org.apache.maven.resolver.tools</Automatic-Module-Name>
<Bundle-SymbolicName>${Automatic-Module-Name}</Bundle-SymbolicName>
</properties>

<dependencies>
Expand Down
5 changes: 0 additions & 5 deletions maven-resolver-transport-apache/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@
<name>Maven Artifact Resolver Transport Apache</name>
<description>A transport implementation for repositories using http:// and https:// URLs.</description>

<properties>
<Automatic-Module-Name>org.apache.maven.resolver.transport.apache</Automatic-Module-Name>
<Bundle-SymbolicName>${Automatic-Module-Name}</Bundle-SymbolicName>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
Expand Down
5 changes: 0 additions & 5 deletions maven-resolver-transport-classpath/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@
<name>Maven Artifact Resolver Transport Classpath</name>
<description>A transport implementation for repositories using classpath:// URLs.</description>

<properties>
<Automatic-Module-Name>org.apache.maven.resolver.transport.classpath</Automatic-Module-Name>
<Bundle-SymbolicName>${Automatic-Module-Name}</Bundle-SymbolicName>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
Expand Down
5 changes: 0 additions & 5 deletions maven-resolver-transport-file/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@
<name>Maven Artifact Resolver Transport File</name>
<description>A transport implementation for repositories using file:// URLs.</description>

<properties>
<Automatic-Module-Name>org.apache.maven.resolver.transport.file</Automatic-Module-Name>
<Bundle-SymbolicName>${Automatic-Module-Name}</Bundle-SymbolicName>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
<description>Maven Artifact Transport JDK Java 11+.</description>

<properties>
<Automatic-Module-Name>org.apache.maven.resolver.transport.jdk</Automatic-Module-Name>
<Bundle-SymbolicName>${Automatic-Module-Name}</Bundle-SymbolicName>

<javaVersion>11</javaVersion>
</properties>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
<description>Maven Artifact Transport JDK Java 11+.</description>

<properties>
<Automatic-Module-Name>org.apache.maven.resolver.transport.jdk</Automatic-Module-Name>
<Bundle-SymbolicName>${Automatic-Module-Name}</Bundle-SymbolicName>

<javaVersion>21</javaVersion>
</properties>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
<description>Maven Artifact Transport JDK Java 11+.</description>

<properties>
<Automatic-Module-Name>org.apache.maven.resolver.transport.jdk</Automatic-Module-Name>
<Bundle-SymbolicName>${Automatic-Module-Name}</Bundle-SymbolicName>

<javaVersion>8</javaVersion>
</properties>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
<description>Maven Artifact Transport JDK Java 11+.</description>

<properties>
<Automatic-Module-Name>org.apache.maven.resolver.transport.jdk</Automatic-Module-Name>
<Bundle-SymbolicName>${Automatic-Module-Name}</Bundle-SymbolicName>

<bnd.instructions.additions><![CDATA[
Multi-Release: true
]]></bnd.instructions.additions>
<javaVersion>11</javaVersion>
</properties>

Expand Down Expand Up @@ -149,18 +149,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
<manifestEntries>
<Multi-Release>true</Multi-Release>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
3 changes: 0 additions & 3 deletions maven-resolver-transport-jetty/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
<description>Maven Artifact Transport Jetty.</description>

<properties>
<Automatic-Module-Name>org.apache.maven.resolver.transport.jetty</Automatic-Module-Name>
<Bundle-SymbolicName>${Automatic-Module-Name}</Bundle-SymbolicName>

<javaVersion>11</javaVersion>
</properties>

Expand Down
5 changes: 0 additions & 5 deletions maven-resolver-transport-wagon/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@
<name>Maven Artifact Resolver Transport Wagon</name>
<description>A transport implementation based on Maven Wagon.</description>

<properties>
<Automatic-Module-Name>org.apache.maven.resolver.transport.wagon</Automatic-Module-Name>
<Bundle-SymbolicName>${Automatic-Module-Name}</Bundle-SymbolicName>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
Expand Down
5 changes: 0 additions & 5 deletions maven-resolver-util/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@
<name>Maven Artifact Resolver Utilities</name>
<description>A collection of utility classes to ease usage of the repository system.</description>

<properties>
<Automatic-Module-Name>org.apache.maven.resolver.util</Automatic-Module-Name>
<Bundle-SymbolicName>${Automatic-Module-Name}</Bundle-SymbolicName>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
<project.build.outputTimestamp>2024-04-26T11:50:22Z</project.build.outputTimestamp>
<!-- site fixes: skip PMD as it does not support Java 21 -->
<pmd.skip>true</pmd.skip>
<bnd.instructions.additions />
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -606,11 +607,13 @@
<version>7.0.0</version>
<configuration>
<bnd><![CDATA[
Bundle-SymbolicName: ${Bundle-SymbolicName}
Bundle-SymbolicName: org.apache.${replacestring;${project.artifactId};-;.}
Automatic-Module-Name: ${Bundle-SymbolicName}
# Export packages not containing the substring 'internal'
-exportcontents: ${removeall;${packages};${packages;NAMED;*internal*}}
# Reproducible build
-noextraheaders: true
${bnd.instructions.additions}
]]></bnd>
</configuration>
</plugin>
Expand All @@ -620,9 +623,6 @@
<configuration>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
<manifestEntries>
<Automatic-Module-Name>${Automatic-Module-Name}</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</plugin>
Expand Down