vaadin / flow

Vaadin Flow is a Java framework binding Vaadin web components to Java. This is part of Vaadin 10+.
Apache License 2.0
616 stars 167 forks source link

License checker issue: license check done while none should be necessary #14888

Open HermanBovens opened 1 year ago

HermanBovens commented 1 year ago

Description of the bug

I have a Vaadin 23.2.5 Spring Boot application which is not using any Pro component so shouldn't need a license check.

It built fine before. Now I created a shared UI library with the intent of providing some components that can be reused in multiple apps. This library also depends on Vaadin 23.2.5 and is also not using any Pro components. After adding the dependency, during a production build a license check is done. As I don't have a license I can't configure one on the CI server, so it tries to open the browser and the CI build fails.

I'm using Gradle, with the Vaadin 23.2.5 Gradle plugin.

Removing the dependency on the shared library makes the build succeed again, so it appears that the Gradle plugin thinks that a license is needed for this library (but it's my own).

Is there a workaround for this? If it's a bug that will get fixed, I can't afford to wait for a new release.

Expected behavior

No license check should be done.

Minimal reproducible example

  1. Create a Gradle project with an implementation dependency on com.vaadin:vaadin:23.2.5
  2. Create a second Gradle project for a Vaadin Spring Boot application, using the Vaadin Gradle plugin for 23.2.5 and using the BOM com.vaadin:vaadin-bom:23.2.5 and with a dependency on the first project. Use production=true.
  3. Make a production build fro the Vaadin Spring Boot application. A license check occurs during this build.

Versions

knoobie commented 1 year ago

Create a Gradle project with an implementation dependency on com.vaadin:vaadin:23.2.5

Contains pro features. Use vaadin-core instead.

HermanBovens commented 1 year ago

@knoobie Ah indeed that fixed it. I might have discovered this myself if the build output would mention exactly why it's doing a license check.

Legioth commented 1 year ago

Using vaadin-core is a good workaround, but it shouldn't be needed. It's supposed to work so what the production build discovers what's actually used and makes a license check based on that. We should look into what it is that triggers the check in this case.

HermanBovens commented 1 year ago

@Legioth Let me know if I can provide you with more information. The build output doesn't contain much clues I'm afraid. Maybe it's a good idea to let the Gradle plugin log all the details on exactly what triggers a check.

DominicMut commented 1 year ago

Since moving from 14.8.18 to 14.9.0 and 14.9.1 we are facing the same issue. Seems to be something with the maven-plugin.

Using java 11 and maven.

91500 [INFO] Opening system browser to validate license. If the browser is not opened, please open https://vaadin.com/pro/validate-license?connect=*********&productName=vaadin-chart&productVersion=6.3.4 manually 91508 [INFO] ------------------------------------------------------------------------ 91508 [INFO] BUILD FAILURE 91508 [INFO] ------------------------------------------------------------------------ 91508 [INFO] Total time: 01:30 min 91508 [INFO] Finished at: 2022-11-03T10:36:02Z 91508 [INFO] ------------------------------------------------------------------------ 91509 [ERROR] Failed to execute goal com.vaadin:vaadin-maven-plugin:14.9.1:build-frontend *****: Execution default of goal com.vaadin:vaadin-maven-plugin:14.9.1:build-frontend failed: An API incompatibility was encountered while executing com.vaadin:vaadin-maven-plugin:14.9.1:build-frontend: java.lang.UnsatisfiedLinkError: /opt/java/openjdk/lib/libawt_xawt.so: libXext.so.6: cannot open shared object file: No such file or directory 91510 [ERROR] ----------------------------------------------------- 91510 [ERROR] realm = plugin>com.vaadin:vaadin-maven-plugin:14.9.1

Artur- commented 1 year ago

Is there a reproduction case for this somewhere that could be tested?

knoobie commented 1 year ago

I just created a project with start.vaadin.com for another issue and the default created pom.xml with com.vaadin::vaadin prints the following in the logs, even tho I have not used any of those components:

[INFO] Copying frontend resources from jar files ...
[INFO] Visited 122 resources. Took 70 ms.
[INFO] Validating license for vaadin-board 23.2.8
[INFO] Validating license for vaadin-chart 23.2.8
[INFO] Validating license for vaadin-cookie-consent 23.2.8
[INFO] Validating license for vaadin-crud 23.2.8
[INFO] Validating license for vaadin-grid-pro 23.2.8
[INFO] Validating license for vaadin-map 23.2.8
[INFO] Validating license for vaadin-rich-text-editor 23.2.8
[INFO] Reflections took 690 ms to scan 123 urls, producing 5363 keys and 28347 values
[INFO] Running Vite ...
[INFO] Build frontend completed in 60215 ms.

Simple project to reproduce can also be found at VS-4405 where mvn -Pproduction clean package triggered the logging

Artur- commented 1 year ago

This is expected since even components which are not in use are still included in the fallback bundle for the case where you only access them through reflection or some other means the scanner misses

knoobie commented 1 year ago

That explains it and makes using vaadin-core in non-pro projects even more important.

Artur- commented 1 year ago

If it does not find a license it will just skip the components though

DominicMut commented 1 year ago

Hi,

but it seems to find a licence.

We are using vaadin-spring-boot-starter and vaadin.bom ….