List annotation processors explicitly (#27162)

Co-authored-by: Mark Waite <mark.earl.waite@gmail.com>
This commit is contained in:
Tim JacombandMark Waite authored and GitHub committed 2026-08-06 16:51:52 +01:00
1 parent 031dceb475
commit ce77ef5158
6 files changed
+120 -2

No files matched your search

+21
View File
@@ -103,6 +103,19 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<!-- Indexes @Restricted; version resolves from dependencyManagement (jenkins-bom) -->
<path>
<groupId>org.jenkins-ci</groupId>
<artifactId>annotation-indexer</artifactId>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<!-- Version specified in grandparent POM -->
@@ -163,6 +176,14 @@
them. BouncyCastle et al. run on their base classes.
-->
<exclude>META-INF/versions/**</exclude>
<!--
annotation-indexer declares an annotation processor. Relocating it leaves this
uber jar advertising io.jenkins.cli.shaded...AnnotationProcessorImpl, so javac
runs it in every module that compiles against the CLI. It can never match
anything, since the annotations it looks for are relocated too, but it does
defeat compile avoidance. A runtime CLI jar has no compile-time processor.
-->
<exclude>META-INF/services/javax.annotation.processing.Processor</exclude>
</excludes>
</filter>
</filters>
+43 -2
View File
@@ -43,6 +43,8 @@ THE SOFTWARE.
<remoting.minimum.supported.version>3176.v207ec082a_8c0</remoting.minimum.supported.version>
<!-- Filled in by jacoco-maven-plugin -->
<jacocoSurefireArgs />
<!-- Not managed by jenkins-bom, so referenced from annotationProcessorPaths via this property -->
<core-annotation-processors.version>59.ve181f58722c6</core-annotation-processors.version>
</properties>
<dependencyManagement>
@@ -416,10 +418,12 @@ THE SOFTWARE.
<scope>provided</scope>
</dependency>
<dependency>
<!-- working around MCOMPILER-97 -->
<!-- Also listed in annotationProcessorPaths above; kept as a dependency so that
jenkins-core continues to ship META-INF/services/javax.annotation.processing.Processor
for plugin builds. -->
<groupId>org.jenkins-ci</groupId>
<artifactId>core-annotation-processors</artifactId>
<version>59.ve181f58722c6</version>
<version>${core-annotation-processors.version}</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
@@ -470,6 +474,43 @@ THE SOFTWARE.
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<!--
Declare the annotation processors explicitly rather than letting javac discover them by
scanning the whole compile classpath.
-->
<annotationProcessorPaths>
<path>
<groupId>net.java.sezpoz</groupId>
<artifactId>sezpoz</artifactId>
</path>
<path>
<groupId>org.jenkins-ci</groupId>
<artifactId>annotation-indexer</artifactId>
</path>
<path>
<groupId>org.jenkins-ci</groupId>
<artifactId>core-annotation-processors</artifactId>
<version>${core-annotation-processors.version}</version>
</path>
<path>
<groupId>org.kohsuke</groupId>
<artifactId>windows-package-checker</artifactId>
</path>
<path>
<groupId>org.kohsuke.metainf-services</groupId>
<artifactId>metainf-services</artifactId>
</path>
<path>
<groupId>org.kohsuke.stapler</groupId>
<artifactId>stapler</artifactId>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
+31
View File
@@ -291,6 +291,37 @@ THE SOFTWARE.
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<!-- Indexes @Extension, @TestExtension, @OptionalExtension, @Symbol, @Restricted,
@Initializer, @ExportedBean and @JmhBenchmark under META-INF -->
<path>
<groupId>org.jenkins-ci</groupId>
<artifactId>annotation-indexer</artifactId>
</path>
<!-- Writes the binary META-INF/annotations indexes -->
<path>
<groupId>net.java.sezpoz</groupId>
<artifactId>sezpoz</artifactId>
</path>
<!-- Emits the *.stapler constructor-parameter files -->
<path>
<groupId>org.kohsuke.stapler</groupId>
<artifactId>stapler</artifactId>
</path>
<!--
Generates META-INF/BenchmarkList and META-INF/CompilerHints for the JMH benchmarks.
-->
<path>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>org.jenkins-ci.tools</groupId>
<artifactId>maven-hpi-plugin</artifactId>
+2
View File
@@ -46,6 +46,8 @@ THE SOFTWARE.
<host>localhost</host>
<!-- HTTP listener port -->
<port>8080</port>
<!-- executable/Main is a plain bootstrap class; nothing here needs annotation processing. -->
<maven.compiler.proc>none</maven.compiler.proc>
<!-- Minimum Remoting version, which is tested for API compatibility, duplicated so that renovate only updates the latest remoting version property -->
<remoting.minimum.supported.version>3176.v207ec082a_8c0</remoting.minimum.supported.version>
+18
View File
@@ -73,6 +73,24 @@ THE SOFTWARE.
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<!-- Indexes @Restricted -->
<path>
<groupId>org.jenkins-ci</groupId>
<artifactId>annotation-indexer</artifactId>
</path>
<!-- Generates META-INF/services/jenkins.websocket.Provider from @MetaInfServices -->
<path>
<groupId>org.kohsuke.metainf-services</groupId>
<artifactId>metainf-services</artifactId>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
+5
View File
@@ -36,6 +36,11 @@ THE SOFTWARE.
<name>Internal SPI for WebSocket</name>
<description>An abstraction of how Jenkins can serve a WebSocket connection from its servlet container.</description>
<properties>
<!-- Nothing here needs annotation processing. -->
<maven.compiler.proc>none</maven.compiler.proc>
</properties>
<dependencyManagement>
<dependencies>
<dependency>