春季启动vaadin 14生产失败

如何解决春季启动vaadin 14生产失败

我被困住了,我无法编译我的spring boot vaadin项目用于生产。 这是我的pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-parent</artifactId>
      <version>2.3.3.RELEASE</version>
      <relativePath/>
      <!-- lookup parent from repository -->
   </parent>
   <groupId>de.kreth.clubhelper</groupId>
   <artifactId>clubhelper-attendance</artifactId>
   <version>0.0.1-SNAPSHOT</version>
   <name>clubhelper-attendance</name>
   <description>UI App for Clubhelper Attendance</description>
   <properties>
      <java.version>11</java.version>
      <org.keycloak.version>11.0.1</org.keycloak.version>
      <vaadin.version>14.3.4</vaadin.version>
      <flow.maven.plugin.version>4.0.4</flow.maven.plugin.version>
   </properties>
   <dependencies>
      <dependency>
         <groupId>com.vaadin</groupId>
         <artifactId>vaadin-spring-boot-starter</artifactId>
      </dependency>
      <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-security</artifactId>
      </dependency>
      <dependency>
         <groupId>org.keycloak</groupId>
         <artifactId>keycloak-spring-boot-starter</artifactId>
      </dependency>
      <dependency>
         <groupId>org.keycloak</groupId>
         <artifactId>keycloak-spring-security-adapter</artifactId>
      </dependency>
      <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-devtools</artifactId>
         <scope>runtime</scope>
         <optional>true</optional>
      </dependency>
      <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-test</artifactId>
         <scope>test</scope>
         <exclusions>
            <exclusion>
               <groupId>org.junit.vintage</groupId>
               <artifactId>junit-vintage-engine</artifactId>
            </exclusion>
         </exclusions>
      </dependency>
      <dependency>
         <groupId>io.projectreactor</groupId>
         <artifactId>reactor-test</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.springframework.security</groupId>
         <artifactId>spring-security-test</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.aspectj</groupId>
         <artifactId>aspectjrt</artifactId>
      </dependency>
      <dependency>
         <groupId>org.aspectj</groupId>
         <artifactId>aspectjweaver</artifactId>
      </dependency>
   </dependencies>
   <dependencyManagement>
      <dependencies>
         <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-bom</artifactId>
            <version>${vaadin.version}</version>
            <type>pom</type>
            <scope>import</scope>
         </dependency>
         <dependency>
            <groupId>org.keycloak.bom</groupId>
            <artifactId>keycloak-adapter-bom</artifactId>
            <version>${org.keycloak.version}</version>
            <type>pom</type>
            <scope>import</scope>
         </dependency>
      </dependencies>
   </dependencyManagement>
   <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>prepare-frontend</goal>
                     <goal>build-frontend</goal>
                  </goals>
                  <phase>compile</phase>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <artifactId>maven-clean-plugin</artifactId>
            <configuration>
               <filesets>
                  <fileset>
                     <directory>node_modules</directory>
                     <includes>
                        <include>**</include>
                     </includes>
                     <followSymlinks>false</followSymlinks>
                  </fileset>
                  <fileset>
                     <directory>.</directory>
                     <includes>
                        <include>*.json</include>
                        <include>*.js</include>
                        <include>pnpm-lock.yaml</include>
                        <include>types.d.ts</include>
                     </includes>
                     <followSymlinks>false</followSymlinks>
                  </fileset>
               </filesets>
            </configuration>
         </plugin>
      </plugins>
   </build>
   <profiles>
      <profile>
         <id>productionMode</id>
         <activation>
            <property>
               <name>vaadin.productionMode</name>
            </property>
         </activation>
         <dependencies>
            <dependency>
               <groupId>com.vaadin</groupId>
               <artifactId>flow-server-production-mode</artifactId>
            </dependency>
         </dependencies>
         <build>
            <plugins>
               <plugin>
                  <groupId>com.vaadin</groupId>
                  <artifactId>flow-maven-plugin</artifactId>
                  <version>${flow.maven.plugin.version}</version>
                  <executions>
                     <execution>
                        <goals>
                           <goal>copy-production-files</goal>
                           <goal>package-for-production</goal>
                        </goals>
                        <configuration>
                           <transpileOutputDirectory>${webapp.directory}</transpileOutputDirectory>
                        </configuration>
                     </execution>
                  </executions>
               </plugin>
               <plugin>
                  <groupId>org.springframework.boot</groupId>
                  <artifactId>spring-boot-maven-plugin</artifactId>
                  <configuration>
                     <jvmArguments>-Dvaadin.productionMode</jvmArguments>
                  </configuration>
               </plugin>
            </plugins>
         </build>
      </profile>
   </profiles>
</project>

这是我正在使用的maven命令:

mvn -Pvaadin.productionMode clean vaadin:prepare-frontend vaadin:build-frontend package

这是输出:

:~/app$ mvn -Pvaadin.productionMode clean vaadin:prepare-frontend vaadin:build-frontend package                           
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for my.app   :app   :jar:0.0.1-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for com.vaadin:vaadin-maven-plugin is missing. @ line 106,column 12
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason,future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO] 
[INFO] -------------< my.app   :app    >--------------
[INFO] Building app    0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ app    ---
[INFO] Deleting /home/markus/docker-compose-executions/app   /app   /target
[INFO] Deleting /home/markus/docker-compose-executions/app   /app   /node_modules (includes = [**],excludes = [])
[INFO] Deleting /home/markus/docker-compose-executions/app   /app    (includes = [*.json,*.js,pnpm-lock.yaml,types.d.ts],excludes = [])
[INFO] 
[INFO] --- vaadin-maven-plugin:17.0.7:prepare-frontend (default-cli) @ app    ---
[INFO] Added 19 default dependencies to main package.json
[INFO] writing file /home/markus/docker-compose-executions/app   /app   /package.json.
[INFO] writing file /home/markus/docker-compose-executions/app   /app   /target/flow-frontend/package.json.
[INFO] writing file /home/markus/docker-compose-executions/app   /app   /target/flow-frontend/form/package.json.
[INFO] writing file '/home/markus/docker-compose-executions/app   /app   /target/index.html'
[INFO] writing file '/home/markus/docker-compose-executions/app   /app   /target/index.ts'
[INFO] writing file '/home/markus/docker-compose-executions/app   /app   /tsconfig.json'
[INFO] writing file '/home/markus/docker-compose-executions/app   /app   /types.d.ts'
[INFO] Copying frontend resources from jar files ...
[INFO] Visited 162 resources. Took 268 ms.
[INFO] Created webpack configuration file: '/home/markus/docker-compose-executions/app   /app   /webpack.config.js'
[INFO] 
[INFO] --- vaadin-maven-plugin:17.0.7:build-frontend (default-cli) @ app    ---
[INFO] Scanning classes to find frontend configurations and dependencies...
[INFO] Visited 647 classes. Took 1279 ms.
[INFO] Visited 86 classes. Took 47 ms.
[INFO] writing file /home/markus/docker-compose-executions/app   /app   /target/flow-frontend/package.json.
[INFO] writing file /home/markus/docker-compose-executions/app   /app   /target/flow-frontend/form/package.json.
[INFO] writing file '/home/markus/docker-compose-executions/app   /app   /target/index.html'
[INFO] writing file '/home/markus/docker-compose-executions/app   /app   /target/index.ts'
[INFO] Parsing java files from [/home/markus/docker-compose-executions/app   /app   /src/main/java]
[INFO] There are no connect endpoints to generate.
[INFO] Added 33 dependencies to main package.json
[INFO] writing file /home/markus/docker-compose-executions/app   /app   /package.json.
[INFO] Running `pnpm install` to resolve and optionally download frontend dependencies. This may take a moment,please stand by...
[WARNING] Couldn't find  dev dependencies file. Dev dependencies won't be locked
[INFO] Generated pnpmfile hook file: '/home/markus/docker-compose-executions/app   /app   /pnpmfile.js'
[INFO] installing pnpm version 4.4.0 locally
[INFO] using '/usr/bin/node /home/markus/.vaadin/node_modules/pnpm/bin/pnpm.js' for frontend package installation
[INFO] Frontend dependencies resolved successfully.
[INFO] Copying frontend resources from jar files ...
[INFO] Visited 162 resources. Took 66 ms.
[INFO] Updated /home/markus/docker-compose-executions/app   /app   /target/frontend/generated-flow-imports-fallback.js
[INFO] Updated /home/markus/docker-compose-executions/app   /app   /target/frontend/generated-flow-imports.js
[INFO] Updated /home/markus/docker-compose-executions/app   /app   /target/frontend/generated-flow-imports.d.ts
[INFO] Running webpack ...
: Using typescript@3.8.3 from typescript
: Using tsconfig.json from /home/markus/docker-compose-executions/app   /app   /tsconfig.json
: Checking started in a separate process...
: Checking finished with 1 errors
Hash: c1391e3e8704817266b9
Version: webpack 4.42.0
Time: 15519ms
Built at: 2020-10-25 22:59:27
 5 assets
Entrypoint bundle =
Entrypoint export = build/vaadin-export-040d8e0d55fe4b3daad3.cache.js
 [23] ../node_modules/.pnpm/registry.npmjs.org/@polymer/polymer/3.2.0/node_modules/@polymer/polymer/lib/elements/custom-style.js + 1 modules 6.24 KiB {1} {3} [built]
      |    2 modules
 [43] ../node_modules/.pnpm/registry.npmjs.org/@polymer/iron-icon/3.0.1/node_modules/@polymer/iron-icon/iron-icon.js + 1 modules 16 KiB {1} {3} [built]
      |    2 modules
 [47] ../node_modules/.pnpm/registry.npmjs.org/@vaadin/vaadin-lumo-styles/1.6.0/node_modules/@vaadin/vaadin-lumo-styles/icons.js + 1 modules 14.3 KiB {1} {3} [built]
      |    2 modules
 [48] ../target/frontend/generated-flow-imports.js 1.35 KiB {1} {5} [built]
 [49] ../target/index.ts + 1 modules 92.2 KiB {0} [built]
      | ../target/index.ts 1.43 KiB [built]
      |     + 1 hidden module
 [50] ../target/frontend/generated-flow-imports-fallback.js + 8 modules 15.3 KiB {4} [built]
      | ../target/frontend/generated-flow-imports-fallback.js 3.95 KiB [built]
      | ../target/flow-frontend/comboBoxConnector-es6.js 417 bytes [built]
      | ../target/flow-frontend/contextMenuConnector-es6.js 319 bytes [built]
      | ../target/flow-frontend/dndConnector-es6.js 29 bytes [built]
      | ../target/flow-frontend/flow-component-renderer.js 5.23 KiB [built]
      | ../target/flow-frontend/gridConnector-es6.js 590 bytes [built]
      | ../target/flow-frontend/ironListConnector-es6.js 255 bytes [built]
      | ../target/flow-frontend/ironListStyles.js 320 bytes [built]
      | ../target/flow-frontend/vaadin-grid-flow-selection-column.js 3.88 KiB [built]
 [56] ../node_modules/.pnpm/registry.npmjs.org/@vaadin/vaadin-text-field/2.6.2/node_modules/@vaadin/vaadin-text-field/theme/lumo/vaadin-text-field.js + 1 modules 11.1 KiB {2} [built]
      |    2 modules
 [71] ../node_modules/.pnpm/registry.npmjs.org/@vaadin/vaadin-item/2.2.0/node_modules/@vaadin/vaadin-item/theme/lumo/vaadin-item.js + 1 modules 2.23 KiB {2} [built]
      |    2 modules
 [76] ../node_modules/.pnpm/registry.npmjs.org/@vaadin/vaadin-list-box/1.3.0/node_modules/@vaadin/vaadin-list-box/theme/lumo/vaadin-list-box.js + 1 modules 2.85 KiB {2} [built]
      |    2 modules
 [77] ../node_modules/.pnpm/registry.npmjs.org/@vaadin/vaadin-text-field/2.6.2/node_modules/@vaadin/vaadin-text-field/theme/lumo/vaadin-password-field.js + 1 modules 1.06 KiB {2} [built]
      |    2 modules
[111] ../node_modules/.pnpm/registry.npmjs.org/@vaadin/vaadin-date-picker/4.2.0/node_modules/@vaadin/vaadin-date-picker/theme/lumo/vaadin-date-picker.js + 6 modules 13.9 KiB {2} [built]
      |    7 modules
[114] ../node_modules/.pnpm/registry.npmjs.org/@vaadin/vaadin-time-picker/2.2.0/node_modules/@vaadin/vaadin-time-picker/theme/lumo/vaadin-time-picker.js + 3 modules 1.73 KiB {2} [built]
      |    4 modules
[115] ../node_modules/.pnpm/registry.npmjs.org/@vaadin/vaadin-login/1.1.0/node_modules/@vaadin/vaadin-login/theme/lumo/vaadin-login-form.js + 2 modules 883 bytes {2} [built]
      |    3 modules
[117] ../node_modules/.pnpm/registry.npmjs.org/@vaadin/vaadin-context-menu/4.4.0/node_modules/@vaadin/vaadin-context-menu/theme/lumo/vaadin-context-menu.js + 1 modules 4.92 KiB {2} [built]
      |    2 modules
[118] ../node_modules/.pnpm/registry.npmjs.org/@vaadin/vaadin-custom-field/1.1.0/node_modules/@vaadin/vaadin-custom-field/theme/lumo/vaadin-custom-field.js + 1 modules 2.87 KiB {2} [built]
      |    2 modules
    + 152 hidden modules

ERROR in ../target/index.ts
Module not found: Error: Can't resolve '@vaadin/flow-frontend/Flow' in '/home/markus/docker-compose-executions/app   /app   /target'
 @ ../target/index.ts 15:0-50 16:33-37

ERROR in chunk bundle [entry]
build/vaadin-bundle-abadb23bac92212c113c.cache.js
/home/markus/docker-compose-executions/app   /app   /node_modules/.pnpm/registry.npmjs.org/awesome-typescript-loader/5.2.1_typescript@3.8.3/node_modules/awesome-typescript-loader/dist/entry.js!/home/markus/docker-compose-executions/app   /app   /target/index.ts f94cc97538a37d57399caa03b213501e
Unexpected token (17:33)
| // import Flow module to enable navigation to Vaadin server-side views
| 
| const { serverSideRoutes } = new !(function webpackMissingModule() { var e = new Error("Cannot find module '@vaadin/flow-frontend/Flow'"); e.code = 'MODULE_NOT_FOUND'; throw e; }())({
|     imports: () => Promise.all(/* import() */[__webpack_require__.e(3),__webpack_require__.e(5)]).then(__webpack_require__.bind(null,48))
| });

ERROR in [at-loader] ./target/index.ts:18:20 
    TS2307: Cannot find module '@vaadin/flow-frontend/Flow'.
Child html-webpack-plugin for "index.html":
     1 asset
    Entrypoint undefined = index.html
    [0] ../node_modules/.pnpm/registry.npmjs.org/html-webpack-plugin/3.2.0_webpack@4.42.0/node_modules/html-webpack-plugin/lib/loader.js!../target/index.html 1.13 KiB {0} [built]
        + 3 hidden modules
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  51.978 s
[INFO] Finished at: 2020-10-25T22:59:27+01:00
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "vaadin.productionMode" could not be activated because it does not exist.
[ERROR] Failed to execute goal com.vaadin:vaadin-maven-plugin:17.0.7:build-frontend (default-cli) on project app   : Webpack process exited with non-zero exit code.
[ERROR] Stderr: ''
[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/MojoExecutionException

我没有其他想法了,这是怎么了。 我在这里尝试了说明: https://vaadin.com/docs/flow/production/tutorial-production-mode-basic.html 但是'executions'标签使maven失败了。 摘录来自这里: https://github.com/vaadin/flow-spring-examples/blob/master/pom.xml

原始{甚至不工作的)pom.xml是从https://start.spring.io/生成的

我认为我的pom.xml缺少某些内容,但我不知道是什么。 有人使用Spring Boot和vaadin运行了pom.xml吗?

重新阅读并尝试删除和添加插件后,我认为错误是此行: ''' 错误:无法解析“ @ vaadin / flow-frontend / Flow” ''' 为什么不编译以及如何编译?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-
参考1 参考2 解决方案 # 点击安装源 协议选择 http:// 路径填写 mirrors.aliyun.com/centos/8.3.2011/BaseOS/x86_64/os URL类型 软件库URL 其他路径 # 版本 7 mirrors.aliyun.com/centos/7/os/x86
报错1 [root@slave1 data_mocker]# kafka-console-consumer.sh --bootstrap-server slave1:9092 --topic topic_db [2023-12-19 18:31:12,770] WARN [Consumer clie
错误1 # 重写数据 hive (edu)&gt; insert overwrite table dwd_trade_cart_add_inc &gt; select data.id, &gt; data.user_id, &gt; data.course_id, &gt; date_format(
错误1 hive (edu)&gt; insert into huanhuan values(1,&#39;haoge&#39;); Query ID = root_20240110071417_fe1517ad-3607-41f4-bdcf-d00b98ac443e Total jobs = 1
报错1:执行到如下就不执行了,没有显示Successfully registered new MBean. [root@slave1 bin]# /usr/local/software/flume-1.9.0/bin/flume-ng agent -n a1 -c /usr/local/softwa
虚拟及没有启动任何服务器查看jps会显示jps,如果没有显示任何东西 [root@slave2 ~]# jps 9647 Jps 解决方案 # 进入/tmp查看 [root@slave1 dfs]# cd /tmp [root@slave1 tmp]# ll 总用量 48 drwxr-xr-x. 2
报错1 hive&gt; show databases; OK Failed with exception java.io.IOException:java.lang.RuntimeException: Error in configuring object Time taken: 0.474 se
报错1 [root@localhost ~]# vim -bash: vim: 未找到命令 安装vim yum -y install vim* # 查看是否安装成功 [root@hadoop01 hadoop]# rpm -qa |grep vim vim-X11-7.4.629-8.el7_9.x
修改hadoop配置 vi /usr/local/software/hadoop-2.9.2/etc/hadoop/yarn-site.xml # 添加如下 &lt;configuration&gt; &lt;property&gt; &lt;name&gt;yarn.nodemanager.res