Java 奇怪的Maven例外构建战
我有一个Maven项目,在我在Java 奇怪的Maven例外构建战,java,maven,Java,Maven,我有一个Maven项目,在我在src/main/webapps/resources中添加了一些新的静态资源文件之前,它工作得很好 这个目录已经包含了子目录js、img和css,现在我添加了一个新的子目录instructions,其中添加了3个pdf文件,可以从部署的应用程序下载 当我运行mvn构建时,我现在得到以下异常: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (defa
src/main/webapps/resources
中添加了一些新的静态资源文件之前,它工作得很好
这个目录已经包含了子目录js
、img
和css
,现在我添加了一个新的子目录instructions
,其中添加了3个pdf文件,可以从部署的应用程序下载
当我运行mvn构建时,我现在得到以下异常:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-war) on project jpa:
Error assembling WAR: resources/instructions/entrance.pdf not found. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException:
Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-war) on project jpa:
Error assembling WAR: resources/instructions/entrance.pdf not found.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.MojoExecutor.executeForkedExecutions(MojoExecutor.java:365)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:199)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
它似乎在抱怨我刚才添加的一个文件不在那里,而它肯定在那里,为什么?第二,它为什么要关心
编辑
添加了pom.xml。许多依赖项被省略了,否则会很长
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>nick</groupId>
<artifactId>jpa</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>jpa</name>
<properties>
<spring.version>4.0.0.RELEASE</spring.version>
<mysql.version>5.1.27</mysql.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>1.4.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- many dependencies omitted for brevity -->
</dependencies>
<build>
<filters>
<filter>src/main/filters/${profile.id}.properties</filter>
</filters>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>dev</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<configuration>
<url>http://localhost:8080/manager/text</url>
<server>tomcat8080</server>
<path>/</path>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<profile.id>dev</profile.id>
</properties>
</profile>
</profiles>
</project>
4.0.0
刻痕
jpa
战争
0.0.1-快照
jpa
4.0.0.0发布
5.1.27
org.springframework.data
spring数据jpa
1.4.3.1发布
org.springframework
spring上下文
${spring.version}
src/main/filters/${profile.id}.properties
src/main/resources
真的
org.apache.maven.plugins
maven编译器插件
3.5.1
1.7
1.7
发展
org.apache.tomcat.maven
tomcat7 maven插件
http://localhost:8080/manager/text
tomcat8080
/
发展
发布整个POM,并发布完整的控制台日志和堆栈跟踪。但是,组装WAR时出错:未找到resources/instructions/entry.pdf。
对我来说看起来非常具体。是的,但文件是thereHum,您的POM甚至没有声明WAR插件。此异常不能与您发布的内容一起引发。我建议你做一个。好的。解决了它-如果我删除文件,它会工作。我只能假设它被文件阻塞了,也许它在某种程度上被破坏了。