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

Warning that annotation processing is enabled when using JDK 21 in DEV mode and Java files change #37532

Closed
michalvavrik opened this issue Dec 5, 2023 · 15 comments · Fixed by #38468
Labels
Milestone

Comments

@michalvavrik
Copy link
Member

michalvavrik commented Dec 5, 2023

Describe the bug

I run Quarkus application with JDK 21 and get warning about enabled annotation processing. My understanding is that this warning could be avoided if annotation processing was explicitly enabled. Found this: https://bugs.openjdk.org/browse/JDK-8314833

Expected behavior

Avoid warning if possible.

Actual behavior

Following warning is logged:

2023-12-05 13:52:07,803 WARN  [io.qua.dep.dev.JavaCompilationProvider] (vert.x-worker-thread-1) Annotation processing is enabled because one or more processors were found

How to Reproduce?

Steps to reproduce the behavior:

  1. git clone [email protected]:michalvavrik/quarkus-startstop.git
  2. cd quarkus-startstop
  3. mvn -V -B -s .github/mvn-settings.xml clean verify -DexcludeTags=product,native,codequarkus -Dgh.actions -Dtest=ArtifactGeneratorTest -f testsuite/

Alternative reproducer:

  1. mvn io.quarkus:quarkus-maven-plugin:999-SNAPSHOT:create -DprojectGroupId=my-groupId -DprojectArtifactId=app-generated-skeleton -DprojectVersion=1.0.0-SNAPSHOT -DpackageName=org.my.group -DquarkusRegistryClient=false -DplatformGroupId=io.quarkus -DplatformVersion=999-SNAPSHOT -Dextensions=quarkus-jaxrs-client-reactive,quarkus-resteasy-reactive,quarkus-resteasy-reactive-jackson,quarkus-resteasy-reactive-qute,quarkus-rest-client-reactive,quarkus-rest-client-reactive-jackson,core,hibernate-orm,hibernate-orm-panache,hibernate-validator,jackson,jaxb,jdbc-mysql,jdbc-postgresql,jsonb,jsonp,kafka-client,kubernetes-config,mailer,narayana-jta,oidc,quarkus-quartz,reactive-pg-client,scheduler,spring-boot-properties,smallrye-reactive-streams-operators,spring-data-jpa,spring-di,spring-security,spring-web,undertow,vertx,quarkus-reactive-routes,grpc,infinispan-client,cache,micrometer,micrometer-registry-prometheus,quarkus-openshift-client,quarkus-smallrye-graphql
  2. mvn clean quarkus:dev -Dquarkus.analytics.disabled=true -Dquarkus.hibernate-orm.enabled=false
  3. in another terminal sed -i 's/Hello/Bye/g' src/main/java/org/my/group/GreetingResource.java
  4. in first terminal force restart s

Output of uname -a or ver

Fedora 38

Output of java -version

OpenJDK Runtime Environment Temurin-21.0.1+12 (build 21.0.1+12-LTS)

Quarkus version or git rev

999-SNAPSHOT, 3.5.x

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.9.3

Additional information

No response

@michalvavrik michalvavrik added the kind/bug Something isn't working label Dec 5, 2023
Copy link

quarkus-bot bot commented Dec 5, 2023

/cc @geoand (kubernetes,openshift), @iocanel (kubernetes,openshift)

@rsvoboda
Copy link
Member

rsvoboda commented Dec 5, 2023

I was able to reproduce this with just the basic sample app with REST endpoint, the default app from https://code.quarkus.io/

__  ____  __  _____   ___  __ ____  ______
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/
2023-12-05 16:05:23,751 INFO  [io.quarkus] (Quarkus Main Thread) code-with-quarkus 1.0.0-SNAPSHOT on JVM (powered by Quarkus 3.6.0) started in 0.337s. Listening on: http://localhost:8080

2023-12-05 16:05:23,752 INFO  [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
2023-12-05 16:05:23,752 INFO  [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, resteasy-reactive, smallrye-context-propagation, vertx]
2023-12-05 16:05:23,753 INFO  [io.qua.dep.dev.RuntimeUpdatesProcessor] (Aesh InputStream Reader) Live reload total time: 0.369s
2023-12-05 16:06:01,168 INFO  [io.qua.dep.dev.fil.StaticFileManager] (Aesh InputStream Reader) Ignoring module-info.java in dev mode, set the `quarkus.live-reload.ignore-module-info` property to `false` in your project descriptor (`pom.xml` or `build.gradle`) to disable this behavior.
2023-12-05 16:06:01,607 WARN  [io.qua.dep.dev.JavaCompilationProvider] (Aesh InputStream Reader) Annotation processing is enabled because one or more processors were found
  on the class path. A future release of javac may disable annotation processing
  unless at least one processor is specified by name (-processor), or a search
  path is specified (--processor-path, --processor-module-path), or annotation
  processing is enabled explicitly (-proc:only, -proc:full).
  Use -Xlint:-options to suppress this message.
  Use -proc:none to disable annotation processing., line -1 in [unknown source]

2023-12-05 16:06:01,628 INFO  [io.qua.dep.dev.RuntimeUpdatesProcessor] (Aesh InputStream Reader) Restarting quarkus due to changes in GreetingResource.class.
2023-12-05 16:06:01,646 INFO  [io.quarkus] (Quarkus Main Thread) code-with-quarkus stopped in 0.016s
__  ____  __  _____   ___  __ ____  ______
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/
2023-12-05 16:06:02,396 INFO  [io.quarkus] (Quarkus Main Thread) code-with-quarkus 1.0.0-SNAPSHOT on JVM (powered by Quarkus 3.6.0) started in 0.726s. Listening on: http://localhost:8080

2023-12-05 16:06:02,398 INFO  [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
2023-12-05 16:06:02,399 INFO  [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, resteasy-reactive, smallrye-context-propagation, vertx]
2023-12-05 16:06:02,400 INFO  [io.qua.dep.dev.RuntimeUpdatesProcessor] (Aesh InputStream Reader) Live reload total time: 1.726s

@geoand
Copy link
Contributor

geoand commented Dec 6, 2023

I am pretty sure we should wait before doing anything about this because @FroMage has some changes in this area

@FroMage
Copy link
Member

FroMage commented Jan 16, 2024

I merged my changes, but I'm not sure exactly what this issue is about. Could you clarify?

@michalvavrik
Copy link
Member Author

I merged my changes, but I'm not sure exactly what this issue is about. Could you clarify?

there is warning (see issue desc) that would be great to avoid

@FroMage
Copy link
Member

FroMage commented Jan 16, 2024

OK, but, what are the processors that are detected? Should they be running?

@michalvavrik
Copy link
Member Author

michalvavrik commented Jan 17, 2024

OK, but, what are the processors that are detected? Should they be running?

There is at least extension annotation processor io.quarkus.annotation.processor.ExtensionAnnotationProcessor, right? Point is we don't do anything extra as users so if Quarkus needs a processor, maybe the feature should be enabled explicitly. I don't have time to work on this, so I'm just reporting my user concern :-) I'll leave details to you.

@FroMage
Copy link
Member

FroMage commented Jan 24, 2024

I don't know what processor is that we're adding.That's why I asked.

But if we do want to make sure that we always have one (or more), then we should perhaps enable it via a build item and set it explicitely. Though perhaps if we do this, it would break any builds have require them to be in the classpath. I think that once you set one explicitely, the classpath ones are ignored.

Note that we already have an issue to automatically add the Hibernate processor automatically via a build item as well: #29068

@gsmet
Copy link
Member

gsmet commented Jan 24, 2024

I agree we should do something about it. I'm not entirely sure which annotation process would be in the dev classpath but there's probably one around. Ideally we should get rid of it if we could. Or if it's necessary, we should enable it explicitly.

Maybe @aloubyansky can help to identify the culprit?

One easy way out would be to ignore the filter out the warning until we know more about it. If we can't improve the situation, we should probably do that.

@gsmet gsmet added this to the 3.7.1 milestone Jan 24, 2024
gsmet added a commit to gsmet/quarkus that referenced this issue Jan 30, 2024
It already appeared twice during the Maven build so we really don't need
it to appear every time we restart dev mode.

Fixes quarkusio#37532
gsmet added a commit to gsmet/quarkus that referenced this issue Jan 30, 2024
It already appeared twice during the Maven build so we really don't need
it to appear every time we restart dev mode.

Fixes quarkusio#37532
@aloubyansky
Copy link
Member

So far the only annotation processor I see on the classpath of a simple REST app is io.vertx.codegen.CodeGenProcessor

@aloubyansky
Copy link
Member

        <exclusion>
          <groupId>io.vertx</groupId>
          <artifactId>vertx-codegen</artifactId>
        </exclusion>

Doesn't seem to be enough though

@gsmet
Copy link
Member

gsmet commented Jan 30, 2024

I was wondering if the extension annotation processor could be around in dev mode?

@aloubyansky
Copy link
Member

No, it's not

@aloubyansky
Copy link
Member

There is org/eclipse/sisu/org.eclipse.sisu.inject/0.9.0.M2/org.eclipse.sisu.inject-0.9.0.M2.jar!/META-INF/services/javax.annotation.processing.Processor coming from the application classloader, which is outside of Quarkus CL. Perhaps that's what triggers it.

gsmet added a commit to gsmet/quarkus that referenced this issue Jan 30, 2024
It already appeared twice during the Maven build so we really don't need
it to appear every time we restart dev mode.

Fixes quarkusio#37532

(cherry picked from commit 00fc046)
@miguno
Copy link

miguno commented May 6, 2024

  • Any updates on this?
  • Is it recommended to manually enable annotation processing with -proc:full or -proc:only?*

*maven pom.xml example:

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <!-- `-proc:only`: Explicitly enable annotation processing. -->
                    <compilerArgument>-proc:full</compilerArgument>
                </configuration>
            </plugin>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants