Add module-info support and run CI with Java 11#1948
Conversation
|
Release/snapshot process happens on jdk8... only a couple of modules are released using jdk11 |
|
If release/snapshot happens on jdk8 then moditect cannot be used and thus no module infos. |
velo
left a comment
There was a problem hiding this comment.
New toolchain build in place.... build passes just have a few improvements ideas.
annotation-error-decoder/pom.xml
Outdated
| <build> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>org.moditect</groupId> |
There was a problem hiding this comment.
Move to the top pom, and skip plugin on the one project that can't be excuted
There was a problem hiding this comment.
OK. This adding the moditect plugin to the parent, enabled by default, skip on no modular projects, right?
pom.xml
Outdated
| <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
| <project.build.resourceEncoding>UTF-8</project.build.resourceEncoding> | ||
|
|
||
| <moditect.skip>true</moditect.skip> |
There was a problem hiding this comment.
Can we make default false and only declare skip = true on modules that need it?
So most submodules will be unchanged
There was a problem hiding this comment.
Be aware that the root must skip otherwise it will trigger an error, that's why the default is set to true.
| <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> |
There was a problem hiding this comment.
can we move this whole section to line 533 (outside pluginManagement), I see no reason to keep it in here
There was a problem hiding this comment.
Yes, it can be safely moved.
There was a problem hiding this comment.
Yeah. I moved, push and merged... didn't realized the push got a conflict and didn't moved 🤦♂️
* Adds explicit module descriptors to a subset of modules (#1943) Fixes #1357 * Configure CI to run with Java 11 * Configure moditect for all modules, enable only on those that required it * Do not skip moditect when running tests * Only skip modules that don't work with moditect plugin --------- Co-authored-by: Marvin Froeder <velo@users.noreply.github.com> Co-authored-by: Marvin Froeder <velobr@gmail.com>
* Adds explicit module descriptors to a subset of modules (#1943) Fixes #1357 * Configure CI to run with Java 11 * Configure moditect for all modules, enable only on those that required it * Do not skip moditect when running tests * Only skip modules that don't work with moditect plugin --------- Co-authored-by: Marvin Froeder <velo@users.noreply.github.com> Co-authored-by: Marvin Froeder <velobr@gmail.com>
Related to #1943
I can confirm that
./mvnw verify -Dmoditect.skip=trueworks with Java 8. This additional flag is set when running tests.The CNFE seen at #1943 no longer occurs when running the build with Java 8.