【问题标题】:How do you install a Maven2 plugin?如何安装 Maven2 插件?
【发布时间】:2010-06-08 21:29:19
【问题描述】:

我发现这个用于 Google App Engine 开发的插件似乎是我需要的。

但我不知道如何安装它。

我从这个页面下载了 JAR 文件,但我不知道放在哪里:

http://code.google.com/p/maven-gae-plugin/

谁能指出我正确的方向?我已经尝试搜索安装说明,但没有任何内容。这似乎是某种内幕消息。抱歉 - 我是 Maven 新手,所以如果这很明显,我深表歉意。

这是我正在使用的 pom:

http://code.google.com/p/thoughtsite/source/browse/trunk/pom.xml

【问题讨论】:

    标签: java google-app-engine maven-2 plugins installation


    【解决方案1】:

    您无需安装它,Maven 会为您安装。但是如果插件在公共存储库中不可用,您需要告诉 Maven 从哪里下载插件。所以,声明插件仓库:

    <project>
        [...]
        <repositories>
            [...]
            <repository>
                <id>maven-gae-plugin-repo</id>
                <name>maven-gae-plugin repository</name>
                <url>http://maven-gae-plugin.googlecode.com/svn/repository</url>
            </repository>
        </repositories>
    
        <pluginRepositories>
            [...]
            <pluginRepository>
                <id>maven-gae-plugin-repo</id>
                <name>maven-gae-plugin repository</name>
                <url>http://maven-gae-plugin.googlecode.com/svn/repository</url>
            </pluginRepository>
        </pluginRepositories>
        [...]
    </project>
    

    并使用插件:

    <project>
        [...]
        <build>
            <plugins>
                [...]
                <plugin>
                    <groupId>net.kindleit</groupId>
                    <artifactId>maven-gae-plugin</artifactId>
                    <version>[plugin version]</version>
                </plugin>
            </plugins>
        </build>
        [...]
    </project>
    

    让 Maven 完成它的工作。这实际上记录在 Usage 页面中。

    【讨论】:

    • 我确实这样做了,但认为它不起作用,因为 Eclipse 没有为插件显示任何新的菜单选项。
    • @ovr 我认为你对 Eclipse 的期望太高了,Eclipse 不会仅仅因为你在 pom.xml 中声明了一个插件就建议新的 Maven 目标。
    • @Pascal - 我认为这些目标会在 Eclipse 中显示为菜单选项 - kindleit.net/maven_gae_plugin/plugin-info.html
    • @Pascal - 当我尝试在命令行上运行这些目标时,也没有任何反应。我尝试将它们作为“mvn gae:run”运行,就像“gae:run”一样
    • @ovr 他们不会,但您可以使用新的自定义配置从 Eclipse 调用它们(运行方式 > Maven 构建...)。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-10-17
    • 1970-01-01
    • 2021-05-17
    • 2014-03-16
    • 2014-06-04
    • 2021-06-14
    • 2013-07-29
    相关资源
    最近更新 更多