问题
Trying to follow the opendaylight developer tutorial to get an initial hello world application running on the controller, however running the command
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
Results in an error
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]
I've managed to get it to succeed using the command
[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)
Any ideas how to resolve this (or other ways of getting a first app)?
回答1:
I have found a solution in the OpenDaylight forum.
Please remove
-DarchtypeCatlog=http://nexus.opendaylight.org/content/repositories/opendaylight.release/archetype-catalog.xmland execute following command.
mvn archetype:generate -DarchetypeGroupId=org.opendaylight.controller -DarchetypeArtifactId=opendaylight-startup-archetype -DarchetypeRepository=http://nexus.opendaylight.org/content/repositories/opendaylight.release -DarchetypeVersion=1.4.0
回答2:
From this link, you can use the following command :
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>
while replacing Snapshot-Type and Archetype-Version as follows:
Using this search on ODL's Nexus repository:
- For the
Oxygen dev snapshotuseSnapshot-Type=opendaylight.snapshotandArchetype-Version=1.5.0-SNAPSHOT - For the
Nitrogen SR1 snapshotuseSnapshot-Type=opendaylight.snapshotandArchetype-Version=1.4.1-SNAPSHOT - For the
Nitrogen releaseuseSnapshot-Type=opendaylight.releaseandArchetype-Version=1.4.0 - For the
CarbonuseSnapshot-Type=opendaylight.releaseandArchetype-Version=1.3.0-Carbon - For
Boron SR0useSnapshot-Type=opendaylight.releaseandArchetype-Version=1.2.0-Boron - For
Boron SR1useSnapshot-Type=opendaylight.releaseandArchetype-Version=1.2.1-Boron-SR1 - For
Boron SR2useSnapshot-Type=opendaylight.releaseandArchetype-Version=1.2.2-Boron-SR2 - For the
Boron snapshotuseSnapshot-Type=opendaylight.snapshotandArchetype-Version=1.2.2-SNAPSHOT
You can also see this answer.
来源:https://stackoverflow.com/questions/47054929/using-opendaylight-starter-archetype-does-not-work