我正在关注文档 here但我最终得到了一个 jar
,它没有找到要执行的 war
。这是错误:
java.io.FileNotFoundException: C:\Users\ortizj\Documents\NetBeansProjects\valida
tion-manager\Validation-Manager-Web\target\.extract\webapps\ROOT.war (The system
cannot find the file specified)
由于某些原因,war
文件没有添加到 jar
中,因此在提取它时失败。
ROOT.war
存在并且存在于目标文件夹中。
相关POM内容如下:
<profile>
<id>installer</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<id>tomcat-run</id>
<goals>
<goal>exec-war-only</goal>
</goals>
<phase>package</phase>
<configuration>
<warRunDependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>Validation-Manager-Web</artifactId>
<version>${project.version}</version>
<type>war</type>
</dependency>
<charset>utf-8</charset>
<httpPort>9078</httpPort>
<contextPath>/</contextPath>
</warRunDependency>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
最佳答案
如何将它添加到您的 pom.xml 文件..
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>${maven-war-plugin.version}</version>
<configuration>
<warSourceDirectory>src/main/webapp</warSourceDirectory>
<warName>your-war-name</warName>
<failOnMissingWebXml>false</failOnMissingWebXml>
<outputDirectory>${deploy-path}</outputDirectory>
</configuration>
</plugin>
关于java - 找不到 Apache Tomcat Maven 插件 war ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44835340/