gmaven grails项目没有使用maven-war-plugin

时间:2011-06-24 17:51:02

标签: grails maven maven-war-plugin grails-maven

我遇到过滤的context.xml文件被打包在mvn grails:war执行中的问题。

当你做战争时,我有它工作:战争,但这样做不会创建我的grails应用程序战争。运行mvn grails时:war我没有得到context.xml文件。这是grails的情况:战争目标没有运行maven-war-plugin?我没有错。任何帮助表示赞赏。以下是我的相关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>

1 个答案:

答案 0 :(得分:0)

grails:war使用grails命令生成war,因此它将忽略您在“maven war plugin”中配置的任何内容。您必须在grails中配置它。