Google App Engine - 找不到Maven插件

时间:2013-03-17 15:10:17

标签: eclipse google-app-engine gwt maven

我想在我的app引擎应用程序中运行maven。但是,我得到了这个例外:

  

解析插件版本时出错   来自存储库的'org.apache.maven.plugins:gwt-maven-plugin'   [local(C:\ Users \ user.m2 \ repository),central   (http://repo.maven.apache.org/maven2)]:在任何插件中都找不到插件   存储库

这就是我的maven文件:

<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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>test</groupId>
    <artifactId>test</artifactId>
    <version>0.0.1-SNAPSHOT</version>

    <build>
        <sourceDirectory>src</sourceDirectory>
        <resources>
            <resource>
                <directory>src</directory>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>gwt-maven-plugin</artifactId>
                <configuration>
                    <webappDirectory>/test/war/WEB-INF/classes</webappDirectory>
                </configuration>
            </plugin>
        </plugins>
    </build>


    <repositories>
        <repository>
            <id>wso2</id>
            <url>http://dist.wso2.org/maven2/</url>
        </repository>
        <repository>
            <id>maven-repository-1</id>
            <url>http://repo1.maven.org/maven2/</url>
        </repository>
    </repositories>
    <dependencies>
        <dependency>
            <dependency>
                <groupId>com.google.gwt</groupId>
                <artifactId>gwt-servlet</artifactId>
                <version>2.5.1</version>
                <scope>runtime</scope>
            </dependency>
            <dependency>
                <groupId>com.google.gwt</groupId>
                <artifactId>gwt-user</artifactId>
                <version>2.5.1</version>
                <scope>provided</scope>
            </dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.1</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.12</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.webharvest.wso2</groupId>
            <artifactId>webharvest-core</artifactId>
            <version>1.0.0.wso2v1</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>
        <!-- web harvest pom doesn't track dependencies well -->
        <dependency>
            <groupId>net.sf.saxon</groupId>
            <artifactId>saxon-xom</artifactId>
            <version>8.7</version>
        </dependency>
        <dependency>
            <groupId>org.htmlcleaner</groupId>
            <artifactId>htmlcleaner</artifactId>
            <version>1.55</version>
        </dependency>
        <dependency>
            <groupId>bsh</groupId>
            <artifactId>bsh</artifactId>
            <version>1.3.0</version>
        </dependency>
        <dependency>
            <groupId>commons-httpclient</groupId>
            <artifactId>commons-httpclient</artifactId>
            <version>3.1</version>
        </dependency>
        <dependency>
            <!-- jsoup HTML parser library @ http://jsoup.org/ -->
            <groupId>org.jsoup</groupId>
            <artifactId>jsoup</artifactId>
            <version>1.7.2</version>
        </dependency>
    </dependencies>
</project>   

我应该添加什么才能让它运行?

更新

我正在使用这个maven插件,因为我得到了:

  

项目的输出目录应设置为   /测试/战/ WEB-INF /类

更新2

    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <version>2.5.1</version>
        <configuration>
            <webappDirectory>/test/war/WEB-INF/classes</webappDirectory>
        </configuration>
    </plugin>

我的例外是相同的:

  

项目的输出目录应设置为   /测试/战/ WEB-INF /类

我的maven文件:

<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>test</groupId>
<artifactId>test</artifactId>
<version>0.0.1-SNAPSHOT</version>

<build>
    <sourceDirectory>src</sourceDirectory>
    <resources>
        <resource>
            <directory>src</directory>
            <excludes>
                <exclude>**/*.java</exclude>
            </excludes>
        </resource>
    </resources>
    <plugins>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.3.2</version>
            <configuration>
                <source>1.7</source>
                <target>1.7</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>gwt-maven-plugin</artifactId>
            <version>2.5.1</version>
            <configuration>
                <webappDirectory>/test/war/WEB-INF/classes</webappDirectory>
            </configuration>
        </plugin>
    </plugins>
</build>


<repositories>
    <repository>
        <id>wso2</id>
        <url>http://dist.wso2.org/maven2/</url>
    </repository>
    <repository>
        <id>maven-repository-1</id>
        <url>http://repo1.maven.org/maven2/</url>
    </repository>
</repositories>
<dependencies>
    <dependency>
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-servlet</artifactId>
            <version>2.5.1</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-user</artifactId>
            <version>2.5.1</version>
            <scope>provided</scope>
        </dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <version>1.1</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.12</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.webharvest.wso2</groupId>
        <artifactId>webharvest-core</artifactId>
        <version>1.0.0.wso2v1</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
    <!-- web harvest pom doesn't track dependencies well -->
    <dependency>
        <groupId>net.sf.saxon</groupId>
        <artifactId>saxon-xom</artifactId>
        <version>8.7</version>
    </dependency>
    <dependency>
        <groupId>org.htmlcleaner</groupId>
        <artifactId>htmlcleaner</artifactId>
        <version>1.55</version>
    </dependency>
    <dependency>
        <groupId>bsh</groupId>
        <artifactId>bsh</artifactId>
        <version>1.3.0</version>
    </dependency>
    <dependency>
        <groupId>commons-httpclient</groupId>
        <artifactId>commons-httpclient</artifactId>
        <version>3.1</version>
    </dependency>
    <dependency>
        <!-- jsoup HTML parser library @ http://jsoup.org/ -->
        <groupId>org.jsoup</groupId>
        <artifactId>jsoup</artifactId>
        <version>1.7.2</version>
    </dependency>
    <dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.5.1</version>

    

1 个答案:

答案 0 :(得分:4)

您没有提到插件的组ID或工件ID,而maven正在尝试使用groupid。

    <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>gwt-maven-plugin</artifactId>
      <version>2.5.1</version>
    </plugin>

参考

  1. 您可以在central maven repo找到gwt-maven-plugin。
  2. 有关如何使用gwt-maven-plugin的参考。
  3. 浏览Google团队pom样本GWT+GAE app
  4. 注意 - 我在示例项目中测试了您的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/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
    
        <groupId>com.insanity.example.gwt</groupId>
        <artifactId>learning</artifactId>
        <version>1.0-SNAPSHOT</version>
        <build>
            <sourceDirectory>src</sourceDirectory>
            <resources>
                <resource>
                    <directory>src</directory>
                    <excludes>
                        <exclude>**/*.java</exclude>
                    </excludes>
                </resource>
            </resources>
            <plugins>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>2.3.2</version>
                    <configuration>
                        <source>1.7</source>
                        <target>1.7</target>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>gwt-maven-plugin</artifactId>
                    <version>2.5.1</version>
                    <configuration>
                        <webappDirectory>/test/war/WEB-INF/classes</webappDirectory>
                    </configuration>
                </plugin>
            </plugins>
        </build>
        <repositories>
            <repository>
                <id>wso2</id>
                <url>http://dist.wso2.org/maven2/</url>
            </repository>
            <repository>
                <id>maven-repository-1</id>
                <url>http://repo1.maven.org/maven2/</url>
            </repository>
        </repositories>
        <dependencies>
            <dependency>
                <groupId>com.google.gwt</groupId>
                <artifactId>gwt-servlet</artifactId>
                <version>2.5.1</version>
                <scope>runtime</scope>
            </dependency>
            <dependency>
                <groupId>com.google.gwt</groupId>
                <artifactId>gwt-user</artifactId>
                <version>2.5.1</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
                <version>1.1</version>
                <type>jar</type>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>log4j</groupId>
                <artifactId>log4j</artifactId>
                <version>1.2.12</version>
                <type>jar</type>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>org.webharvest.wso2</groupId>
                <artifactId>webharvest-core</artifactId>
                <version>1.0.0.wso2v1</version>
                <type>jar</type>
                <scope>compile</scope>
            </dependency>
            <!-- web harvest pom doesn't track dependencies well -->
            <dependency>
                <groupId>net.sf.saxon</groupId>
                <artifactId>saxon-xom</artifactId>
                <version>8.7</version>
            </dependency>
            <dependency>
                <groupId>org.htmlcleaner</groupId>
                <artifactId>htmlcleaner</artifactId>
                <version>1.55</version>
            </dependency>
            <dependency>
                <groupId>bsh</groupId>
                <artifactId>bsh</artifactId>
                <version>1.3.0</version>
            </dependency>
            <dependency>
                <groupId>commons-httpclient</groupId>
                <artifactId>commons-httpclient</artifactId>
                <version>3.1</version>
            </dependency>
            <dependency>
                <!-- jsoup HTML parser library @ http://jsoup.org/ -->
                <groupId>org.jsoup</groupId>
                <artifactId>jsoup</artifactId>
                <version>1.7.2</version>
            </dependency>
        </dependencies>
    </project>
    

    enter image description here