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

Add module-info support and run CI with Java 11 #1948

Merged
merged 7 commits into from
Feb 26, 2023
Merged
Show file tree
Hide file tree
Changes from 4 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: 4 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,11 @@ jobs:
key: feign-dependencies-{{ checksum "pom.xml" }}
- run:
name: 'Test'
# Do not generale module-info when running tests
# because one of the current JDK targets is 8
# Moditect requires 11 as a minimum
command: |
./mvnw -ntp -B test
./mvnw -ntp -B test -Dmoditect.skip=true
- verify-formatting

deploy:
Expand Down
1 change: 1 addition & 0 deletions annotation-error-decoder/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

<properties>
<main.basedir>${project.basedir}/..</main.basedir>
<moditect.skip>false</moditect.skip>
</properties>

<dependencies>
Expand Down
1 change: 1 addition & 0 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

<properties>
<main.basedir>${project.basedir}/..</main.basedir>
<moditect.skip>false</moditect.skip>
</properties>

<dependencies>
Expand Down
1 change: 1 addition & 0 deletions dropwizard-metrics4/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

<properties>
<main.basedir>${project.basedir}/..</main.basedir>
<moditect.skip>false</moditect.skip>
</properties>

<dependencies>
Expand Down
1 change: 1 addition & 0 deletions dropwizard-metrics5/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

<properties>
<main.basedir>${project.basedir}/..</main.basedir>
<moditect.skip>false</moditect.skip>
</properties>

<dependencies>
Expand Down
1 change: 1 addition & 0 deletions googlehttpclient/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

<properties>
<main.basedir>${project.basedir}/..</main.basedir>
<moditect.skip>false</moditect.skip>
</properties>

<dependencies>
Expand Down
1 change: 1 addition & 0 deletions gson/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

<properties>
<main.basedir>${project.basedir}/..</main.basedir>
<moditect.skip>false</moditect.skip>
</properties>

<dependencies>
Expand Down
1 change: 1 addition & 0 deletions hc5/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

<properties>
<main.basedir>${project.basedir}/..</main.basedir>
<moditect.skip>false</moditect.skip>
</properties>

<dependencies>
Expand Down
1 change: 1 addition & 0 deletions httpclient/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

<properties>
<main.basedir>${project.basedir}/..</main.basedir>
<moditect.skip>false</moditect.skip>
</properties>
<dependencyManagement>
<dependencies>
Expand Down
1 change: 1 addition & 0 deletions jackson-jaxb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@

<profiles>
<profile>
<id>java11</id>
<activation>
<jdk>11</jdk>
</activation>
Expand Down
1 change: 1 addition & 0 deletions jackson-jr/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

<properties>
<main.basedir>${project.basedir}/..</main.basedir>
<moditect.skip>false</moditect.skip>
</properties>

<dependencies>
Expand Down
1 change: 1 addition & 0 deletions jackson/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

<properties>
<main.basedir>${project.basedir}/..</main.basedir>
<moditect.skip>false</moditect.skip>
</properties>

<dependencies>
Expand Down
1 change: 1 addition & 0 deletions jakarta/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<properties>
<main.java.version>11</main.java.version>
<main.basedir>${project.basedir}/..</main.basedir>
<moditect.skip>false</moditect.skip>
</properties>

<dependencies>
Expand Down
1 change: 1 addition & 0 deletions java11/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<main.java.version>11</main.java.version>
<main.signature.artifact>java18</main.signature.artifact>
<main.basedir>${project.basedir}/..</main.basedir>
<moditect.skip>false</moditect.skip>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
Expand Down
1 change: 1 addition & 0 deletions jaxrs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

<properties>
<main.basedir>${project.basedir}/..</main.basedir>
<moditect.skip>false</moditect.skip>
</properties>

<dependencies>
Expand Down
1 change: 1 addition & 0 deletions json/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

<properties>
<main.basedir>${project.basedir}/..</main.basedir>
<moditect.skip>false</moditect.skip>
</properties>

<dependencies>
Expand Down
1 change: 1 addition & 0 deletions kotlin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

<properties>
<main.basedir>${project.basedir}/..</main.basedir>
<moditect.skip>false</moditect.skip>
<kotlin.version>1.8.10</kotlin.version>
<kotlinx.coroutines.version>1.6.4</kotlinx.coroutines.version>
</properties>
Expand Down
1 change: 1 addition & 0 deletions micrometer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

<properties>
<main.basedir>${project.basedir}/..</main.basedir>
<moditect.skip>false</moditect.skip>
<micrometer.version>1.10.4</micrometer.version>
</properties>

Expand Down
2 changes: 1 addition & 1 deletion mock/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

<properties>
<main.basedir>${project.basedir}/..</main.basedir>
<moditect.skip>false</moditect.skip>
</properties>

<dependencies>
Expand All @@ -48,5 +49,4 @@
<scope>test</scope>
</dependency>
</dependencies>

</project>
1 change: 1 addition & 0 deletions okhttp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

<properties>
<main.basedir>${project.basedir}/..</main.basedir>
<moditect.skip>false</moditect.skip>
</properties>

<dependencies>
Expand Down
37 changes: 37 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.resourceEncoding>UTF-8</project.build.resourceEncoding>

<moditect.skip>true</moditect.skip>
Copy link
Member

Choose a reason for hiding this comment

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

Can we make default false and only declare skip = true on modules that need it?

So most submodules will be unchanged

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Be aware that the root must skip otherwise it will trigger an error, that's why the default is set to true.

<!-- specifying jvm arguments -->
<jvm.options>-Duser.language=en</jvm.options>

Expand Down Expand Up @@ -112,6 +113,7 @@
<maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
<maven-deploy-plugin.version>3.1.0</maven-deploy-plugin.version>
<docker-maven-plugin.version>1.2.2</docker-maven-plugin.version>
<moditect-maven-plugin.version>1.0.0.RC2</moditect-maven-plugin.version>
</properties>
<url>https://github.com/openfeign/feign</url>
<inceptionYear>2012</inceptionYear>
Expand Down Expand Up @@ -460,6 +462,36 @@
</configuration>
</plugin>

<plugin>
<groupId>org.moditect</groupId>
<artifactId>moditect-maven-plugin</artifactId>
<version>${moditect-maven-plugin.version}</version>
<executions>
<execution>
<id>add-module-infos</id>
<phase>package</phase>
<goals>
<goal>add-module-info</goal>
</goals>
<configuration>
<skip>${moditect.skip}</skip>
<overwriteExistingFiles>true</overwriteExistingFiles>
<module>
<moduleInfo>
<!-- module name will be derived from filename -->
<!-- export everything -->
<exports>*;</exports>
<!-- declare services consumed by the artifact -->
<addServiceUses>true</addServiceUses>
</moduleInfo>
</module>
<jdepsExtraArgs>
<arg>--multi-release=9</arg>
</jdepsExtraArgs>
</configuration>
</execution>
</executions>
</plugin>
Comment on lines +465 to +494
Copy link
Member

Choose a reason for hiding this comment

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

can we move this whole section to line 533 (outside pluginManagement), I see no reason to keep it in here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it can be safely moved.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah. I moved, push and merged... didn't realized the push got a conflict and didn't moved 🤦‍♂️

</plugins>
</pluginManagement>

Expand Down Expand Up @@ -498,6 +530,11 @@
</executions>
</plugin>

<plugin>
<groupId>org.moditect</groupId>
<artifactId>moditect-maven-plugin</artifactId>
</plugin>

<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<inherited>true</inherited>
Expand Down
2 changes: 1 addition & 1 deletion reactive/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

<properties>
<main.basedir>${project.basedir}/..</main.basedir>
<moditect.skip>false</moditect.skip>
<reactor.version>3.5.2</reactor.version>
<reactive.streams.version>1.0.4</reactive.streams.version>
<reactivex.version>2.2.21</reactivex.version>
Expand Down Expand Up @@ -94,5 +95,4 @@
<scope>test</scope>
</dependency>
</dependencies>

</project>
1 change: 1 addition & 0 deletions sax/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

<properties>
<main.basedir>${project.basedir}/..</main.basedir>
<moditect.skip>false</moditect.skip>
</properties>

<dependencies>
Expand Down
1 change: 1 addition & 0 deletions slf4j/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

<properties>
<main.basedir>${project.basedir}/..</main.basedir>
<moditect.skip>false</moditect.skip>
</properties>

<dependencies>
Expand Down
3 changes: 1 addition & 2 deletions spring4/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<properties>
<main.basedir>${project.basedir}/..</main.basedir>

<moditect.skip>false</moditect.skip>
<spring.version>4.3.30.RELEASE</spring.version>
</properties>

Expand Down Expand Up @@ -61,5 +61,4 @@
<scope>test</scope>
</dependency>
</dependencies>

</project>