Grails 2.5.0 Maven构建问题

时间:2015-05-29 04:22:58

标签: maven grails

我正在尝试使用Maven构建一个新的Grails 2.5.0应用程序,但不断收到与grails-maven-plugin相关的错误。

    [ERROR] Failed to execute goal org.grails:grails-maven-plugin:2.4.4:clean (defau
lt-clean) on project grails_2.5.0_test: Execution default-clean of goal org.grai
ls:grails-maven-plugin:2.4.4:clean failed: java.lang.reflect.InvocationTargetExc
eption: org.codehaus.groovy.runtime.DefaultGroovyMethods.each(Ljava/util/Collect
ion;Lgroovy/lang/Closure;)Ljava/util/Collection; -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
rg.grails:grails-maven-plugin:2.4.4:clean (default-clean) on project grails_2.5.
0_test: Execution default-clean of goal org.grails:grails-maven-plugin:2.4.4:cle
an failed: java.lang.reflect.InvocationTargetException
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:224)

重现的步骤:

  1. grails create-app test
  2. grails create-pom test
  3. 在pom.xml
  4. 中将maven-clean-plugin依赖关系从2.4.0更新为2.4.1
  5. mvn clean install
  6. 我在JDK 1.7上运行它。

    相同的示例适用于Grails 2.4.4。我错过了什么或者这是2.5.0中的错误吗?

    的pom.xml

    <?xml version="1.0" encoding="utf-8"?>
    <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>test</groupId>
        <artifactId>grails_2.5.0_test</artifactId>
        <packaging>grails-app</packaging>
        <version>0.1</version>
    
        <name>grails_2.5.0_test</name>
        <description>grails_2.5.0_test</description>
    
        <properties>
            <grails.version>2.5.0</grails.version>
            <h2.version>1.3.170</h2.version>
        </properties>
    
        <dependencies>
            <dependency>
                <groupId>org.grails</groupId>
                <artifactId>grails-dependencies</artifactId>
                <version>${grails.version}</version>
                <type>pom</type>
            </dependency>
    
    
            <dependency>
                <groupId>org.grails</groupId>
                <artifactId>grails-test</artifactId>
                <version>${grails.version}</version>
                <scope>test</scope>
            </dependency>
    
            <dependency>
                <groupId>org.grails</groupId>
                <artifactId>grails-plugin-testing</artifactId>
                <version>${grails.version}</version>
                <scope>test</scope>
            </dependency>
    
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.12</version>
                <scope>test</scope>
            </dependency>
    
            <dependency>
                <groupId>org.spockframework</groupId>
                <artifactId>spock-core</artifactId>
                <version>1.0-groovy-2.4</version>
                <scope>test</scope>
            </dependency>
    
    
            <dependency>
                <groupId>com.h2database</groupId>
                <artifactId>h2</artifactId>
                <version>${h2.version}</version>
                <scope>runtime</scope>
            </dependency>
    
    
            <dependency>
                <groupId>org.grails</groupId>
                <artifactId>grails-datastore-test-support</artifactId>
                <version>1.0.2-grails-2.4</version>
                <scope>test</scope>
    
    
            </dependency>
    
    
            <dependency>
                <groupId>org.grails.plugins</groupId>
                <artifactId>scaffolding</artifactId>
                <version>2.1.2</version>
                <scope>compile</scope>
    
                <type>zip</type>
    
            </dependency>
    
            <dependency>
                <groupId>org.grails.plugins</groupId>
                <artifactId>cache</artifactId>
                <version>1.1.8</version>
                <scope>compile</scope>
    
                <type>zip</type>
    
            </dependency>
    
            <dependency>
                <groupId>org.grails.plugins</groupId>
                <artifactId>asset-pipeline</artifactId>
                <version>2.1.5</version>
                <scope>compile</scope>
    
                <type>zip</type>
    
            </dependency>
    
            <dependency>
                <groupId>org.grails.plugins</groupId>
                <artifactId>hibernate4</artifactId>
                <version>4.3.8.1</version>
                <scope>runtime</scope>
    
                <type>zip</type>
    
            </dependency>
    
            <dependency>
                <groupId>org.grails.plugins</groupId>
                <artifactId>database-migration</artifactId>
                <version>1.4.0</version>
                <scope>runtime</scope>
    
                <type>zip</type>
    
            </dependency>
    
            <dependency>
                <groupId>org.grails.plugins</groupId>
                <artifactId>jquery</artifactId>
                <version>1.11.1</version>
                <scope>runtime</scope>
    
                <type>zip</type>
    
            </dependency>
    
            <dependency>
                <groupId>org.grails.plugins</groupId>
                <artifactId>tomcat</artifactId>
                <version>7.0.55.2</version>
                <scope>provided</scope>
    
                <type>zip</type>
    
            </dependency>
    
            <dependency>
                <groupId>org.grails.plugins</groupId>
                <artifactId>webxml</artifactId>
                <version>1.4.1</version>
                <type>zip</type>
                <scope>runtime</scope>
            </dependency>
        </dependencies>
    
        <build>
            <pluginManagement/>
    
            <plugins>
                <!-- Disables the Maven surefire plugin for Grails applications, as we have our own test runner -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <skip>true</skip>
                    </configuration>
                    <executions>
                        <execution>
                            <id>surefire-it</id>
                            <phase>integration-test</phase>
                            <goals>
                                <goal>test</goal>
                            </goals>
                            <configuration>
                                <skip>false</skip>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>2.4.1</version>
                    <configuration>
                        <filesets>
                            <fileset>
                                <directory>plugins</directory>
                                <includes>
                                    <include>**/*</include>
                                </includes>
                                <followSymlinks>false</followSymlinks>
                            </fileset>
                        </filesets>
                    </configuration>
                </plugin>
    
                <plugin>
                    <groupId>org.grails</groupId>
                    <artifactId>grails-maven-plugin</artifactId>
                    <version>2.4.4</version>
                    <configuration>
                        <grailsVersion>${grails.version}</grailsVersion>
                    </configuration>
                    <extensions>true</extensions>
                </plugin>
            </plugins>
        </build>
    
        <repositories>
            <repository>
                <id>grails</id>
                <name>grails</name>
                <url>https://repo.grails.org/grails/core</url>
            </repository>
            <repository>
                <id>grails-plugins</id>
                <name>grails-plugins</name>
                <url>https://repo.grails.org/grails/plugins</url>
            </repository>
        </repositories>
    
        <profiles>
            <profile>
                <id>tools</id>
                <activation>
                    <property>
                        <name>java.vendor</name>
                        <value>Sun Microsystems Inc.</value>
                    </property>
                </activation>
                <dependencies>
                    <dependency>
                        <groupId>com.sun</groupId>
                        <artifactId>tools</artifactId>
                        <version>${java.version}</version>
                        <scope>system</scope>
                        <systemPath>${java.home}/../lib/tools.jar</systemPath>
                    </dependency>
                </dependencies>
            </profile>
        </profiles>
    </project>
    

1 个答案:

答案 0 :(得分:0)

已发布新版本的Grails Maven插件(2.4.6),修复了此问题。我已对此进行了测试,并确认问题已得到解决。