Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse SmartHome » Proper way to refer to external libraries (libraries available from other repos)
Proper way to refer to external libraries [message #1760661] Sun, 30 April 2017 19:41 Go to next message
Charles Brouwers is currently offline Charles BrouwersFriend
Messages: 7
Registered: April 2017
Junior Member
What is the "clean" way to refer to a public library used in a binding? I noticed that many bindings just include the library manually in a lib folder but I assume it would be better to use a reference to a repository. Unfortunately, I am not an Eclipse/Maven/Tycho expert and everything I tried broke the project configuration and generated a cascade of other issues. I realize this is not an ESH question per se but ESH is tightly tied to Java/Eclipse/Maven/

I thought the whole point of the POM file was to manage such
dependencies so I added the repository ( and a reference to the artifact I am using (org.snmp4J) ... but that had no impact. So I also converted the project to a maven project and then the additional repo appeared among the maven repos. But the imports in the code were still all red-lined, the "search repository" command did not find the reference. Also Eclipse started to ask about a missing Tycho plugin. I
Re: Proper way to refer to external libraries [message #1760709 is a reply to message #1760661] Tue, 02 May 2017 09:43 Go to previous message
Simon Kaufmann is currently offline Simon KaufmannFriend
Messages: 51
Registered: January 2011
Of course you are right in saying that the "cleanest" approach would be to reference a repository. However, there are two things to notice in that context:

1. Our build is not based on "plain" maven as you might be used to, but we are using Tycho, which essentially are some maven plugins which make maven behave as close as possible as the model promoted by the Eclipse IDE, i.e. it respects the MANIFEST.MF files and sets up the classpaths accordingly. Therefore, dependencies in the pom.xml files cannot be referenced as easily as it would be with plain maven. Instead, such an additional dependency would need to be entered in the file first and then the according packages must be imported in the MANIFEST.MF. Please have in mind also that for this you would need the repository to be a P2 repository and the library must have a valid OSGi manifest.

2. The processes at Eclipse are pretty restrictive wrt third party dependencies. They aim at protecting us from all sorts of intellectual property related issues. Therefore all used dependencies must first be analyzed and approved explicitly. In the end, they must be served from a repository hosted at Eclipse, AFAIK.

For the above reasons the most pragmatic approach really is to include the JAR file in the sources as you have seen in many other bindings. The point with the IP approval of course remains valid, but that's nothing you need to worry about. This will be done as part of the pull request review.
Previous Topic:Newbie question about new biding
Next Topic:New biding has errors
Goto Forum:

Current Time: Mon May 20 22:15:42 GMT 2024

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

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

Back to the top