0

我正在尝试使用 maven 编译一个 grails 项目。我收到以下错误

[INFO] Scanning for projects...
[WARNING] The POM for org.grails.plugins:kickstart-with-bootstrap:jar:1.1.0 is missing, no dependency information available
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project com.test:temp2:0.1 (/mnt/data/Work/Tutorials/Practice/grails/temp2/pom.xml) has 2 errors
[ERROR]     Unresolveable build extension: Plugin org.grails.plugins:kickstart-with-bootstrap:1.1.0 or one of its dependencies could not be resolved: Failure to find org.grails.plugins:kickstart-with-bootstrap:jar:1.1.0 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 2]
[ERROR]     Unknown packaging: grails-app @ line 9, column 16
[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/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

该错误以至于我什至无法生成依赖关系树。我附上了我的 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>com.test</groupId>
    <artifactId>temp2</artifactId>
    <packaging>grails-app</packaging>
    <version>0.1</version>

    <name>temp2</name>
    <description>temp2</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>
    </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.5</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.3</version>
            <configuration>
                <grailsVersion>${grails.version}</grailsVersion>
            </configuration>
            <extensions>true</extensions>
        </plugin>

        <plugin>
            <groupId>org.grails.plugins</groupId>
            <artifactId>kickstart-with-bootstrap</artifactId>
            <version>1.1.0</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>
4

1 回答 1

1

您在这里有 2 个不正确的实现:

  1. kickstart-with-bootstrap是一个 grails插件依赖项,因此它应该在<dependencies>部分 in下pom.xml,而不是 maven 插件。

  2. Grails 插件被打包为zip和 not jar,所以<type>依赖关系应该是zip

解决方案:

删除此部分

<plugin>
     <groupId>org.grails.plugins</groupId>
     <artifactId>kickstart-with-bootstrap</artifactId>
     <version>1.1.0</version>
     <configuration>
         <grailsVersion>${grails.version}</grailsVersion>
     </configuration>
     <extensions>true</extensions>
</plugin>

并将此部分添加到<dependencies>

<dependency>
    <groupId>org.grails.plugins</groupId>
    <artifactId>kickstart-with-bootstrap</artifactId>
    <version>1.1.0</version>
    <type>zip</zip>
</dependency>
于 2014-08-17T01:07:53.107 回答