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

Vaadin 24.4.1 - GradlePlugin has Spring dependencies #19573

Closed
subITCSS opened this issue Jun 13, 2024 · 18 comments · Fixed by vaadin/platform#6519
Closed

Vaadin 24.4.1 - GradlePlugin has Spring dependencies #19573

subITCSS opened this issue Jun 13, 2024 · 18 comments · Fixed by vaadin/platform#6519

Comments

@subITCSS
Copy link

Description of the bug

We wanted to upgrade from the latest VaadinFlow 24.3.X to the 24.4.1. But we discovered a dependency issue for non Spring projects.
As you can see here the GradlePlugin references the HillaGradlePlugin - which needs Spring as reference. https://mvnrepository.com/artifact/com.vaadin/vaadin-gradle-plugin/24.4.1 .

This causes that our dependencies are not found and we cannot upgrade to this version cause we don´t have any Spring-References in our non spring project.

image

Expected behavior

There is no dependency of Hilla/Spring e.g. which causes any dependency issue for a non spring project.

Minimal reproducible example

https://mvnrepository.com/artifact/com.vaadin/vaadin-gradle-plugin/24.4.1

Versions

  • Vaadin / Flow version: 24.4.0 and 24.4.1
  • Java version: 17
@mshabarov
Copy link
Contributor

This is a severe bug and should be fixed in the upcoming patch release.
Until then, the workaround is to use flow-gradle-plugin instead of vaadin-gradle-plugin with the Vaadin Flow versioning, i.e. currently it's 24.4.0 latest version.

@subITCSS
Copy link
Author

Why only in the next patch release and not as a hotfix - we had a BFP and are therefore waiting for the 24.4.x version to use it. The Workaround is causing issues for ourself - cause the dependencies are not found correctly.

@mshabarov
Copy link
Contributor

The fix is under development, we'll make the release once it's resolved.

@mshabarov
Copy link
Contributor

mshabarov commented Jun 14, 2024

@subITCSS Vaadin 24.4.0 version is broken in a way that it uses pre-release version of Hilla (24.4.0.rc2), that might be the reason of failures.

Could you please try to use Vaadin version 24.4.1 and flow gradle plugin version 24.4.0. Do you have still any errors in that cases? If yes, could you please share them?

We don't have a published version of flow-gradle-plugin separately, so it's imposible at the moment unfortunately.

@caalador
Copy link
Contributor

Adding this into build.gradle will remove hilla from the plugin path:

buildscript {
    configurations.classpath {
        exclude group: 'com.vaadin', module: 'hilla-engine-core'
    }
}

Gradle buildEnvironment without the exclusion:

classpath
+--- com.vaadin:vaadin-gradle-plugin:24.4.2
|    +--- org.jetbrains.kotlin:kotlin-stdlib:1.9.20
|    |    \--- org.jetbrains:annotations:13.0
|    +--- com.vaadin:hilla-engine-core:24.4.1
|    |    +--- com.vaadin:flow-server:24.4.1
...

Gradle buildEnvironment without the exclusion, and no hilla in the output:

classpath
+--- com.vaadin:vaadin-gradle-plugin:24.4.2
|    +--- org.jetbrains.kotlin:kotlin-stdlib:1.9.20
|    |    \--- org.jetbrains:annotations:13.0
|    +--- com.vaadin:flow-gradle-plugin:24.4.1
|    |    \--- com.vaadin:flow-plugin-base:24.4.1
...

Hope this helps while we search for a solution.

@tepi
Copy link
Contributor

tepi commented Jun 17, 2024

Yes, that was one of the first things I tried. It fixes the dependency issue but introduces other issue(s). At least ./gradlew tasks does not work anymore since the Hilla tasks code is still there but dependencies are not found:

tepi@kurki-mbp base-starter-gradle-24 % ./gradlew tasks
> Task :tasks FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':tasks'.
> Could not create task ':hillaGenerate'.
   > Could not create task of type 'EngineGenerateTask'.
      > Could not generate a decorated class for type EngineGenerateTask.
         > com/vaadin/hilla/engine/GeneratorException

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.4/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 575ms
1 actionable task: 1 executed

@caalador
Copy link
Contributor

caalador commented Jun 17, 2024

Interesting. I don't have a problem if I run gradlew build nor gradlew appRun for the base-starter-gradle with the hilla exclusion, but gradlew tasks does fail.
What does tasks actually execute? [edit] So it collects all available tasks for execution... Why does that try to generate things?

@mcollovati
Copy link
Collaborator

I can only reproduce if the Java version available on PATH is 11 instead of 17.
The screenshot also reports

Incompatible because this component declares a component, compatible with Java 17 and the consumer needed a component, compatible with Java 11

@subITCSS
Copy link
Author

So does version 24.4.3 fix this issue?

mshabarov pushed a commit to vaadin/platform that referenced this issue Jun 19, 2024
Fixes vaadin/flow#19573

Co-authored-by: caalador <mikael.grankvist@vaadin.com>
@mshabarov
Copy link
Contributor

No, the patch will be released with the hot-fix 24.4.4 version.

@subITCSS
Copy link
Author

Are there any time updates on this? - when this version will be released

@caalador
Copy link
Contributor

Version 24.4.4 (latest) was released yesterday 25 June 2024.
Documentation on the usage can be seen here https://github.com/vaadin/docs/pull/3499/files

@subITCSS
Copy link
Author

@mshabarov @caalador
So i updated all the dependencies to Vaadin 24.4.4 but again i receive hilla dependencies which are referencing spring in a non spring project.
image

@mshabarov
Copy link
Contributor

@subITCSS have you applied also the exclusions documented here for Gradle, also the hilla.active=false parameter ?

@subITCSS
Copy link
Author

Alright. So this does work then.

@subITCSS
Copy link
Author

@mshabarov We discoverd another problem with the new verson:
To create our sbom we check the npm references and getting this error:

npm error code ELSPROBLEMS
npm error invalid: @open-wc/dedupe-mixin@1.4.0 /node_modules/@open-wc/dedupe-mixin

The Issue we discovered is that the vaadin-bundles requires the fixed version of 1.3.1 for it
image

while all components require the ^1.3.0 and as there is an 1.4.0 the system updates the dependency to 1.4.0 which clashes with the upper fixed definition.
image

So based on this the Versions should be both fix or flexible using the ^.

@mshabarov
Copy link
Contributor

@subITCSS thanks for discovering this 👍

Looks like a completely different issue, could you please create a new ticket in Vaadin Platform repo as I'm not sure where the bug is, in vaadin-bundles or components or somewhere else.

@subITCSS
Copy link
Author

The new issue is defined under vaadin/platform#6549

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

Successfully merging a pull request may close this issue.

5 participants