java - 关闭调试模式@Vaadin Spring Boot Application
问题描述
我的问题是我的 Vaadin 应用程序卡在调试模式,我无法将其关闭。
Vaadin is running in DEBUG MODE.
In order to run your application in production mode and disable debug features, you should enable it by setting the servlet init parameter productionMode to true.
See https://vaadin.com/docs/v14/flow/production/tutorial-production-mode-basic.html for more information about the production mode.
即使我尝试使用 -Dvaadin.productionMode 或 -Pproduction jvmArguments 运行,它也始终以 DEBUG 模式运行......
我按照下面的链接,pom文件看起来不错
<profiles>
<profile>
<!-- Production mode is activated using -Pproduction -->
<id>production</id>
<properties>
<vaadin.productionMode>true</vaadin.productionMode>
</properties>
<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>
<configuration>
<jvmArguments>-Dvaadin.productionMode</jvmArguments>
</configuration>
</plugin>
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>build-frontend</goal>
</goals>
<phase>compile</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
application.properties 文件还包含这是生产。
vaadin.servlet.productionMode=true
vaadin.servlet.heartbeatInterval=60
vaadin.servlet.closeIdleSessions=true
完整的 pom 文件:*注:配置文件的结尾最近被注释掉了
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.vaadin.tutorial.crm</groupId>
<artifactId>vaadin-crm</artifactId>
<name>Vaadin CRM</name>
<version>2.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<vaadin.version>14.1.5</vaadin.version>
<drivers.dir>${project.basedir}/drivers</drivers.dir>
<drivers.downloader.phase>pre-integration-test</drivers.downloader.phase>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.7.RELEASE</version>
</parent>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>https://repo1.maven.org/maven2/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<!-- Repository used by many Vaadin add-ons -->
<repository>
<id>Vaadin Directory</id>
<url>https://maven.vaadin.com/vaadin-addons</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-bom</artifactId>
<version>${vaadin.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<!-- Replace artifactId with vaadin-core to use only free components -->
<artifactId>vaadin</artifactId>
<exclusions>
<!-- Webjars are only needed when running in Vaadin 13 compatibility
mode -->
<exclusion>
<groupId>com.vaadin.webjar</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.webjars.bowergithub.insites</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.webjars.bowergithub.polymer</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.webjars.bowergithub.polymerelements</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.webjars.bowergithub.vaadin</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.webjars.bowergithub.webcomponents</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-spring-boot-starter</artifactId>
<exclusions>
<!-- Excluding so that webjars are not included. -->
<exclusion>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-testbench</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.12</version>
<scope>provided</scope>
</dependency>
<!-- ***************************** -->
<!-- END OF SKELETON DEPENDIENCIES -->
<!-- ***************************** -->
</dependencies>
<build>
<defaultGoal>spring-boot:run</defaultGoal>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!-- Clean build and startup time for Vaadin apps sometimes may exceed
the default Spring Boot's 30sec timeout. -->
<configuration>
<wait>500</wait>
<maxAttempts>240</maxAttempts>
</configuration>
</plugin>
<!-- Take care of synchronizing java dependencies and imports in package.json
and main.js files. It also creates webpack.config.js if not exists yet. -->
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>${vaadin.version}</version>
<executions>
<execution>
<goals>
<goal>prepare-frontend</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<!-- Production mode is activated using -Pproduction -->
<id>production</id>
<properties>
<vaadin.productionMode>true</vaadin.productionMode>
</properties>
<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>
<configuration>
<jvmArguments>-Dvaadin.productionMode</jvmArguments>
</configuration>
</plugin>
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>build-frontend</goal>
</goals>
<phase>compile</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- <profile> -->
<!-- <id>integration-tests</id> -->
<!-- <build> -->
<!-- <plugins> -->
<!-- <plugin> -->
<!-- <groupId>org.springframework.boot</groupId> -->
<!-- <artifactId>spring-boot-maven-plugin</artifactId> -->
<!-- <executions> -->
<!-- <execution> -->
<!-- <id>start-spring-boot</id> -->
<!-- <phase>pre-integration-test</phase> -->
<!-- <goals> -->
<!-- <goal>start</goal> -->
<!-- </goals> -->
<!-- </execution> -->
<!-- <execution> -->
<!-- <id>stop-spring-boot</id> -->
<!-- <phase>post-integration-test</phase> -->
<!-- <goals> -->
<!-- <goal>stop</goal> -->
<!-- </goals> -->
<!-- </execution> -->
<!-- </executions> -->
<!-- </plugin> -->
<!-- Runs the integration tests (*IT) after the server is started -->
<!-- <plugin> -->
<!-- <groupId>org.apache.maven.plugins</groupId> -->
<!-- <artifactId>maven-failsafe-plugin</artifactId> -->
<!-- <executions> -->
<!-- <execution> -->
<!-- <goals> -->
<!-- <goal>integration-test</goal> -->
<!-- <goal>verify</goal> -->
<!-- </goals> -->
<!-- </execution> -->
<!-- </executions> -->
<!-- <configuration> -->
<!-- <trimStackTrace>false</trimStackTrace> -->
<!-- <enableAssertions>true</enableAssertions> -->
<!-- <systemPropertyVariables> -->
<!-- Pass location of downloaded webdrivers to the tests -->
<!-- <webdriver.chrome.driver>${webdriver.chrome.driver}</webdriver.chrome.driver> -->
<!-- </systemPropertyVariables> -->
<!-- </configuration> -->
<!-- </plugin> -->
<!-- <plugin> -->
<!-- <groupId>com.lazerycode.selenium</groupId> -->
<!-- <artifactId>driver-binary-downloader-maven-plugin</artifactId> -->
<!-- <version>1.0.17</version> -->
<!-- <configuration> -->
<!-- <onlyGetDriversForHostOperatingSystem>true -->
<!-- </onlyGetDriversForHostOperatingSystem> -->
<!-- <rootStandaloneServerDirectory> -->
<!-- ${project.basedir}/drivers/driver -->
<!-- </rootStandaloneServerDirectory> -->
<!-- <downloadedZipFileDirectory> -->
<!-- ${project.basedir}/drivers/driver_zips -->
<!-- </downloadedZipFileDirectory> -->
<!-- <customRepositoryMap> -->
<!-- ${project.basedir}/drivers.xml -->
<!-- </customRepositoryMap> -->
<!-- </configuration> -->
<!-- <executions> -->
<!-- <execution> -->
<!-- use phase "none" to skip download step -->
<!-- <phase>${drivers.downloader.phase}</phase> -->
<!-- <goals> -->
<!-- <goal>selenium</goal> -->
<!-- </goals> -->
<!-- </execution> -->
<!-- </executions> -->
<!-- </plugin> -->
<!-- </plugins> -->
<!-- </build> -->
<!-- </profile> -->
</profiles>
</project>
解决方案
推荐阅读
- go - 我们可以使用带有操作员 SDK 的 openshift 模板来生成 CRD
- python - 使用 python logger 将记录器文件写入目录
- java - 修复应用程序不断停止使用 android studio
- javascript - “TypeError: Cannot read properties of undefined (reading '0')”在从 React/redux 检索数据时从 React 中的数组访问数据时
- java - 猜图像游戏,无重复的随机图像生成器
- python - numba.core.errors.TypingError:使用 np.random.randint() 时
- pdf - 有没有办法下载我有查看权限并且只有链接的谷歌幻灯片文档?
- angular - 检测到循环依赖中的警告 - 自从更新到 Angular 10
- r - 使用(样条)变换调整列线图刻度,rms 包 [R]
- android - TextToSpeech 不发音第一个视频的名称