Hi Bryan,

I have recently the same issue with a plugin I am developing, some of the 
libraries I use do not support Java 8 anymore so the plugin will work only 
on Jenkins instances running on JDK 11+. The change of the java.level to 11 
will not work directly you have to overwrite some of the configurations 
that the parent pom made, this is the build config changes you will need.

<properties>
...
<java.level>11</java.level>
</properties>

<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <configuration>
        <source>${java.level}</source>
        <target>${java.level}</target>
        <testSource>${java.level}</testSource>
        <testTarget>${java.level}</testTarget>
      </configuration>
    </plugin>
    <!-- https://github.com/mojohaus/animal-sniffer/issues/62 after Java 9 
the there is no signatures with animal sniffer, the recommended way is to 
use releases with the maven-compiler-plugin -->
    <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>animal-sniffer-maven-plugin</artifactId>
      <configuration>
        <signature>
          <groupId>org.codehaus.mojo.signature</groupId>
          <artifactId>java18</artifactId>
        </signature>
      </configuration>
    </plugin>
  </plugins>
</build>

El jueves, 27 de mayo de 2021 a las 20:36:29 UTC+2, [email protected] 
escribió:

> You should not switch your plugin to Java 11 unless Jenkins core switches 
> to Java 11. Otherwise your plugin will not work in Jenkins instances that 
> run with Java 8. So do not expect a solution until that step has been 
> announced. 
>
> Am 27.05.2021 um 20:01 schrieb Bryan Stopp <[email protected]>:
>
>
> Was looking at updating my plugin to only build using Java11 and output 
> Java11 bytecode.
>
> But when I went to use 11 as the value of *java.level* in my pom, it 
> broke due to the plugins not understanding Java target of "1.11" (because 
> its supposed to be just "11").
>
> Is there a plan to update/release a plugin parent pom that is 
> predominantly configured to support only Java11?
>
> Thanks,
>
> -Bryan
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-dev/55720f8e-4944-49e1-ae8a-bc00d34fc50cn%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/jenkinsci-dev/55720f8e-4944-49e1-ae8a-bc00d34fc50cn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/e1355f37-f988-44e2-a9dc-a05a94a0efffn%40googlegroups.com.

Reply via email to