如何安装Maven2插件?

9
我发现了一个适用于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
1个回答

5

您不需要手动安装插件,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 做它的工作。这实际上在使用页面中有所记录。请参考使用说明

@Pascal - 我原以为这些目标会出现在Eclipse的菜单选项中 - http://www.kindleit.net/maven_gae_plugin/plugin-info.html - ovr
@Pascal - 当我尝试在命令行上运行这些目标时,也没有任何反应。我已经尝试过使用"mvn gae:run"和"gae:run"来运行它们。 - ovr
1
@ovr 他们不会,但是你可以使用新的自定义配置(Run As > Maven Build...)从Eclipse中调用它们。 - Pascal Thivent
@ovr 请更新您的问题,展示您的pom.xml和相关的信息/错误/跟踪,如果我看不到任何东西,我无法帮助您 :) - Pascal Thivent
谢谢。我更新了问题。pom文件是从我正在尝试构建的这个项目中获取的。http://code.google.com/p/thoughtsite/source/browse/trunk/pom.xml - ovr
显示剩余5条评论

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接