Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse SmartHome » How do I build so I can test the UI
How do I build so I can test the UI [message #1718669] Tue, 29 December 2015 02:57 Go to next message
Grady Duncan is currently offline Grady DuncanFriend
Messages: 10
Registered: December 2015
Junior Member
Hey everyone,

I'm new to maven so I think I have done something wrong. I forked the github repo, cloned the forked repo and then ran 'mvn install clean'. About 20 minutes later it finished building. When I extracted the 'SNAPSHOT-repo' zip file I was unable to run anything. When I clicked on any of the JAR files I get an "invalid or corrupt JARfile".

How can I build the repo so I can actually test UI changes?
Re: How do I build so I can test the UI [message #1718681 is a reply to message #1718669] Tue, 29 December 2015 08:06 Go to previous messageGo to next message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 673
Registered: December 2011
Senior Member
You cannot execute any binaries, since Eclipse SmartHome is a framework that is rather a bunch of bundles only. For developing, you should setup the IDE (see https://www.eclipse.org/smarthome/documentation/development/ide.html), which comes with a launch configuration to start up the runtime. Alternatively, you could also use the IDE for openHAB 2 (as it is usually easier to setup) and only import the projects from ESH into your workspace that you want to work on. But if you want to work on stuff like minifying, you will indeed have to test the jar as the build result. For this, it is best if you use the openHAB 2 runtime and put your jars in the "addons" folder.
Re: How do I build so I can test the UI [message #1718766 is a reply to message #1718681] Wed, 30 December 2015 00:15 Go to previous messageGo to next message
Sebastian Janzen is currently offline Sebastian JanzenFriend
Messages: 5
Registered: November 2015
Junior Member
For UI development, I set up my IDE with Eclipse Installer like in the Tutorial Kai mentioned.

Becuase Eclipse is not very good at WebDev, I then open the Web-Root of the UI I want to dev for in IntelliJ. Eclipse with openHAB just runs in the background and serves the UIs.

For e.g. classic ui I set configuration to prevent caching at java side. See distribution/openhabhome/conf/services/classicui.cfg where I set
org.eclipse.smarthome.classicui:disableHtmlCache=true

For the other UIs I have to look at tomorrow. PaperUI had a flag "-DwebDebug=true" in the past, I think that won't work anymore.

There may be also a flag in the run config, where you have to ensure, that your local files are served and not those from the targetplatform. Maybe I can just make a short video of that, it's hard to describe - at least at 1am.

Best
Sebastian

[Updated on: Wed, 30 December 2015 00:15]

Report message to a moderator

Re: How do I build so I can test the UI [message #1718771 is a reply to message #1718766] Wed, 30 December 2015 04:09 Go to previous messageGo to next message
Grady Duncan is currently offline Grady DuncanFriend
Messages: 10
Registered: December 2015
Junior Member
Hey guys,

Thanks again for the help on this. I think I am finally getting somewhere. In eclipse I have everything setup and can see the openHAB2 and ESH source files. Sadly, during the build of openHAB2 I run into some errors,

UI Dev Setup - Followed https://github.com/openhab/openhab2/blob/master/docs/sources/development/ide.md
1. Download Eclipse Installer
2. Run Eclipse Installer
3. Pick IDE for Java Devs
4. Pick openHAB 2 with Eclipse SmartHome Core

After Eclipse opens
1. Click workbench in top right
2. Wait for everything to load in (watch in bottom right)

Build 1
In Eclipse I did, Run > Run Configurations... > Eclipse Application > openHAB_with_ESH > Run
Get tons of "Unresolved requirement: Import-Package: org.eclipse.smarthome.*.**" errors. The 'Problems' tab only shows that I have 176 Warnings, no errors.

Build 2
1. cd to repo folder/git/openhab2
2. mvn clean install

Build Fails, [ERROR] Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.0.3:verify (verify) on project openhab2-addons-verify: Unable to load features descriptors: Error -> [Help 1]

Build 3
1. cd to repo folder/git/smarthome
2. mvn clean install

Build 3 succeeded. I went back and tried build 2 again but it failed with the same error message.

I think at this point I just need to get openHAB2 building and I will be good to go, right?

Thanks,
Grady
Re: How do I build so I can test the UI [message #1718792 is a reply to message #1718771] Wed, 30 December 2015 11:25 Go to previous messageGo to next message
Sebastian Janzen is currently offline Sebastian JanzenFriend
Messages: 5
Registered: November 2015
Junior Member
The launch problem was discussed here, too: https://github.com/openhab/openhab2/issues/548#issuecomment-167412690
Maybe you can read there some confi hints.

Usually, your "Build 1" approach should work.

The error at your "Build 2" let me think that you're at the karaf branch, not at master. I think the karaf one is a bit unstable atm.
Re: How do I build so I can test the UI [message #1718829 is a reply to message #1718792] Wed, 30 December 2015 20:44 Go to previous messageGo to next message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 673
Registered: December 2011
Senior Member
Build 2 should be fixed now as well (through https://github.com/openhab/openhab2/pull/589), doing it yesterday was a bad timing since I was heavily restructuring the repo...
Re: How do I build so I can test the UI [message #1718842 is a reply to message #1718829] Thu, 31 December 2015 02:13 Go to previous messageGo to next message
Grady Duncan is currently offline Grady DuncanFriend
Messages: 10
Registered: December 2015
Junior Member
Evening gents,

I updated both openHAB2 and ESH branches this evening. I am on the master branch of both repos. When I use maven to build openHAB2 I am still getting the same error.

Looking at the link Sebastian posted I went into eclipse and did, Run > Run Configurations... > Eclipse Application > openHAB_Runtime > Run and I got a successful build and was able to access localhost:8080 and see the openhab2 demo start screen and all 4 of the UIs!!

Sadly I still have a few questions. If the paperUI is not included in openHAB2 does this mean that I was able to build with ESH or does building with the runTime use the 'old' runtime but include all of the new stuff from ESH? I ask so I know what repo to be making changes in. When I make a change should I rebuild using the openHAB_Runtime option or is there a better/different way?

Thanks guys!

[Updated on: Thu, 31 December 2015 05:28]

Report message to a moderator

Re: How do I build so I can test the UI [message #1719084 is a reply to message #1718842] Tue, 05 January 2016 03:37 Go to previous messageGo to next message
Grady Duncan is currently offline Grady DuncanFriend
Messages: 10
Registered: December 2015
Junior Member
Hey guys,

I've made a few changes but I'm not sure how to preview the changes. When I click 'run' in eclipse it builds without issues but my changes are not seen. How can I demo the changes?
Re: How do I build so I can test the UI [message #1719181 is a reply to message #1719084] Tue, 05 January 2016 22:28 Go to previous messageGo to next message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 673
Registered: December 2011
Senior Member
> but my changes are not seen

I am a bit lost about how your setup now looks exactly and I don't have time this week to go into details... But are your changes available within the workspace as well? If the project is activated in the launch config, you should also see the changes...
Re: How do I build so I can test the UI [message #1719310 is a reply to message #1719181] Thu, 07 January 2016 01:06 Go to previous messageGo to next message
Grady Duncan is currently offline Grady DuncanFriend
Messages: 10
Registered: December 2015
Junior Member
Hey,

So I have eclipse installed and its using the openHab2 with ESH core. When I run openHab2 from within eclipse using Run > Run Configurations... > Eclipse Application > openHAB_Runtime > Run it runs without any issues. When I do Run > Run Configurations... > Eclipse Application > openHAB_with_ESH > Run it gives me errors. When I use Maven to build I go into project/git/smarthome mvn clean project and it builds without issues.

So I can run openhab2 but the UI changes made in the smarthome are not moved over. What I was thinking of doing is using maven to build and copy the jar into the openhab2 repo. I haven't tried this and it would be ideal to not have to but I'm not entirely sure how to fix the issues when building with ESH.
Re: How do I build so I can test the UI [message #1719445 is a reply to message #1719310] Fri, 08 January 2016 02:23 Go to previous messageGo to next message
Grady Duncan is currently offline Grady DuncanFriend
Messages: 10
Registered: December 2015
Junior Member
Hey guys,

I spent some time this evening working on fixing the run openHAB_with_ESH. After a couple hours of playing with missing import-packages I have it successfully building with ESH, or what I think is using ESH. The only import package I am currently missing is org.quartz but it does not stop eclipse from running jetty and spinning up the server.

I also have my changes made to the paperUI showing up!

Thanks for all the help guys!!
Re: How do I build so I can test the UI [message #1719908 is a reply to message #1719445] Wed, 13 January 2016 04:21 Go to previous message
Grady Duncan is currently offline Grady DuncanFriend
Messages: 10
Registered: December 2015
Junior Member
Evening,

I'm still having some issues. Is it possible for you to give me a list of all the plugins that you included? For some reason I am unable to get REST API going. It starts according to eclipse console but going to localhost:8080/rest returns a 404 error.

Thoughts?
Previous Topic:Dynamically created Channels during initialize()
Next Topic:Automation : how to access ModuleHandler(s)?
Goto Forum:
  


Current Time: Fri Mar 29 15:46:29 GMT 2024

Powered by FUDForum. Page generated in 0.03075 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top