[Solved] Eclipse IDE fails when using instructions

I’m trying to setup the Eclipse development environment using the instructions from the developer documentation (See here). This was done on 6/7/19. I installed Eclipse version 2019-03. I am running on Windows 10.

At the end of step 5 I have the following messages:

Missing artifact org.openhab.core.bom:org.openhab.core.bom.openhab-core:pom:2.5.0-20190519.164012-73
Missing artifact org.openhab.core.bom:org.openhab.core.bom.openhab-core:pom:2.5.0-SNAPSHOT
Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace that are strictly compatible with this environment. 
The compiler compliance specified is 1.5 but a JRE 1.8 is used

It seems like something isn’t right at this point but I proceeded.

At Step 8 I deviated from the instruction because I am developing a new binding. So I went to the new binding instructions. I created the new binding and copied it into the openhab2-addons directory. I then ran mvn -DskipChecks -DskipTests clean install. At the end I noticed that my binding was not included in the reactor summary. Further up I found the following message:

[INFO] ----< org.openhab.addons.bom:org.openhab.addons.bom.openhab-addons >----
[INFO] Building openHAB Add-ons :: BOM :: openHAB Add-ons 2.5.0-SNAPSHOT [200/203]
[INFO] --------------------------------[ pom ]---------------------------------
[WARNING] The POM for org.openhab.addons.bundles:org.openhab.binding.smartthings:jar:2.5.0-SNAPSHOT is missing, no dependency information available

Of course there is no jar file because it hasn’t be built yet.

Not sure how to proceed here. This is at least the third time I’ve tried to setup the Eclipse IDE using the various instructions that have been provided. For me to be a successful binding developer I need a clear set of instructions that work. If I sound frustrated you would be exactly right. There as been no working development environment for months. I’m all for the maintainers making the development environment better. But, the developer need and IDE that they can install and work

hang tight, the IDE is a WIP, others wll be along to help quick

True. I think there’s a bit of resignation amongst maintainers as well and personally I’m not happy with not having a productive development flow for this project.

But it’s probably a week of full time dedication to get this in shape at least. There’s no other project that we can copy from. New automation scripts need to be written for all platforms, ideally an eclipse plugin and Vscode extension for further simplification.

I was actually hoping that we were now back with a working auto IDE setup.
@David_Graeff What issues are left to be addressed that require a “a week of full time dedication” from your pov? Do we have anything specific listed on Github?

@BobRak Build path specifies execution environment J2SE-1.5 sounds pretty weird, but imho it is only a warning. The missing bom is something that must indeed be looked at. I’d suggest entering an issue at https://github.com/openhab/openhab-distro/issues.

Wrt the binding development and how the skeleton is created and a new artifact is to be included in the build: This should also work as described and if this isn’t the case, please enter an issue as well (not sure myself about the best place, but either distro or docs should do).

  • The java version shouldn’t matter. We are compatible to Java jigsaw, but the IDE setup fails on Java9+ (there is a topic here in the developer section).
  • Archetypes should be available via the Eclipse UI. I assume oomph allows to configure urls for Archtetype lookups. We do need an archetype for Binding-, Automation Module, IO-Service development. Starting development must be as easy as possible.
  • Preparing the IDE for initial use should not take longer than 5 minutes on high speed internet connections. Eclipse itself is a highly complex OSGi application and it downloads and starts itself within 5 minutes. So why does it take half an hour for a simple binding development? Running the entire maven build of OH2-addons is not scaling and also does not make sense. Why do I need the Onkyo dependencies if I want to develop a weather binding.
  • Karaf for OH runtime and a bnd application for development complicates the setup to the degree that only professionals can deal with the system as soon as dependencies, version conflicts, non-osgi dependencies are involved.

I don’t see the developer flow to be either easy enough or to be documented to the degree that it would work for beginners with programming background (the target audience).

I agree that the buildsystem is ready to allow a distro build however (2.5 release).


It might make sense to change the workflow to use Karaf / a real OH instance for development (there are multiple topics here in the developer section). That includes

  • automatic start of the Karaf,
  • deploying workspace bundles to the local maven cache,
  • instruct karaf to watch the maven cache,
  • establish a remote debugging connection.

The developer workflow is quite simple in this scenario, even for bundles with dependencies. It might require an Eclipse plugin or some scripts however. That’s why I proposed to use Gradle instead of Maven, the Gradle-Eclipse plugin allows for hooks to be executed on all kind of events.

1 Like

:partying_face:

I think what most people are asking for is to be back with a working way to setup the IDE and do development. And most (absolutely valid) complaints that I am seeing over the last weeks is that our documentation simply does not lead to a working setup.

I have just tried it myself and chose the Zigbee binding. The whole setup was flawless, finished in less then 3 minutes and presented me a workspace without errors and a ready to launch app.
I therefore repeat what I said above: I think we are close, need to fix some small issues and improve the documentation. Most developers will be served well by that and become productive again. That’s why I asked @BobRak to file bugs for the specific issues he came across.

Kai are you taking about setting up Eclipse IDE starting from scratch (empty .p2 and .m2 repo on your machine)?
Because if you start from existing local repos makes a lot difference (packages are already there) and you may not face the problems with dependencies many people are experiencing.
And definitely it’s not a 5min setup (mine took 45min on a i7 with 512Gb SSD, Win10)

I’ve been able to resolve the issues from above. The missing artifact errors disappeared once I purged my Maven repository and let Maven rebuild it. I had a similar problem running the Maven build about a year ago and they were resolved by deleting the Maven repo. This must happen when new new objects are put in the repo but the version numbers are not updated. Is there a process the maintainers use to make sure that version numbers are updated when necessary? If not maybe there should be.

The Java version 1.5 issues remained but are easy enough resolved manually. Not sure why I have this issue but @Kai didn’t. Maybe the Eclipse installer is reusing something. I have no idea.

I resolved getting the new binding included in the BOM by running “mvn clean install” on the binding first. That way I had a binding jar file available before running “mvn -DskipChecks -DskipTests clean install” at the openhab-addons directory.

1 Like

I tried getting the new bnd eclipse working about a month ago, without success.
Figured I would try it again now, but still I am having issues following the latest instructions

In eclipse, there are many errors in the Infrastructure -> org.openhab.demo.app -> pom.xml

Failed to read artifact descriptor for org.openhab.addons.bom:org.openhab.addons.bom.openhab-addons:pom:2.5.0-SNAPSHOT

that is followed by a lot of “Missing artifact…” errors.

So I figured I would try from the command line. Closed eclipse, opened windows command prompt and ran mvn clean test. Had to properties to force java 1.8, then it finished OK.

Reopened Eclipse, but the errors are still there.

Have you tried deleting your local Maven repo and then letting Maven rebuild it next time it is run? That did the trick for me.

I haven’t, just because the build works fine with maven running outside of eclipse. But I will rename my existing cache and try it. Certainly worth a shot