Hello,
在build生产模式下生成war包失败,输入命令mvn package -Dvaadin.productionMode,提示Unknown lifecycle phase “.productionMode”.请帮忙看一下是否pom缺少了什么配置。
这是控制台信息:
PS C:\Users\SIMEON\Downloads\my-starter-project\my-starter-project-ui> mvn package -Dvaadin.productionMode
[INFO]
Scanning for projects...
[INFO]
[INFO]
----------------< com.qq.zz:my-starter-project-ui >-----------------
[INFO]
Building My Starter Project-ui 1.0-SNAPSHOT
[INFO]
--------------------------------[ war ]
---------------------------------
[INFO]
------------------------------------------------------------------------
[INFO]
BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO]
Total time: 0.216 s
[INFO]
Finished at: 2018-11-28T08:32:19+08:00
[INFO]
------------------------------------------------------------------------
[ERROR]
Unknown lifecycle phase ".productionMode". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]
:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [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/LifecyclePhaseNotFoundException
PS C:\Users\SIMEON\Downloads\my-starter-project\my-starter-project-ui>
这是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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>my-starter-project</artifactId>
<groupId>com.qq.zz</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>my-starter-project-ui</artifactId>
<name>My Starter Project-ui</name>
<packaging>war</packaging>
<dependencies>
<!-- Versions for these are configured in the parent POM -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>my-starter-project-backend</artifactId>
<version>${project.version}</version>
</dependency>
<!-- Bean validation implementation -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>5.4.1.Final</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-core</artifactId>
</dependency>
<dependency>
<groupId>org.vaadin.pekka</groupId>
<artifactId>checkbox-group-java</artifactId>
<version>1.0.0.alpha1</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
</dependency>
<!-- Added to provide logging output as Flow uses -->
<!-- the unbound SLF4J no-operation (NOP) logger implementation -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.plugin.version}</version>
<configuration>
<scanIntervalSeconds>2</scanIntervalSeconds>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>productionMode</id>
<activation>
<property>
<name>vaadin.productionMode</name>
</property>
</activation>
<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>copy-production-files</goal>
<goal>package-for-production</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.plugin.version}</version>
<configuration>
<webAppConfig>
<resourceBases>
<!-- add the default transpileOutputDirectory as resourceBase for jetty -->
<resourceBase>${project.build.directory}/${project.build.finalName}</resourceBase>
</resourceBases>
</webAppConfig>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>