vaadin / flow

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

vaadin-maven-plugin bug report--Cannot package successfully(V14.10.+) #17180

Closed iambiglee closed 1 year ago

iambiglee commented 1 year ago

Describe the bug

Affect Version: 14.10+ Simple description: wrong license mention Java Version: 1.8 I add a Vaadin addon zxing-vaadin ,

        <dependency>
            <groupId>com.wontlost</groupId>
            <artifactId>zxing-vaadin</artifactId>
            <version>1.0.3-8</version>
        </dependency>

And I simply package like this in my pom file


        <profile>
            <id>jenkinstest</id>
            <dependencies>
                <dependency>
                    <groupId>com.vaadin</groupId>
                    <artifactId>flow-server-production-mode</artifactId>
                </dependency>
            </dependencies>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-maven-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>com.vaadin</groupId>
                        <artifactId>vaadin-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>build-frontend</goal>
                                </goals>
                                <phase>compile</phase>
                            </execution>
                        </executions>
                        <configuration>
                            <productionMode>false</productionMode>
<!--                            !!!!!!!!Attention!!!!!! here is error occur -->
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

if I run mvn clean install -Pjenkintest when vaadin -maven-plugin configuration is false or empty. it is always shows to me that I need a license like below(but it is fine when I put "true" in configutation, or I use vaadin 14.8.5):

[INFO] Opening system browser to validate license. If the browser is not opened, please open https://vaadin.com/pro/validate-license?connect=9d4b23e7-d8c3-471a-a17d-c20e801b067c&productName=vaadin-board&productVersion=2.2.2 manually
[INFO] For CI/CD build servers, you need to download a server license key, which can only be used for production builds. You can download a server license key from https://vaadin.com/myaccount/licenses.
If you are working offline in development mode, please visit https://vaadin.com/pro/validate-license?getOfflineKey=mid-a3f909d7-e85f4681 for an offline development mode license.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  03:14 min (Wall Clock)
[INFO] Finished at: 2023-07-05T14:26:47+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.vaadin:vaadin-maven-plugin:14.10.3:build-frontend (default) on project my-todo: Execution default of goal com.vaadin:vaadin-maven-plugin:14.10.3:build-frontend failed: Error retreiving your subscription key from the server. Please try again or download the key manually from https://vaadin.com/pro/validate-license. If you need to work offline then please go to https://vaadin.com/pro/validate-license?getOfflineKey=mid-a3f909d7-e85f4681 to retrieve an offline key.
[ERROR] For CI/CD build servers, you need to download a server license key, which can work offline to create production builds. You can download a server license key from https://vaadin.com/myaccount/licenses.
[ERROR] For troubleshooting steps, see https://vaadin.com/licensing-faq-and-troubleshooting.: Connection reset
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

Expected-behavior

I wish if maven-vaaadin-plugin configuration is false or empty , mvn install is still working without license requset.

Reproduction

see "Describe the bug"

System Info

System: Window 10 , Centos 8 Vaadin Version: 14.10+(14.10.1,14.10.2, 14.10.3) JDK Version: JDK 1.8

knoobie commented 1 year ago

The addon is pulling in vaadin:vaadin instead of vaadin:vaadin-core as dependency. Exclude the dependency to get your build running again.

iambiglee commented 1 year ago

tks, when I change zxing-vaadin dependence for vaadin:vaadin to vaadin:vaadin-core . it is working.

but I don't understand, why vaadin 14.8.5 is working with vaddin:vaadin, but vaadin 14.10.1 can't

iambiglee commented 1 year ago

The addon is pulling in vaadin:vaadin instead of vaadin:vaadin-core as dependency. Exclude the dependency to get your build running again.

It is doesn't working, When I change addon from vaadin:vaddin to vaadin:vaadin-core in my computer and use it, it still has license check in V14.10.3.

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:15 min (Wall Clock)
[INFO] Finished at: 2023-07-07T14:15:20+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.vaadin:vaadin-maven-plugin:14.10.3:build-frontend (default) on project my-todo: Execution default of goal com.vaadin:vaadin-maven-plugin:14.10.3:build-frontend failed: Error retreiving your subscription key from the server. Please try again or download the key manually from https://vaadin.com/pro/validate-license. If you need to work offline then please go to https://vaadin.com/pro/validate-license?getOfflineKey=mid-a3f909d7-e85f4681 to retrieve an offline key.
[ERROR] For CI/CD build servers, you need to download a server license key, which can work offline to create production builds. You can download a server license key from https://vaadin.com/myaccount/licenses.
[ERROR] For troubleshooting steps, see https://vaadin.com/licensing-faq-and-troubleshooting.: Connection reset
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

image

ZheSun88 commented 1 year ago

the license checking has been changed since flow 2.8.0 (Vaadin 14.9.0), it has been described in the flow release note, https://github.com/vaadin/flow/releases/tag/2.8.0.

seems, by default, the vaadin-maven-plugin:build-frontend goal is tied to the production Mode. so i guess when you set the productionMode to false, this might cause some issues.

by the way, can you include the line (normally a few line before the build failed info) for your previous post a few minutes ago.. it will show us which product that the build is checking the pro key.

[INFO] Opening system browser to validate license. If the browser is not opened, please open https://vaadin.com/pro/validate-license?connect=9d4b23e7-d8c3-471a-a17d-c20e801b067c&productName=vaadin-board&productVersion=2.2.2 manually
manolo commented 1 year ago

BTW, productionMode parameter in latest versions of vaadin (24.0+) was removed from the goal, because it makes not sense to have it. What is your use case for wanting to enable dev-mode in your final app? Have you checked your dependency tree to see if something else is introducing as a transitive dependency of a licensed component?

The <productionMode>false</productionMode> Maven parameter no longer has any effect and can be removed. Production mode is automatically enabled when you run the build-frontend target.
mcollovati commented 1 year ago

Using com.vaadin:vaadin-core in the project and excluding com.vaadin:vaadin from the zxing-vaadin works for me.

        <dependency>
            <groupId>com.wontlost</groupId>
            <artifactId>zxing-vaadin</artifactId>
            <version>1.0.3-8</version>
            <exclusions>
                <exclusion>
                    <groupId>com.vaadin</groupId>
                    <artifactId>vaadin</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

No commercial components are bundled and there's no license checking.

I think that the zxing-vaadin add-on should depend on vaadin-core and the dependency could probably be defined as provided.

Edit: tested with Vaadin 14.10.3

mcollovati commented 1 year ago

For the record, here is a excerpt of the dependecy tree before the exclusion

[INFO] +- com.wontlost:zxing-vaadin:jar:1.0.3-8:compile
[INFO] |  \- com.vaadin:vaadin:jar:14.10.3:compile
[INFO] |     +- com.vaadin:vaadin-board-flow:jar:14.10.3:compile
[INFO] |     +- com.vaadin:vaadin-charts-flow:jar:14.10.3:compile
[INFO] |     +- com.vaadin:vaadin-confirm-dialog-flow:jar:14.10.3:compile
[INFO] |     +- com.vaadin:vaadin-cookie-consent-flow:jar:14.10.3:compile
[INFO] |     +- com.vaadin:vaadin-crud-flow:jar:14.10.3:compile
[INFO] |     +- com.vaadin:vaadin-grid-pro-flow:jar:14.10.3:compile
[INFO] |     \- com.vaadin:vaadin-rich-text-editor-flow:jar:14.10.3:compile
iambiglee commented 1 year ago

the license checking has been changed since flow 2.8.0 (Vaadin 14.9.0), it has been described in the flow release note, https://github.com/vaadin/flow/releases/tag/2.8.0.

seems, by default, the vaadin-maven-plugin:build-frontend goal is tied to the production Mode. so i guess when you set the productionMode to false, this might cause some issues.

by the way, can you include the line (normally a few line before the build failed info) for your previous post a few minutes ago.. it will show us which product that the build is checking the pro key.

[INFO] Opening system browser to validate license. If the browser is not opened, please open https://vaadin.com/pro/validate-license?connect=9d4b23e7-d8c3-471a-a17d-c20e801b067c&productName=vaadin-board&productVersion=2.2.2 manually

it is show like this:

[INFO] Opening system browser to validate license. If the browser is not opened, please open https://vaadin.com/pro/validate-license?connect=44db8202-9762-4c44-bac7-abe9787fe9dd&productName=vaadin-board&productVersion=2.2.2 manually
[INFO] For CI/CD build servers, you need to download a server license key, which can only be used for production builds. You can download a server license key from https://vaadin.com/myaccount/licenses.
If you are working offline in development mode, please visit https://vaadin.com/pro/validate-license?getOfflineKey=mid-a3f909d7-e85f4681 for an offline development mode license.
iambiglee commented 1 year ago

BTW, productionMode parameter in latest versions of vaadin (24.0+) was removed from the goal, because it makes not sense to have it. What is your use case for wanting to enable dev-mode in your final app? Have you checked your dependency tree to see if something else is introducing as a transitive dependency of a licensed component?

The <productionMode>false</productionMode> Maven parameter no longer has any effect and can be removed. Production mode is automatically enabled when you run the build-frontend target.

thank for you info, bad new is our project is use vaadin 14 , and no plan to upgrade it(Even I share to the team, that vaddin 14 will not support after 2024, it seem like boss don't care)

ZheSun88 commented 1 year ago

as mentioned here, commercial components have not been excluded from your project..

the browser is not opened, please open https://vaadin.com/pro/validate-license?connect=44db8202-9762-4c44-bac7-abe9787fe9dd&productName=vaadin-board&productVersion=2.2.2

try to use the way mentioned here should help -> https://github.com/vaadin/flow/issues/17180#issuecomment-1633599317

iambiglee commented 1 year ago

as mentioned here, commercial components have not been excluded from your project..

the browser is not opened, please open https://vaadin.com/pro/validate-license?connect=44db8202-9762-4c44-bac7-abe9787fe9dd&productName=vaadin-board&productVersion=2.2.2

try to use the way mentioned here should help -> #17180 (comment)

Thanks , It still not working in my project, But I found other way to avoid this error occur.

and Thanks for you guys help. I don't think this problem need time and energy anymore. it is not worth it

I close this issue.