Java 11 is not set
jponge opened this issue · comments
The project now uses Java 11 it seems, but:
- the compiler plugin is not set to release 11, and
- the import sort plugin is not set to Java 11 as well, causing errors on
module-info.java
This can be fixed in project as in:
<plugin>
<!-- Overridden from Smallrye build parent for module-info.java support -->
<groupId>net.revelc.code</groupId>
<artifactId>impsort-maven-plugin</artifactId>
<version>${version.impsort.plugin}</version>
<configuration>
<compliance>${maven-compiler-plugin.release}</compliance>
<groups>java.,javax.,jakarta.,org.,com.</groups>
<staticGroups>*</staticGroups>
<skip>${format.skip}</skip>
<removeUnused>true</removeUnused>
</configuration>
<executions>
<execution>
<id>sort-imports</id>
<goals>
<goal>sort</goal>
</goals>
</execution>
</executions>
</plugin>
But perhaps that shall be set in smallrye-build-parent
, unless not all SmallRye projects shall have moved to Java 11, @radcortez WDYT?
Also see #147 for JPMS puzzlers.
Shouldn't the java11 as base be only used in a specific "branch"/"profile". What about projects that, unfortunately, must stay on java 8 for a bit longeR?
Perhaps this and #147 shall be closed, with the project being built/tested on Java 11 but remaining 8 compliant.
But perhaps that shall be set in
smallrye-build-parent
, unless not all SmallRye projects shall have moved to Java 11, @radcortez WDYT?
The plan is to move everything to 11 with the jakarta rename.
Shouldn't the java11 as base be only used in a specific "branch"/"profile". What about projects that, unfortunately, must stay on java 8 for a bit longeR?
Which projects are you thinking of that need to remain on 8?
Perhaps this and #147 shall be closed, with the project being built/tested on Java 11 but remaining 8 compliant.
Will it work if we drop the JDK 8 builds and use JDK 11 with source and target 8? Or do you need release 11 to make module-info
work properly?
A "correct" module descriptor could be:
module io.smallrye.common.annotation {
requires static jakarta.enterprise.cdi.api;
requires static jakarta.inject.api;
exports io.smallrye.common.annotation;
}
(note that the jakarta
modules export javax.enterprise
types...) /cc @dmlloyd
Now 8 vs 11 depends on how you get that module-info.class
into your artefact.
- The Maven compiler plugin can compile from source and do some checks when on 11
- Otherwise you need Moditect (which we've used) or David's plugin (I haven't tested)
If it works to use 11 to build on 8 and the module-info is correct , I'm ok with that.
I don't know if the compiler Maven plugin will be happy compiling a module-info.java
with a target platform of 8
That is why I was asking :)
LGTM thanks for your efforts @dmlloyd
I'll do a Mutiny release once we have a new smallrye-common
release to align the module references.