Google App Engine - 找不到Maven插件

问题描述 投票:1回答:1

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

从存储库[local(C:\\ Users \\ user.m2 \\ repository),central(http://repo.maven.apache)解析插件'org.apache.maven.plugins:gwt-maven-plugin'的版本时出错。 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>   

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

UPDATE

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

项目的输出目录应设置为/ test / war / WEB-INF / classes

更新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>

我的例外情况是一样的:

项目的输出目录应设置为/ test / war / WEB-INF / classes

我的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>

eclipse google-app-engine gwt maven
1个回答
4
投票

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

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

参考

  1. 您可以在中央maven repo找到gwt-maven-plugin。
  2. 参考如何使用gwt-maven-plugin
  3. 浏览Google团队pom示例以获取GWT + GAE应用

注 - 我在示例项目中测试了您的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>

在此输入图像描述

© www.soinside.com 2019 - 2024. All rights reserved.