无法使用Maven Archetype

时间:2018-04-30 15:45:55

标签: maven sdn opendaylight

我希望使用Maven Archetype为opendaylight创建项目并导入到eclipse中但是在为create project键入此代码时

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

这将导致错误

 Generating project in Interactive mode
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 3.004 s
    [INFO] Finished at: 2018-04-30T19:47:52+04:30
    [INFO] Final Memory: 14M/138M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-   
     plugin:3.0.1:generate (default-cli) on project standalone-pom: archetypeCatalog 'https://   
     nexus.OpenDaylight.org/content/repositories/public/archetype-catalog.xml' is not  
    supported anymore. Please read the plugin documentation for details. -> [Help 1]
    [ERROR] 
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
     [ERROR] 
     [ERROR] For more information about the errors and possible solutions, please read the    
     following articles: 
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/  
     MojoFailureException

如何解决这个问题?还是创建新项目?

2 个答案:

答案 0 :(得分:0)

编辑:选中创建简单项目

时会显示此选项

我总是喜欢通过Eclipse开始构建ODL应用程序。

选择" Create Maven Project"然后单击下一步将要求您填写各种详细信息。填写详细信息如下:

<强>工件:

  • 组ID:org.opendaylight.yourprojectname
  • 工件ID:yourprojectname
  • 版本:1.0.0-SNAPSHOT
  • 包装:pom

<强>父

  • 组ID: org.opendaylight.odlparent
  • 工件ID:捆绑 - 父
  • 版本: 1.8.1-Carbon 或任何其他稳定版本
  

等待eclipse下载所有相关组件。

PS:我假设您已更新settings.xml文件。如果不使用此settings.xml相应地更新现有的settings.xml

现在你很高兴。

答案 1 :(得分:0)

如何使用Maven原型的官方文档在这里:http://docs.opendaylight.org/en/latest/developer-guide/developing-apps-on-the-opendaylight-controller.html

在之前的版本中,它或多或少地被破坏了,并且最近已经修复了主分支以用于未来的Fluorine版本;更多详细信息:https://jira.opendaylight.org/browse/DOCS-60