0

使用 maven 构建 pom.xml 文件时出现以下错误。

Error resolving version for 'org.codehaus.mojo:gwt-maven-plugin': Plugin requires Maven version 2.1

下面是我的 pom.xml 文件

<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.group</groupId>
    <artifactId>WoofArchetypeResult</artifactId>
    <version>0.1-SNAPSHOT</version>
    <packaging>war</packaging>
    <name>WoofArchetypeResult</name>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <gwt.version>2.5.0</gwt.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>net.officefloor.plugin</groupId>
            <artifactId>officeplugin_woof</artifactId>
            <version>2.8.0</version>
        </dependency>
        <dependency>
            <!-- Remove if running stand alone -->
            <groupId>net.officefloor.plugin</groupId>
            <artifactId>officeplugin_woof_servlet</artifactId>
            <version>2.8.0</version>
        </dependency>
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-user</artifactId>
            <version>${gwt.version}</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
             <plugin>
                <!-- Standard JVM for compilation -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin> 
            <plugin>
                <!-- Compile GWT Java to JavaScript -->
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>gwt-maven-plugin</artifactId>
                <version>${gwt.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <!-- Test WoOF within Servlet Container -->
                <groupId>org.mortbay.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>8.1.8.v20121106</version>
                <configuration>
                    <connectors>
                        <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
                            <port>18080</port>
                        </connector>
                    </connectors>
                    <stopPort>18181</stopPort>
                    <stopKey>officefloor</stopKey>
                </configuration>
                <executions>
                    <execution>
                        <id>start-jetty</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <daemon>true</daemon>
                        </configuration>
                    </execution>
                    <execution>
                        <id>stop-jetty</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>stop</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <!-- Run tests against WoOF within Servlet Container -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.13</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

在 cmd 上点击“mvn install”命令后。我正在构建错误之上。我的 Maven 版本是 2.0.11

请帮我

4

1 回答 1

1

简单来说你需要使用升级版的Maven。如果您坚持使用 maven 2,那么至少升级到最新版本的 Maven 2 即Release 2.2.1

如果可以,请升级到 Maven 3 最新版本 3.0.4

您可能会花费大量精力来使旧东西正常工作,您不妨尝试将其用于构建新东西。

于 2013-01-28T03:48:54.467 回答