Eclipse 'opendaylight-startup-archetype' for Hello project


1.创建Hello Project 在教程 OpenDaylight Controller:MD-SAL:Startup Project Archetype 里面

If you are using the GettingStarted: Eclipse fully automated set up, then you can now use menu File > New > Project > Maven > Maven Project, Next; Advanced: Name template: [groupId].[artifactId], and then check [X] Include snapshot archetypes, and choose Artifact Id opendaylight-startup-archetype. (Note that opendaylight-eclipse-setup already has a catalog with the required archetypeRepository from ODL.)

需要使用opendaylight-eclipse-setup 来创建新的project。


问题但是由于我使用oomph自动配置eclipse出错,用了手动配置。导致maven project列表里面没有需要的opendaylight-eclipse-setup Archetype 


解决办法: 1.使用自动配置重新安装eclipse
                 2.从Maven Project窗口中添加新的Archetype 
                   (但是不知道opendaylight-eclipse-setup地址)
                3.在命令行中用mvn命令创建新的project

方法1:依然出错。与自动配置文件中的地址错误和缺少依赖的文件有关。比较复杂,解决不了。

方法2,3:

  从方法3中得到opendaylight-eclipse-setup的地址,然后加入到方法2的新建archetype中。在git pull得到的l2switch(或者其他类似的文件夹比如controller等)文件夹中打开命令行,输入

 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 \
-DarchetypeVersion=1.3.0-SNAPSHOT

得到:
https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/org/opendaylight/controller/opendaylight-startup-archetype/1.3.0-SNAPSHOT/opendaylight-startup-archetype-1.3.0-20170217.131130-260.jar

或者使用https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot


<groupId>org.opendaylight.controller</groupId>
<artifactId>opendaylight-startup-archetype</artifactId>

<version>1.3.0-SNAPSHOT</version>

在Eclipse>File > New > Project > Maven > Maven Project> Add Archetype 中,分别输入groupId,artifactId,version和url即可导入opendaylight-eclipse-setup。




2.Run As->Maven Install

这个对内存需求比较大。我把虚拟机内存增大到4G,而且把eclipse.ini设置为-Xms512m,-Xmx2048m。
其中报过一个错,maven-surefire-plugin missing in eclipse,增大内存后没报错了。http://stackoverflow.com/questions/23588957/maven-surefire-plugin-missing-in-eclipse
















评论

此博客中的热门博文

openflow switch(I)

YANG Tools:YANG to Java Mapping

OpenDaylight架构简介