Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse SmartHome » Depencies in Eclipse Smart Home, howto import?(Setting up Binding imports to be able compile and distribute?)
Depencies in Eclipse Smart Home, howto import? [message #1783512] Tue, 13 March 2018 18:38 Go to next message
Josua Arndt is currently offline Josua ArndtFriend
Messages: 2
Registered: March 2018
Junior Member
Hello,

i just setup eclipse smart home and generated a binding with the archetype generator.

I started programming and the first steps went without problems.

But now i need to include depencies and can´t get it to work.
I never used maven before and i maybe just miss the basics.

So first i miss the auto import of dependencies from maven repo and could not get it to run.

So to get imports resolved i tried to
1. Add jars to eclipse project libraries. Helps in Eclipse view but not in the build.
2. Add the depencies to maven config, editing the pom file.

Running debug still shows missing constrains.
Doing `mvn clean install` this just spawns erros like `build.properties: bin.includes value(s) [NOTICE] do not match any files.`

Is there a way to set up a binding projekt as mvn projekt and get the inlcude resolved to the online mvn repo.

Or what steps are neccessary to be able to add imports and get the project compiled properly in eclipse and so on?

Please be aware that i just started using maven today and so a detailed explanation is welcome.

Thanks in advance.

[Updated on: Fri, 16 March 2018 09:11] by Moderator

Report message to a moderator

Re: Depencies in Eclipse Smart Home, howto import? [message #1783717 is a reply to message #1783512] Fri, 16 March 2018 09:14 Go to previous messageGo to next message
Henning Treu is currently offline Henning TreuFriend
Messages: 44
Registered: April 2017
Member
Hi Josua,

we had to recover your post, as by accident the wrong duplicate entry got deleted. Do you by any chance have my original answer in your email inbox? If so, please sent it to henning.treu@googlemail.com. I will edit this post here and replace the content.

Thanks in advance.
Henning
Re: Depencies in Eclipse Smart Home, howto import? [message #1783722 is a reply to message #1783717] Fri, 16 March 2018 09:50 Go to previous messageGo to next message
Josua Arndt is currently offline Josua ArndtFriend
Messages: 2
Registered: March 2018
Junior Member
Hi Henning,

Reproduced from memory
Your Answer:

As eclipse smart home is just a bundle of OSGI you have to define the imports in `META-INF/MANIFEST.MF` choose the tab `Depencies` and add the import to the right list of for `Import Packages`.

Do not define `Required Plug-Ins` as this will be done by the upper layer.

Eclipse brings a neat editor to edit the manifest file.

My Answer:

Ok thanks, but this does not solve my problem. All Packages listet there will be automatically included and so do not need to be imported manually.

Is there a way to add the maven repo to the index for automatic inclusion?
If not how do i add a package which is not listet? like `org.apache.commons.validator.Validator`!

End

Sorry no, the forum default config was set to not email notification. At least for me, can not remember to have set it.

Select Notification by Default:
If notification is enabled by default, it can be disabled when posting. Yes X No

Also strange config:

Allow E-mail Messages:
Allow other users to send you e-mails via this forum. X Yes No
Allow Private Messages:
Allow other users to send you private messages in this forum. Yes X No

I think it would have made more sense the other way. just my opinion.

Second, when debugging i always get en error massage: `Missing Constraints: Import-Package .....`.
My own answer to this: `Debug` small arrow, `Debug Configurations` go to `tab Plug-Ins` select teh text field, type apart of the name e.g.`exec` and set the checkmark.

Still the questions, can i add aditionall packages and how?

Thanks
Josua

Re: Depencies in Eclipse Smart Home, howto import? [message #1783752 is a reply to message #1783722] Fri, 16 March 2018 15:31 Go to previous message
Henning Treu is currently offline Henning TreuFriend
Messages: 44
Registered: April 2017
Member
Hi Josua,

Quote:

All Packages listet there will be automatically included and so do not need to be imported manually.

Eclipse SmartHome does define a targetplatform which includes all libraries/dependencies the core framework needs during build/runtime.
In the MANIFEST.MF editor (or directly in the file) under "Imported Packages" you see which packages should be made available by the OSGi runtime to the specific bundle. You can add all packages which are provided by the targetplatform.

Quote:

Is there a way to add the maven repo to the index for automatic inclusion?
If not how do i add a package which is not listet? like `org.apache.commons.validator.Validator`!

In case you need additional dependencies you are supposed to add the *.jar files to a "lib" folder inside your bundle. This way the bundle brings its own dependencies. make sure to include the lib folder in the build.properties "bin.includes" property.
In case you develop your own solution on top of ESH you might also define your own targetplatform and add your dependencies there.
Previous Topic:ESH Console extensions
Next Topic:Thoughts on a new Sitemap Concept
Goto Forum:
  


Current Time: Thu Dec 12 05:57:28 GMT 2024

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

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

Back to the top