0

私はmavenが初めてで、それを学ぼうとしています。現在、maven を使用して grails アプリケーションを構築しようとしています。pomのコンパイル中にこのエラーが発生しました

Failure to find org.codehaus.groovy:groovy-all:jar:2.4.2 in http://repo.grails.org/grails/core

いくつかの Maven ドキュメントを読み、Maven の中央サイトを確認した後、この jar が Maven の中央の場所で利用できないことがわかりました。したがって、この依存関係を利用可能な jar でオーバーライドすることにしました。しかし、それでも同じエラーが発生します。

私のpomファイルは以下の通りです

<?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>com.mycompany</groupId>
    <artifactId>grails-mongo-demo</artifactId>
    <packaging>grails-app</packaging>
    <version>0.1</version>
    <name>grails-mongo-demo</name>
    <description>grails-mongo-demo</description>
    <properties>
        <grails.version>2.4.2</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.11</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.spockframework</groupId>
            <artifactId>spock-core</artifactId>
            <version>0.7-groovy-2.0</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-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.7</version>
            <scope>compile</scope>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>org.grails.plugins</groupId>
            <artifactId>asset-pipeline</artifactId>
            <version>1.8.11</version>
            <scope>compile</scope>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>org.grails.plugins</groupId>
            <artifactId>hibernate4</artifactId>
            <version>4.3.5.4</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.54</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>
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-all</artifactId>
            <version>2.3.6</version>
        </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>
                <version>2.17</version>
                <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.2</version>
                <configuration>
                    <grailsVersion>${grails.version}</grailsVersion>
                </configuration>
                <extensions>true</extensions>
            </plugin>
        </plugins>
    </build>
    <repositories>
        <repository>
            <id>grails</id>
            <name>grails</name>
            <url>http://repo.grails.org/grails/core</url>
        </repository>
        <repository>
            <id>grails-plugins</id>
            <name>grails-plugins</name>
            <url>http://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>

そして、私が得るエラーは次のとおりです。

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building grails-mongo-demo 0.1
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ grails-mongo-demo ---
[INFO] 
[INFO] --- grails-maven-plugin:2.4.2:clean (default-clean) @ grails-mongo-demo ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.968 s
[INFO] Finished at: 2014-09-04T12:56:22+05:30
[INFO] Final Memory: 8M/102M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.grails:grails-maven-plugin:2.4.2:clean (default-clean) on project grails-mongo-demo: Failed to create classpath for Grails execution. Failure to find org.codehaus.groovy:groovy-all:jar:2.4.2 in http://repo.grails.org/grails/core was cached in the local repository, resolution will not be reattempted until the update interval of grails has elapsed or updates are forced -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

私が間違っている場所を誰かが知っているなら、私を助けてください。

よろしくお願いします。

4

1 に答える 1

1

私は今それを働かせました。grails-maven-plugin 2.4.2 にバグがありました。2.4.3 にアップグレードすると、問題が解決しました。私の質問に答えてくれてありがとう。

于 2014-09-04T08:12:41.663 に答える