我遇到了一个过滤后的context.xml文件打包在mvn-grails:war执行中的问题。
当你进行mvnwar:war时,我可以使用它,但这样做并不能创建我的grails应用程序war。当运行mvn-grails:war时,我没有得到context.xml文件。这是grails:war-target没有运行maven-war插件的情况吗?我没有犯任何错误。感谢您的帮助。以下是我的相关pom设置:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<webResources>
<resource>
<directory>${basedir}/src/main/webapp/META-INF</directory>
<filtering>true</filtering>
<targetPath>META-INF</targetPath>
<includes>
<include>**/context.xml</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>
<plugin>
<groupId>org.grails</groupId>
<artifactId>grails-maven-plugin</artifactId>
<version>1.3.4</version>
<extensions>true</extensions>
<executions>
<execution>
<goals>
<goal>init</goal>
<goal>maven-clean</goal>
<goal>validate</goal>
<goal>config-directories</goal>
<goal>maven-compile</goal>
<goal>maven-test</goal>
<goal>maven-war</goal>
<goal>maven-functional-test</goal>
<goal>war</goal>
</goals>
</execution>
</executions>
</plugin>
...
<filters>
<filter>${basedir}/src/main/filters/dev.properties</filter>
</filters>
grails:war使用grails命令生成war,因此它将忽略您在"maven-war插件"中配置的任何内容。您必须在grails中配置它。