首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >maven-3.0.4中的maven-glassfish-plugin

maven-3.0.4中的maven-glassfish-plugin
EN

Stack Overflow用户
提问于 2012-10-30 19:51:00
回答 2查看 8.2K关注 0票数 1

在运行mvn install glassfish:deploy时,我遇到了以下问题

代码语言:javascript
复制
[...]
[ERROR] Failed to execute goal org.glassfish.maven.plugin:maven-glassfish-plugin:2.1:deploy (default-cli) on project post-build-pom: Execution default-cli of goal org.glassfish.maven.plugin:maven-glassfish-plugin:2.1:deploy failed: Plugin o    rg.glassfish.maven.plugin:maven-glassfish-plugin:2.1 or one of its dependencies could not be resolved: Failed to collect dependencies for org.glassfish.maven.plugin:maven-glassfish-plugin:jar:2.1 (): Failed to read artifact descriptor for org.apache.maven:maven-plugin-api:jar:3.0-SONATYPE-688946: Failure to find org.apache.maven:maven-parent:pom:9-SNAPSHOT in http://maven-repository/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of internal-repository has elapsed or updates are forced -> [Help 1]
[...]

我的mvn -v看起来像这样:

Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100) Maven home: C:\Users\rob\apache-maven-3.0.4\bin\.. Java version: 1.6.0_37, vendor: Sun Microsystems Inc. Java home: C:\Programme\Java\jdk1.6.0_37\jre Default locale: de_DE, platform encoding: Cp1252 OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

此外,我的结点存储库在http://maven-repository上运行。

编辑:来自pom.xml的plugin-part如下所示:

代码语言:javascript
复制
<plugin>
    <groupId>org.glassfish.maven.plugin</groupId>
    <artifactId>maven-glassfish-plugin</artifactId>
    <version>2.1</version>
    <configuration>
        <user>admin</user>
        <adminPassword>adminadmin</adminPassword>
        <glassfishDirectory>c:\development\glassfish-v2.1.1-b31g</glassfishDirectory>
    </configuration>
</plugin>
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2012-11-12 14:32:03

你不是唯一一个面临问题的人:)

似乎甚至有官方的bug报告:http://java.net/jira/browse/GLASSFISH-14411

这里建议的一个变通方法是:http://jira.codehaus.org/browse/MNG-4843,你应该用合适的版本覆盖项目中的插件依赖。

下面的代码可以解决你的问题:

代码语言:javascript
复制
<build>
    <plugins>
        <plugin>
            <groupId>org.glassfish.maven.plugin</groupId>
            <artifactId>maven-glassfish-plugin</artifactId>
            <version>2.1</version>
            <configuration>
                <user>admin</user>
                <adminPassword>adminadmin</adminPassword>
                <glassfishDirectory>c:\development\glassfish-v2.1.1-b31g</glassfishDirectory>
            </configuration>
        </plugin>
    </plugins>
</build>
<dependencies>
    <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-project</artifactId>
        <version>3.0-alpha-2</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-plugin-api</artifactId>
        <version>3.0.4</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-artifact</artifactId>
        <version>3.0.4</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

当然,您需要提供所需的所有配置,但这是另一个主题:http://maven-glassfish-plugin.java.net/examples/complete.html

票数 3
EN

Stack Overflow用户

发布于 2013-05-30 18:40:43

我找到了另一种方法来解决这个问题:

  1. 将文件"C:\Users\< current user >.m2\repository\org\apache\maven\maven-parent\11\maven-parent-11.pom“to”复制到current user >.m2\repository\org\apache\maven\maven-parent\11-SNAPSHOT\"
  2. and将其重命名为"maven-parent-11-SNAPSHOT.pom"
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13138383

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档