我在我的和启用中使用Wildfly 20
和IntelliJ latest
版本。vaadin-maven-plugin 14.2.2
pom.xml
pnpm
一个非常丑陋的问题发生了,我不明白为什么。当我通过 IntelliJ 运行配置运行我的项目时,会发生一些奇怪的事情。IntelliJ 使用旧版本的 vaadin-plugin,即vaadin-maven-plugin 14.2.0
我的 pom.xml 中没有它。
我已经尝试mvn help:effective-pom
查看 pom 中是否存在此依赖项的多个版本,并使用检查了所有传递依赖项mvn dependency:tree
任何人都知道为什么会发生这种情况,我应该怎么做才能防止它?
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<vaadin.version>14.2.2</vaadin.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-help-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>show-profiles</id>
<phase>compile</phase>
<goals>
<goal>active-profiles</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.3</version>
</plugin>
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>${vaadin.version}</version>
<executions>
<execution>
<goals>
<goal>prepare-frontend</goal>
</goals>
</execution>
</executions>
<configuration>
<pnpmEnable>true</pnpmEnable>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<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>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>${vaadin.version}</version>
<executions>
<execution>
<goals>
<goal>build-frontend</goal>
</goals>
</execution>
</executions>
<configuration>
<pnpmEnable>true</pnpmEnable>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
如果我使用 wildfly 插件并执行,wildfly:run
我会收到以下错误
ERROR in ../target/frontend/generated-flow-imports-fallback.js
Module not found: Error: Can't resolve '@vaadin/flow-frontend/?babel-target=es5' in 'C:\workspace\user-web\target\frontend'
@ ../target/frontend/generated-flow-imports-fallback.js 45:0-32
@ ../target/frontend/generated-flow-imports.js?babel-target=es5
ERROR in ../target/frontend/generated-flow-imports-fallback.js
Module not found: Error: Can't resolve '@vaadin/flow-frontend/?babel-target=es6' in 'C:\workspace\user-web\target\frontend'
@ ../target/frontend/generated-flow-imports-fallback.js 45:0-32
@ ../target/frontend/generated-flow-imports.js?babel-target=es6
Failed to execute goal com.vaadin:vaadin-maven-plugin:14.2.2:build-frontend
(default) on project user-web: Webpack process exited with non-zero exit code.
Stderr: ''
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>2.1.0.Beta1</version>
<configuration>
<server-args>
<server-arg>-Duser.properties.file=C:\appserver.properties</server-arg>
</server-args>
</configuration>
</plugin>