You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The vaadin-spring-boot-starter contains the jakarta.websocket Java package twice. This - so far - isn't a problem during compilation or execution, but Javadoc complains about it and it might be a problem later, if the versions of these packages ever diverge from each other. jakarta.websocket-api and jakarta.websocket-client-api are included via vaadin-core -> vaadin-dev -> vaadin-dev-server. tomcat-embed-websocket is included via spring-boot-starter-web -> spring-boot-starter-tomcat.
My first guess would be that vaadin-spring-boot-starter should exclude jakarta.websocket-api and jakarta.websocket-client-api from its vaadin-core dependency. vaadin-core is Spring-independent, so it would make sense that vaadin-spring-boot-starter would override these dependencies with its own versions. But maybe there a better way. (Like asking
Please note, that apps generated via https://start.vaadin.com/ also include com.vaadin:vaadin, which in turn would bring back jakarta.websocket-api and jakarta.websocket-client-api again. Since there's usually no Javadoc artifact for applications, there wouldn't be any build error, but having the same package twice on the classpath could still cause problems later.
Expected-behavior
It would be nice if Vaadin add-ons using vaadin-spring-boot-starter could just have their Javadoc artifact built without having to tweak the dependencies.
I would recommend to exclude vaadin-dev-* from your production build and artefacts nevertheless
After having checked my projects, that exclusion is already part of the production profile :) Good advice nonetheless. Especially since the https://start.vaadin.com/ projects don't do that yet (hint hint).
Plain servlet starters seem to have some issues as well. Pretty much all jakarta namespaced stuff should only be in provides scope in vaadin dependencies:
Websocket stuff seems to be coming from development mode stuff (not that critical), but in production profile there is still annotation,inject and validation.
<profile>
<!-- Production mode is activated using -Pproduction -->
<id>production</id>
<dependencies>
<!-- Exclude development dependencies from production -->
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-core</artifactId>
<exclusions>
<exclusion>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-dev</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
Ah, yes, this will do it of course. I had some fairly recent projects from shortly before the Vaadin 24 release (Vaadin 24 beta2) that didn't include this yet. So you were a bit faster than me :)
I only see the websocket api included once (it should be included 0 times) but not twice:
The Websocket API is also contained in tomcat-embed-websocket. Two different artifacts containing the same packages. That's always bound to get messy. But it makes me wonder, why tomcat-embed-websocket doesn't depend on jakarta.websocket:jakarta.websocket-api instead of including the same classes...
The provided scope does not seem to make a difference for Javadoc (which made me aware of this in the first place). But I'll just exclude vaadin-dev in all Vaadin add-ons that are also Spring Boot add-ons.
Activity
knoobie commentedon Mar 10, 2023
I would recommend to exclude vaadin-dev-* from your production build and artefacts nevertheless
Frettman commentedon Mar 10, 2023
After having checked my projects, that exclusion is already part of the production profile :) Good advice nonetheless. Especially since the https://start.vaadin.com/ projects don't do that yet (hint hint).
knoobie commentedon Mar 10, 2023
The ticket for the exclusion is here vaadin/flow#15749
mstahv commentedon Mar 10, 2023
Plain servlet starters seem to have some issues as well. Pretty much all jakarta namespaced stuff should only be in provides scope in vaadin dependencies:
Websocket stuff seems to be coming from development mode stuff (not that critical), but in production profile there is still annotation,inject and validation.
Artur- commentedon Mar 10, 2023
Doesn't this do it?
Artur- commentedon Mar 10, 2023
I only see the websocket api included once (it should be included 0 times) but not twice:
fix: Add missing provided scope
Frettman commentedon Mar 10, 2023
Ah, yes, this will do it of course. I had some fairly recent projects from shortly before the Vaadin 24 release (Vaadin 24 beta2) that didn't include this yet. So you were a bit faster than me :)
Frettman commentedon Mar 10, 2023
The Websocket API is also contained in
tomcat-embed-websocket. Two different artifacts containing the same packages. That's always bound to get messy. But it makes me wonder, whytomcat-embed-websocketdoesn't depend onjakarta.websocket:jakarta.websocket-apiinstead of including the same classes...Artur- commentedon Mar 10, 2023
LIkely any server that implements the API will include both the API and the implementation. Anyway, vaadin/flow#16221 should fix it
Frettman commentedon Mar 10, 2023
The
providedscope does not seem to make a difference for Javadoc (which made me aware of this in the first place). But I'll just excludevaadin-devin all Vaadin add-ons that are also Spring Boot add-ons.mstahv commentedon Mar 10, 2023
The PR by @Artur- only tackles to websocket APIs coming from dev server. Changed to scope of validation and annotation api's in https://github.com/vaadin/flow/pull/16223/files
Didn't build it locally, let's see what the tests say about that...
mstahv commentedon Mar 10, 2023
And then there is still inject API left:
mstahv commentedon Mar 10, 2023
@Frettman Good point about the add-ons. Probably all add-ons should now have the vaadin-dev excluded, not nice :-(
mstahv commentedon Mar 10, 2023
Or have vaadin/vaadin-core in provided scope 🤷♂️
Artur- commentedon Mar 10, 2023
If you do not set the vaadin or vaadin-core dependency to provided in an addon, you might cause version conflict problems for the users at some point
mstahv commentedon Mar 10, 2023
If one only depends on an add-on there shouldn't be conflicts.
mstahv commentedon Mar 10, 2023
atmosphere fix in Atmosphere/atmosphere#2489 (coming in via vaadin-push, which includes a special build of atmostphere).
fix: Add missing provided scope (#16221)
fix: Add missing provided scope (#16221)
fix: Add missing provided scope (#16221) (#16232)