Hi there,
I have a problem with javax.servlet. A part of my dependencie tree lookes like
[INFO] +- io.micrometer:micrometer-registry-prometheus:jar:1.1.5:runtime
[INFO] | \- io.prometheus:simpleclient_common:jar:0.5.0:runtime
[INFO] | \- io.prometheus:simpleclient:jar:0.6.0:runtime
[INFO] +- io.dropwizard.metrics:metrics-core:jar:4.1.0:compile
[INFO] +- org.springframework.boot:spring-boot-starter-undertow:jar:2.1.6.RELEASE:compile
[INFO] | +- io.undertow:undertow-core:jar:2.0.21.Final:compile
[INFO] | | +- org.jboss.xnio:xnio-api:jar:3.3.8.Final:compile
[INFO] | | \- org.jboss.xnio:xnio-nio:jar:3.3.8.Final:runtime
[INFO] | +- io.undertow:undertow-servlet:jar:2.0.21.Final:compile
[INFO] | | \- org.jboss.spec.javax.annotation:jboss-annotations-api_1.2_spec:jar:1.0.2.Final:compile
[INFO] | +- io.undertow:undertow-websockets-jsr:jar:2.0.21.Final:compile
[INFO] | | \- org.jboss.spec.javax.websocket:jboss-websocket-api_1.1_spec:jar:1.1.4.Final:compile
[INFO] | +-
javax.servlet:javax.servlet-api:jar:4.0.1:compile
[INFO] | \- org.glassfish:javax.el:jar:3.0.0:compile
[INFO] \- org.springframework.boot:spring-boot-devtools:jar:2.1.6.RELEASE:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
The main thing here is that you can see that the javax.servlet is in the tree
In the pom I defined a java.version.
The fact is that I have installed
java 11 on my new laptop and of course in the pom I first used version 11.
When I build with version 11 I get the error shown here under. This is of course a part of the messages
------------------------------------------------------------------------------------------------------------------
Information:java: Hibernate JPA 2 Static-Metamodel Generator 5.3.10.Final
Information:java: Errors occurred while compiling module 'sponsor'
Information:javac 11.0.5 was used to compile java sources
Information:Module "sponsor" was fully rebuilt due to project configuration/dependencies changes
Information:5-2-2020 19:48 - Build completed with 18 errors and 10 warnings in 5 s 304 ms
Warning:java: Supported source version 'RELEASE_6' from annotation processor 'net.java.dev.hickory.prism.internal.PrismGenerator' less than -source '11'
D:\Projecten\sponsor\src\main\java\eu\inchange\sponsor\security\jwt\JWTFilter.java
Error:(19, 8) java: cannot access javax.servlet.Filter
class file for javax.servlet.Filter not found
Error:(21, 25) java: cannot access javax.servlet.Filter
class file for javax.servlet.Filter not found
Error:(8, 21) java: package javax.servlet does not exist
Error:(9, 21) java: package javax.servlet does not exist
Error:(10, 21) java: package javax.servlet does not exist
Error:(11, 21) java: package javax.servlet does not exist
Error:(12, 26) java: package javax.servlet.http does not exist
------------------------------------------------------------------------------------------------------------------
The only thing I have to change to make the project build is changing java.version from 11 to 1.8 in the pom
Why does java 11 not see the javax.servlet in de dependency tree??? I can't stand that I can't figure out what causes the problem. I hope someone knows.
Greetings,
Jan