1

実行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:\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>
    <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>
4

2 に答える 2

3

そこで問題に直面しているのはあなただけではありません:)

そのための公式のバグレポートもあるようです:http://java.net/jira/browse/GLASSFISH-14411

ここで提案されている回避策として: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:\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

于 2012-11-12T06:32:02.593 に答える
2

私はこれを解決する別の方法を見つけます:

  1. ファイル「C:\ Users\<現在のユーザー>\。m2\repository \ org \ apache \ maven \ maven-parent \ 11 \maven-parent-11.pom」を「C:\ Users\<現在のユーザー>\」にコピーします.m2 \ repository \ org \ apache \ maven \ maven-parent \ 11-SNAPSHOT \ "

  2. 名前を「maven-parent-11-SNAPSHOT.pom」に変更します

于 2013-05-30T10:40:43.133 に答える