Skip to content

Commit

Permalink
feat(jpms): add module-info.java definitions
Browse files Browse the repository at this point in the history
- feat(jpms): add module definitions
- feat(jpms): upgrade to jakarta inject
- feat(jpms): ship as multi-release jars
- test(jpms): add scripts to test modular jars

Signed-off-by: Sam Gammon <[email protected]>
  • Loading branch information
sgammon committed Apr 15, 2024
1 parent cd7e88a commit 5e2ec7c
Show file tree
Hide file tree
Showing 42 changed files with 918 additions and 96 deletions.
28 changes: 26 additions & 2 deletions maven-resolver-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
<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>
<Bundle-SymbolicName>org.apache.maven.resolver.api</Bundle-SymbolicName>
</properties>

<dependencies>
Expand All @@ -55,6 +54,31 @@
<groupId>com.github.siom79.japicmp</groupId>
<artifactId>japicmp-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>default-compile</id>
<configuration>
<excludes>
<exclude>module-info.java</exclude>
</excludes>
</configuration>
</execution>
<execution>
<id>compile-java-9</id>
<goals>
<goal>compile</goal>
</goals>
<phase>compile</phase>
<configuration>
<release>9</release>
<multiReleaseOutput>true</multiReleaseOutput>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
Expand Down
38 changes: 38 additions & 0 deletions maven-resolver-api/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

/**
* Maven Resolver API
*/
module org.apache.maven.resolver {
requires java.base;

exports org.eclipse.aether;
exports org.eclipse.aether.artifact;
exports org.eclipse.aether.collection;
exports org.eclipse.aether.deployment;
exports org.eclipse.aether.graph;
exports org.eclipse.aether.installation;
exports org.eclipse.aether.metadata;
exports org.eclipse.aether.repository;
exports org.eclipse.aether.resolution;
exports org.eclipse.aether.scope;
exports org.eclipse.aether.transfer;
exports org.eclipse.aether.version;
}
32 changes: 28 additions & 4 deletions maven-resolver-connector-basic/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
<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>
<Bundle-SymbolicName>org.apache.maven.resolver.connector.basic</Bundle-SymbolicName>
</properties>

<dependencies>
Expand All @@ -50,8 +49,8 @@
<artifactId>maven-resolver-util</artifactId>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<groupId>jakarta.inject</groupId>
<artifactId>jakarta.inject-api</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
Expand Down Expand Up @@ -87,6 +86,31 @@
<groupId>org.eclipse.sisu</groupId>
<artifactId>sisu-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>default-compile</id>
<configuration>
<excludes>
<exclude>module-info.java</exclude>
</excludes>
</configuration>
</execution>
<execution>
<id>compile-java-9</id>
<goals>
<goal>compile</goal>
</goals>
<phase>compile</phase>
<configuration>
<release>9</release>
<multiReleaseOutput>true</multiReleaseOutput>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
Expand Down
31 changes: 31 additions & 0 deletions maven-resolver-connector-basic/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

/**
* Maven Resolver Connector (Basic)
*/
module org.apache.maven.resolver.connector.basic {
requires static java.inject;
requires org.slf4j;
requires org.apache.maven.resolver;
requires org.apache.maven.resolver.spi;
requires org.apache.maven.resolver.util;

exports org.eclipse.aether.connector.basic;
}
4 changes: 2 additions & 2 deletions maven-resolver-demos/maven-resolver-demo-snippets/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@
<version>${maven3Version}</version>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<groupId>jakarta.inject</groupId>
<artifactId>jakarta.inject-api</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.sisu</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@
package org.apache.maven.resolver.examples;

import org.apache.maven.resolver.examples.util.Booter;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

/**
* Runs all demos at once as part of UT.
*/
@Disabled
public class AllResolverDemosTest {
@Test
void supplier() throws Exception {
Expand Down
15 changes: 11 additions & 4 deletions maven-resolver-generator-gnupg/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
<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>
<Bundle-SymbolicName>org.apache.maven.resolver.generator.gnupg</Bundle-SymbolicName>

<javaVersion>17</javaVersion>
<bouncycastleVersion>1.78</bouncycastleVersion>
<argLine>-XX:+EnableDynamicAgentLoading</argLine>
</properties>

<dependencies>
Expand All @@ -57,8 +57,8 @@
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<groupId>jakarta.inject</groupId>
<artifactId>jakarta.inject-api</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
Expand Down Expand Up @@ -135,6 +135,13 @@
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>@{argLine} --add-reads=org.bouncycastle.pg=org.bouncycastle.util</argLine>
</configuration>
</plugin>
</plugins>
</build>
</project>
33 changes: 33 additions & 0 deletions maven-resolver-generator-gnupg/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

/**
* Maven Resolver (GPG Generator)
*/
module org.apache.maven.resolver.generator.gnupg {
requires static java.inject;
requires org.bouncycastle.pg;
requires org.bouncycastle.provider;
requires org.bouncycastle.util;
requires org.eclipse.sisu.inject;
requires org.slf4j;
requires org.apache.maven.resolver;
requires org.apache.maven.resolver.spi;
requires org.apache.maven.resolver.util;
}
32 changes: 28 additions & 4 deletions maven-resolver-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
<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>
<Bundle-SymbolicName>org.apache.maven.resolver.impl</Bundle-SymbolicName>
</properties>

<dependencies>
Expand All @@ -54,8 +53,8 @@
<artifactId>maven-resolver-util</artifactId>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<groupId>jakarta.inject</groupId>
<artifactId>jakarta.inject-api</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
Expand Down Expand Up @@ -108,6 +107,31 @@
<groupId>org.eclipse.sisu</groupId>
<artifactId>sisu-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>default-compile</id>
<configuration>
<excludes>
<exclude>module-info.java</exclude>
</excludes>
</configuration>
</execution>
<execution>
<id>compile-java-9</id>
<goals>
<goal>compile</goal>
</goals>
<phase>compile</phase>
<configuration>
<release>9</release>
<multiReleaseOutput>true</multiReleaseOutput>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
Expand Down
30 changes: 30 additions & 0 deletions maven-resolver-impl/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

/**
* Maven Resolver Implementation
*/
module org.apache.maven.resolver.impl {
requires static java.inject;
requires org.slf4j;
requires org.apache.maven.resolver;
requires org.apache.maven.resolver.spi;
requires org.apache.maven.resolver.named;
requires org.apache.maven.resolver.util;
}
4 changes: 2 additions & 2 deletions maven-resolver-named-locks-hazelcast/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
<version>5.3.7</version>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<groupId>jakarta.inject</groupId>
<artifactId>jakarta.inject-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
4 changes: 2 additions & 2 deletions maven-resolver-named-locks-redisson/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@
</exclusions>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<groupId>jakarta.inject</groupId>
<artifactId>jakarta.inject-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
Loading

0 comments on commit 5e2ec7c

Please sign in to comment.