Maven-glass鱼 - 爪素中的Maven-3.0.4



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

[...]
[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:Usersrobapache-maven-3.0.4bin.. Java version: 1.6.0_37, vendor: Sun Microsystems Inc. Java home: C:ProgrammeJavajdk1.6.0_37jre Default locale: de_DE, platform encoding: Cp1252 OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

futhermore我的Nexus-Repository在http://maven-repository上运行。

编辑:来自pom.xml的插件零件看起来像这样:

<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:developmentglassfish-v2.1.1-b31g</glassfishDirectory>
    </configuration>
</plugin>

您不是那里唯一面临问题的人:)

似乎甚至还有官方错误报告:

在此处建议的解决方法:http://jira.codehaus.org/browse/mng-4843您应该使用适当的版本覆盖项目中的插件依赖项。

以下应该解决您的问题:

<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:developmentglassfish-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.net/examples/complete.html

我找到了另一种解决此问题的方法:

  1. 复制文件" c: users &lt;当前用户> 。m2 repository org arpache apache maven maven-parent maven-parent 11 maven-parent-parent-parent-11.pom"到" c: users &lt;当前用户> 。m2 repository org apache maven maven maven-parent 11-snapshot '

  2. 并将其重命名为" Maven-Parent-11-snapshot.pom"

相关内容

  • 没有找到相关文章

最新更新