文档章节

opendaylight-eclipse-setup

一夜七次郎啊
 一夜七次郎啊
发布于 2016/11/28 13:33
字数 2019
阅读 135
收藏 1

opendaylight-eclipse-setup

If you like/use this project, a Star / Watch / Follow me on GitHub is appreciated.

Watch https://www.youtube.com/watch?v=BLW8aOh6WeQ screencast video to see what this is all about.

Watch https://www.youtube.com/watch?v=TU1zjytlwFE recording of presentation from OpenDaylight Mini Summit June 2016 (Berlin). Slides from this session are also available here http://www.slideshare.net/mikervorburger/opendaylight-developers-experience-15-eclipse-setup-hot-reload-future-plans (faster) and (in better quality) here https://docs.google.com/presentation/d/14yLzog3OhIlVsk7Clr0Tff1YayRcFnQCUZqxHMWxiNI/. — Related more recent slides from the OpenDaylight Summit October 2016 (Seattle) are available here http://www.slideshare.net/mikervorburger/opendaylight-developer-experience-20 (faster) and (in better quality) here https://docs.google.com/presentation/d/1bnwj8CrFGo5KekONYSeIHySdkoXZiewJxkHcZjXnzkQ/.

OpenDaylight has Oomph, and you can set up an Eclipse-based development workspace for OpenDaylight projects by:

  1. Downloading the Eclipse Installer from https://www.eclipse.org/downloads/ and clicking "Get Eclipse [Neon] Download 64 bit", unzipping eclipse-inst-* and starting it. (Alternatively the same, perhaps in a slightly more up-to-date version, is available from https://wiki.eclipse.org/Eclipse_Installer as well.)

  2. On the initial page, click on the Switch to advanced mode button in the top right.

  3. On the Product page, select Eclipse IDE for Java Developers.

  4. On the Projects page, collapse the Eclipse Projects & GitHub Projects to scroll down to the OpenDaylight.org Projects (or use the "Select Catalogs" icon in the upper right hand corner for permanent filtering)

  5. Double-click the projects (i.e. ODL repos) of interest to you.

  6. Choose your installation settings on the Variables page, incl. your OpenDaylight.org username to access gerrit and a root install directory location for the workspace (projects Git repo can be elsewhere, see below)

  7. Finish the wizard and watch how your development environment is being assembled, courtesy of Oomph.

This fully automates the manual steps currently described on https://wiki.opendaylight.org/view/GettingStarted:_Eclipse, in order for anyone to get easily started successfully hacking on https://www.opendaylight.org quickly, without having any red problem markers.

This is implemented used an Eclipse "Oomph" workspace set up model, see http://www.eclipse.org/oomph

By default, it will git clone the repos of all projects you checked into a sub-directory named "git/" next to the eclipse/ folder (${installation.location}). If you already have OpenDaylight projects git clone’d with existing local work, then on the "Variables" step of the Eclipse Installer, simply change the git.clone.opendaylight.ROOT.location variable to /absolute/path/where/you/keep/your/opendaylight/clones/. Use [X] Show all variables if that variable is not displayed.

Similarly, if for some reason you prefer a non-standard directory layout setup with custom directories instead of Oomph’s default git/, ws/ and eclipse/ directories, this can be changed during setup on the "Variables" step by clicking [X] Show all variables.

In order to be able to propose changes to OpenDaylight via Gerrit, you’ll of couse still need to your SSH public key to the ODL Gerrit account. Note that this setup currently does the git clone via ssh:// not via https:// Git protocol. (If this is a problem for you perhaps because from behing a corporate firewall you can also do git with HTTP but not SSH, then please raise bring it up on the odl-parent mailing list, as it would be possible to improve this.)

To import more projects after completing the wizard, click on the "Perform Setup Tasks" yellow/blue circle arrows kind of icon in the Toolbar, next to the little blue man icon, and choose "Import Projects…​". If those two icons are not visible in your toolbar, enable them using menu Window > Preferences > Oomph > Setup Tasks: [X] Show Toolbar contributions.

This work was started on https://github.com/vorburger/opendaylight-eclipse-setup just because it’s easier for me to maintain it here for now. As other ODL developers use this, perhaps we’ll move it to https://git.opendaylight.org. TODO which repo, new or inside an existing one?

Michael Vorburger @ work @ Red Hat April 2016

What exactly this actually does

Provision an Eclipse installation which includes:

In particular the M2Eclipse (M2) Maven Eclipse integration PITA is correctly configured with:

  • settings.xml for nexus.opendaylight.org

  • an appropriate lifecycle-mapping-metadata.xml for M2E

  • all required M2E connector plugins (buildhelper, m2e-code-quality, mavendev, tycho, m2e-apt incl. config)

  • M2E Auto Update preference

  • Checkstyle gets configured, in line with Maven (it actually automatically reads the ODL Checkstyle configuration from the respective JAR in the local m2 repo; see Project > Properties > Checkstyle > Local Check Configurations tab)

Then for each of the available ~80+ ODL repos you wish to import via the Wizard UI it does:

  • git clone

  • EGit Gerrit configuration

  • Import Maven Projects

  • Working Set

Specific setup actions required by particular projects:

  • yangide: m2e.sdk, EMF Compare, Graphiti in Target Platform

  • eclipse-setup: Oomph redirect to be able to work on the live *.setup in workspace

FAQ

  1. Where can I get support if I have any further question not covered in this README?

    For now, please post to the general OpenDaylight development list (dev@lists.opendaylight.org) with email subject topic prefix "[eclipse]".

  2. Why do I not see the "Projects" lists, only the "Product" selection?

    Switch the Advanced Mode, and Click Next; watch https://youtu.be/BLW8aOh6WeQ?t=1m42s

  3. Why do I not see OpenDaylight.org in the Projects lists, only the Eclipse & GitHub Projects?

    Use the "Select Catalogs" icon in the upper right hand corner, OpenDaylight may be filtered.

  4. What to do when getting installation ERRORS such as "org.eclipse.equinox.p2.transport.ecf code=1002 Unable to read repository at http://…​" with "org.apache.http.conn.ConnectTimeoutException: Connect to …​ timed out", or the Installer gets "stuck" in the "P2 Director, Adding repository", etc.

    These are "just" network connection issues which can happen when it’s downloading the additional Eclipse plugins that are required. Normally just retrying (by Cancel Operation, Back, Finish again), or waiting and retrying later, fixes all of these. If you have managed to previously have it already successfully install the required Eclipse plugins at least once, then you can often still proceed in the face of such errors simply by clicking the Offline icon on the toolbar, or by un-checking the P2 Director task in the "tasks to be executed and optionally uncheck unwanted tasks" pop-up confirmation dialog. Also if it ever asks you something like "Can’t reach …​ use locally cached version?", say Yes.

  5. Why doesn’t the SonarCube (SonarLint) plugin show the same problems in Eclipse as on the https://sonar.opendaylight.org web UI?

    It does - IFF you right-click project(s) to "Bind to a SonarCube project" AND then touch a Java file or rebuild the project!

  6. Wouldn’t it be better to disable automatic rebuilding?

    No, because then when switching branches the Java index used for validation and autocompletion would be out-of-date.

  7. Automatic workspace building is slow.

    There is probably room for improvement, likely more so in Builders of 3rd party plugins than core Eclipse, e.g. yangide, checkstyle etc. Contributions which performance profile these and help with improvements those projects improve their performance are certainly highly welcome.

  8. Why do I have to do "mvn install" to make red ink go away after I switch branches?

    You should not have to. E.g. the yangide plugin is included here so that it would auto. regen. the Java code in line with changes to YANG e.g. from branch switching. If this does not work in your project, please let me know so that we can look at what needs to be changes. Most likely, it’s a left over wrong M2E lifecycle mapping which suppresses the intended and automatic re-generation which is working on other projects.

Known open issues causing red in opendaylight Eclipse workspace

Until the Gerrits listed below get merged, you can locally work around these problems by pulling the listed Gerrit changes into your workspace. You do not need to mvn install, because M2E "workspace resolution" will make the changes immediately effective.

Cross projects, affecting all

  • The very first time Eclipse opens, you’ll have to File > Restart it once. This is because the automated Preference which Oomph applies so that it uses nexus.opendaylight.org instead of Maven central has only just been configured, and M2E didn’t automatically pick it up.

  • The "javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target" error while fetching url https://nexus.opendaylight.org/content/sites/p2repos/org.opendaylight.yangide/snapshot/content.xml: You have been hit by https://bugs.opendaylight.org/show_bug.cgi?id=5806. It appears that OpenJDK does not have this problem; it’s specific to Oracle JDK. You can also try to import the respective CA cert into your store as described e.g. https://bugs.eclipse.org/bugs/show_bug.cgi?id=492014#c1 and in other places online, if you are up for it. The only other thing I can do is encourage you to whine about that issue on e.g. the integration-dev@lists.opendaylight.org and/or dev@lists.opendaylight.org mailing lists, and comment and vote for it on that bugzilla issue.

  • YANG code generation does not seem to always automatically correctly incrementally rebuild Java sources from YANG (e.g. when switching branches). For now, just manually right-click > Run As > Maven Generate Sources does the trick in cases where you have red errors due to YANG code.

  • Checkstyle

Implementation Details for Contributors

How to get the sources of the setup model?

There is a entry named "eclipse-setup" in the projects list; that will provision the source code of this into your workspace so that you can contribute to it.

See "To import more projects after completing the wizard (…​)" above re. how to import additional projects into your workspace.

How to add new entries to the Project List?

To add a new project, just:

  1. choose "eclipse-setup" in the Setup Wizard project list (it’s a project like any other ODL project)

  2. edit generator/projects.txt

  3. run ProjectsSetupGenerator.xtend

  4. edit org.opendaylight.projects.setup to add the new <project href=".."> printed out by ProjectsSetupGenerator.xtend

  5. test importing your new project, as described in "To import more projects.." above. Note that due to an automated redirect that was set up when you provisioned the "eclipse-setup" project, the *.setup models in your workspace are "live", and Oomph will use those models instead of the remote one - perfect for local testing.

Please note that the projects/*.setup are auto-generated by the generator/src/../ProjectsSetupGenerator.xtend, based on the generator/projects.txt list.

Those projects/*.setup models should thus never be hand-edited (contrary to the root org.opendaylight.projects.setup); instead fix the template in the ProjectsSetupGenerator if anything could be improved, and re-run the generator.

How to add additional M2E lifecycle mapping?

If needed, add the Repository and the Requirement (Eclipse feature) of the additional new M2E Extension / Connector to the P2 Director in the org.opendaylight.projects.setup.

Then optionally, if applicable, engage a Quick Fix for the red "Plugin execution not covered by lifecycle configuration: (…​)" Problem and have it "Mark goal (..) as ignored in eclipse preferences" (NOT in pom.xml)

Now use menu Window > Preferences > Maven > Lifecycle Mappings > Open workspace lifecycle mappings metadata to copy the contents of your entire current latest lifecycle-mapping-metadata.xml file to the clipboard, and paste that into the Content in the Properties of the Resource Creation task for ${workspace.location|uri}/.metadata/.plugins/org.eclipse.m2e.core/lifecycle-mapping-metadata.xml in the org.opendaylight.projects.setup.

Then commit, and raise Pull Request to share the change.

© 著作权归作者所有

一夜七次郎啊
粉丝 18
博文 136
码字总数 88446
作品 0
南京
程序员
私信 提问
思科谈OpenDaylight

虽然依旧能在市场上看到思科的可扩展网络控制器(XNC),但是你可能已经注意到思科在最近的一段时间内,一直在谈论其开放SDN控制器(替代XNC)。 显然,思科拥有了基于OpenDaylight氢版本的其他...

SDN_LAB
2015/08/04
171
0
开发OpenDaylight组件的完整流程

在前面介绍学习了OpenDaylight的几个重要模块后,这里再来介绍下完整开发一个模块的过程。 OSGI的bundles提供被其他OSGI组件调用的服务。这个教程中展示的是Data Packet Service去解析数据包...

wangxuwei
2018/06/24
117
0
浅谈OpenDaylight的二次开发

OpenDaylight作为一款开源SDN网络控制器,依托于强大的社区支持以及功能特性,成为了目前主流的SDN网络控制器开发平台。在比较稳定的OpenDaylight Helium版本中,已经为开发者提供了大量的网...

wangxuwei
2018/06/24
148
0
科技巨头共推SDN开源项目 联手改变互联网未来

4月9日消息,《连线》杂志网站近日刊文指出,思科、微软、IBM等大公司推动成立的开源“软件定义网络”(SDN)项目OpenDayLight宣称将为传统网络带来变革;不过,也许这些大公司的参与只是一种...

oschina
2013/04/09
4.2K
22
OpenDaylight峰会SDN进步案例演变

传统网络现今已经不能满足越来越大的用户需求,传统网络需要进行基础性的重构和改变,而这些改变正通过软件定义网络(SDN)的驱动发生着。 OpenDaylight(ODL)是一个在现代多样化厂商网络中...

SDN_LAB
2015/08/03
48
0

没有更多内容

加载失败,请刷新页面

加载更多

OSChina 周四乱弹 —— 干啥啥不行,吃饭第一名。

Osc乱弹歌单(2019)请戳(这里) 【今日歌曲】 @巴拉迪维 : 李白到杜甫家吃饭。杜甫洗菜,发现只有青瓜和萝卜,心中愧疚。这时,他看见了邻居家的鸡,杜甫一时心酸,忍不住喃喃自语:我希望...

小小编辑
8分钟前
27
3
Java描述设计模式(08):桥接模式

本文源码:GitHub·点这里 || GitEE·点这里 一、桥接模式简介 1、基础描述 桥梁模式是对象的结构模式。又称为柄体(Handle and Body)模式或接口(Interface)模式。桥梁模式的用意是“将抽象化...

知了一笑
8分钟前
2
0
C++ 函数指针的用法

天王盖地虎626
22分钟前
1
0
白话比原链跨链技术

随着Bystack的主侧链架构的推出,主侧链之间的跨链问题也成为比原链团队的主要攻克工程难题,当前比原链已经推出了两种跨链的机制,各有不同的侧重点,可能因为本身的跨链技术比较晦涩,本篇...

比原链Bytom
30分钟前
2
0
PostgreSQL参数search_path影响及作用

search_path稍微熟悉PG就会用到,用法这里就不必讲,本篇主要讲它在程序里怎样处理。 1、GUC参数定义 这是个 config_string 参数 {{"search_path", PGC_USERSET, CLIENT_CONN_STATEMENT,...

有理想的猪
今天
9
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部