I have a Java 11 project embedding Tomcat:
```xml
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>9.0.50</version>
</dependency>
```
The Tomcat-specific code is in a subproject with only two classes. When
I compile using Maven 3.8.6 and Java 17 using `-Xlint:all`, I see the
following warning for that subproject:
> [WARNING] Cannot find annotation method 'value()' in type
> 'aQute.bnd.annotation.spi.ServiceConsumer':
> class file for aQute.bnd.annotation.spi.ServiceConsumer not found
As mentioned this only seems to happen with -`Xlint:all` turned on for
`javac`:
```xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<showDeprecation>true</showDeprecation>
<compilerArgs>
<arg>-Xlint:all</arg>
</compilerArgs>
</configuration>
</plugin>
```
Doing a bit of searching brings up similar (but not exact) things, such
as [Lombok Issue
#2145](https://github.com/projectlombok/lombok/issues/2145), which hints
that I may need to add some sort of extra dependency such as
`biz.aQute.bnd:bndlib` or `org.osgi:osgi.annotation`.
But I've tried this and and I still get the warning:
```xml
<dependency>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bndlib</artifactId>
<version>2.4.0</version>
</dependency>
```
I also tried this; no difference:
```xml
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.annotation</artifactId>
<version>7.0.0</version>
</dependency>
```
I also [asked on Stack Overflow](https://stackoverflow.com/q/74000505).
No answers so far.
I filed [Bug
66299](https://bz.apache.org/bugzilla/show_bug.cgi?id=66299] because I
imagine that the Tomcat artifact isn't including some necessary
dependency. That bug got closed because I'm supposed to ask here on this
list first; nevertheless, including a Tomcat artifact should not result
a warning regarding some other dependency I've never heard of and didn't
refer to, so in any case this is incorrect behavior, and needs to be fixed.
Still I'd like to find out what's going on—maybe I can help you fix it.
Where is this error coming from, and what does it mean? I don't have any
`@ServiceConsumer` annotation in my source code, and I couldn't find any
in the Tomcat classes I'm extending, either. Shouldn't the
`org.apache.tomcat.embed:tomcat-embed-core` dependency contain
everything I need (either in the artifact or via a transitive
dependency) just to build a project that references the Tomcat classes?
What is missing here?
Thanks,
Garret
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org