更新时间:2023-09-29 22:50:22
要么配置resources:resources
插件的outputDirectory
参数,要么将文件放在src/main/webapp/WEB-INF/
目录下.
资源插件
either configure the outputDirectory
parameter of resources:resources
plugin, or put your files under src/main/webapp/WEB-INF/
directory.
resource plugin
此配置对我有用:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4.2</version>
<executions>
<execution>
<id>default-copy-resources</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<overwrite>true</overwrite>
<outputDirectory>${project.build.directory}/${project.artifactId}-${project.version}/WEB-INF/</outputDirectory>
<resources>
<resource>
<directory>${project.basedir}/src/main/resources</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
您可以运行somePhase
形式或目标somePlugin:someGoal
形式的阶段.阶段调用将按间隔[validate,phase]的顺序调用挂在阶段上的所有插件目标,因此无需显式调用它们.
you can run a phase in the form somePhase
or a goal somePlugin:someGoal
. The phase invocations will invoke all plugins goals hooked on phases in interval [validate,phase] in order, so there's no need to explicitly call them.