web-dev-qa-db-ja.com

Opendaylightプロジェクト構造を作成するためのMavenアーキタイプ生成コマンドの実行エラー

これを実行すると:

 mvn archetype:generate -DarchetypeGroupId=org.opendaylight.controller -DarchetypeArtifactId=opendaylight-startup-archetype \
-DarchetypeRepository=http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/ \
-DarchetypeCatalog=http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/archetype-catalog.xml

次のエラーが発生しました:

[ERROR] Failed to execute goal org.Apache.maven.plugins:maven-archetype-plugin:3.0.1:generate (default-cli) on project standalone-pom: archetypeCatalog 'http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/archetype-catalog.xml' is not supported anymore. Please read the plugin documentation for details. -> [Help 1]

そして、help1は次のようになります。

[ERROR] [Help 1] http://cwiki.Apache.org/confluence/display/MAVEN/MojoFailureException

長い間更新されていません。

まず、バックスラッシュと空白を削除しましたが、明らかに機能しませんでした。これはarchetypeCatalogのパラメータかもしれないと思ったので、これを実行しました:

mvn archetype:generate -DarchetypeGroupId=org.opendaylight.controller -DarchetypeArtifactId=opendaylight-startup-archetype -DarchetypeCatalog=remote -DarchetypeVersion=1.1.2-Beryllium-SR2

私はこのようなエラーを受け取りました:

[ERROR] Failed to execute goal org.Apache.maven.plugins:maven-archetype-plugin:3.0.1:generate (default-cli) on project standalone-pom: The desired archetype does not exist (org.opendaylight.controller:opendaylight-startup-archetype:1.1.2-Beryllium-SR2) -> [Help 1]

チュートリアルでは、OpenDaylightはMaven Centralの外部で独自のリポジトリーを維持することを述べています。つまり、MavenはデフォルトでOpenDaylightアーティファクトを解決できません。だから私は次のコマンドでチュートリアルとしてやった:

cp -n ~/.m2/settings.xml{,.orig} ; \ wget -q -O - https://raw.githubusercontent.com/opendaylight/odlparent/master/settings.xml > ~/.m2/settings.xml

私もこれを試しました:

cp -n ~/.m2/settings.xml{,.orig} ; \ wget -q -O - https://raw.githubusercontent.com/opendaylight/odlparent/stable/beryllium/settings.xml > ~/.m2/settings.xml

Settings.xmlファイルは同じように見えます。最近私はいくつかの同様の問題を見てきました。 mavenとopendaylightの両方の初心者として、私は次のステップをどうするかわからないのですか?トースターを開始するために、opendaylightのarachetypeを生成したいだけです。

ご協力ありがとうございました。これが私のmaven inforamtionです:

 ➜  ~ mvn -v
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-04T03:39:06+08:00)
Maven home: /usr/local/Cellar/maven/3.5.0/libexec
Java version: 1.8.0_131, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.11.6", Arch: "x86_64", family: "mac"
6
Oscar Zhang

Maven-archetype-plugin 3.xでは、リポジトリをコマンドライン引数として指定することはできなくなりました(一貫性とセキュリティ上の理由から)。

したがって、2つのオプションがあります。

  • 従う 新しい指示
  • プラグインのバージョンを2.4にロックする
6
Robert Scholte

Maven Archetype Plugin 3.0.0以降、アーキタイプの解像度が変更されました。コマンドラインからリポジトリを指定することはできなくなりましたが、代わりにMavenですでに指定されているリポジトリが使用されます。これは、ミラーとプロキシ、およびリポジトリでの認証も尊重されることを意味します。 1. -DarchetypeCatalog&-DarchetypeRepositoryを削除します2. .m2/setting.xmlに、

  <settings>
    <mirrors>
      <mirror>
        <id>mrm-maven-plugin</id>
        <name>Mock Repository Manager</name>
        <url>http://www.mycompany.com/maven-reporistory-manager</url>
        <mirrorOf>*,!archetype</mirrorOf>
      </mirror>
    </mirrors>

    <profiles>
      <profile>
      <id>acme</id>
      <repositories>
        <repository>
          <id>archetype</id>
          <url>https://www.acme.com/repo</url>
          <releases>
            <enabled>true</enabled>
            <checksumPolicy>fail</checksumPolicy>
          </releases>
          <snapshots>
            <enabled>true</enabled>
            <checksumPolicy>warn</checksumPolicy>
          </snapshots>
        </repository>
      </repositories>
    </profile>
  </profiles>

  <activeProfiles>
    <activeProfile>acme</activeProfile>
  </activeProfiles>
</settings>
  1. 見てください http://maven.Apache.org/archetype/maven-archetype-plugin/archetype-repository.html
2
begginghard

次のように、IDがアーキタイプであるリポジトリを追加します。

  <repository>
    <id>archetype</id>
    <url>https://repository.domain.com/path/to/repo/</url>
  </repository>

私の場合、

  <repository>
     <id>archetype</id>
     <url>http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/</url>
  </repository>

基本的に、DarchetypeRepositoryパラメーターなしで実行しましたが、上記のようにsettings.xmlに入れました。そして、-Darchetypecatalogパラメータをリモートに変更するか、単に空に設定します。できます 。

0
Oscar Zhang

最近のMavenバージョンは、アーキタイプのコマンドライン定義をサポートしていません。つまり、デフォルトの設定ファイルは次のようになります(vi〜/ .m2/setting.xml)。

<?xml version="1.0" encoding="UTF-8"?>
<!-- vi: set et smarttab sw=2 tabstop=2: -->
<!--
 Copyright (c) 2014, 2015 Cisco Systems, Inc. and others.  All rights reserved.

 This program and the accompanying materials are made available under the
 terms of the Eclipse Public License v1.0 which accompanies this distribution,
 and is available at http://www.Eclipse.org/legal/epl-v10.html
-->
<settings xmlns="http://maven.Apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.Apache.org/SETTINGS/1.0.0 http://maven.Apache.org/xsd/settings-1.0.0.xsd">
  <profiles>
    <profile>
      <id>opendaylight-release</id>
      <repositories>
        <repository>
          <id>opendaylight-mirror</id>
          <name>opendaylight-mirror</name>
          <url>https://nexus.opendaylight.org/content/repositories/public/</url>
          <releases>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
          </releases>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>opendaylight-mirror</id>
          <name>opendaylight-mirror</name>
          <url>https://nexus.opendaylight.org/content/repositories/public/</url>
          <releases>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
          </releases>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>

    <profile>
      <id>opendaylight-snapshots</id>
      <repositories>
        <repository>
          <id>opendaylight-snapshot</id>
          <name>opendaylight-snapshot</name>
          <url>https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/</url>
          <releases>
            <enabled>false</enabled>
          </releases>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </repository>
<repository>
     <id>archetype</id>
     <url>http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/</url>
  </repository>

    </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>opendaylight-snapshot</id>
          <name>opendaylight-snapshot</name>
          <url>https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/</url>
          <releases>
            <enabled>false</enabled>
          </releases>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </pluginRepository>
      </pluginRepositories>
  </profile>
  </profiles>

  <activeProfiles>
    <activeProfile>opendaylight-release</activeProfile>
    <activeProfile>opendaylight-snapshots</activeProfile>
  </activeProfiles>
</settings>
0
Learner

Ninjaプロジェクトの作成中にこのエラーメッセージが表示されたためにここにいる場合は、Mavenの最新バージョン(2.5.2よりも大きいもの)をダウンロードしてください。

このエラーは、Apache Mavenバージョン2.5.3未満で発生しました