使用OpenDaylight启动器原型不起作用

时间:2017-11-01 12:31:50

标签: maven sdn opendaylight

尝试按照opendaylight developer tutorial获取在控制器上运行的初始hello world应用程序,但运行命令

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

导致错误

No plugin found for prefix ' -DarchetypeRepository=https' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/home/andrew/.m2/repository), opendaylight-snapshot (https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/), opendaylight-mirror (https://nexus.opendaylight.org/content/repositories/public/), central (https://repo.maven.apache.org/maven2)] -> [Help 1]

我设法使用命令

让它成功
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.17:check (default) on project test-impl: You have 1 Checkstyle violation. -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.17:check (default) on project test-impl: You have 1 Checkstyle violation. at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)

任何想法如何解决此问题(或其他获取第一个应用程序的方式)?

2 个答案:

答案 0 :(得分:2)

this link,您可以使用以下命令:

mvn archetype:generate -DarchetypeGroupId=org.opendaylight.controller -DarchetypeArtifactId=opendaylight-startup-archetype \
-DarchetypeRepository=http://nexus.opendaylight.org/content/repositories/<Snapshot-Type>/ \
-DarchetypeCatalog=remote -DarchetypeVersion=<Archetype-Version>

替换Snapshot-TypeArchetype-Version,如下所示:

使用this search on ODL's Nexus repository

  • Oxygen dev snapshot使用Snapshot-Type=opendaylight.snapshotArchetype-Version=1.5.0-SNAPSHOT
  • Nitrogen SR1 snapshot使用Snapshot-Type=opendaylight.snapshotArchetype-Version=1.4.1-SNAPSHOT
  • Nitrogen release使用Snapshot-Type=opendaylight.releaseArchetype-Version=1.4.0
  • Carbon使用Snapshot-Type=opendaylight.releaseArchetype-Version=1.3.0-Carbon
  • Boron SR0使用Snapshot-Type=opendaylight.releaseArchetype-Version=1.2.0-Boron
  • Boron SR1使用Snapshot-Type=opendaylight.releaseArchetype-Version=1.2.1-Boron-SR1
  • Boron SR2使用Snapshot-Type=opendaylight.releaseArchetype-Version=1.2.2-Boron-SR2
  • Boron snapshot使用Snapshot-Type=opendaylight.snapshotArchetype-Version=1.2.2-SNAPSHOT

您还可以看到this answer

答案 1 :(得分:0)

我在OpenDaylight forum找到了解决方案。

  

请删除   -DarchtypeCatlog=http://nexus.opendaylight.org/content/repositories/opendaylight.release/archetype-catalog.xml

     

并执行以下命令。

     

mvn archetype:generate -DarchetypeGroupId=org.opendaylight.controller -DarchetypeArtifactId=opendaylight-startup-archetype -DarchetypeRepository=http://nexus.opendaylight.org/content/repositories/opendaylight.release -DarchetypeVersion=1.4.0