Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 280688

Summary: [eclipse-build] Ease usage of system-installed dependencies (JARs)
Product: [Tools] Linux Tools Reporter: Andrew Overholt <overholt>
Component: eclipse-buildAssignee: Packaging Tools Inbox <linux.packagingtools-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: bdrung, chewi
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 280684    
Bug Blocks:    
Attachments:
Description Flags
system-jars.patch
none
system-jars-v2.patch
none
system-jars-v3.patch
none
patch generated by Eclipse
none
debian.patch
overholt: iplog+
debian2.patch overholt: iplog+

Description Andrew Overholt CLA 2009-06-17 17:37:48 EDT
Many Linux distros have policies preventing the use of pre-built JARs so we should document how we expect distributions to use eclipse-build in conjunction with system-installed JARs.
Comment 1 Benjamin Drung CLA 2009-11-03 16:16:26 EST
I thought of an (data) text file and a small script. The text file should contain a list of the JAR file and a place where it should look for the system JAR files. The script should replace the JAR file by a link to the system JAR file if it finds a system JAR file.
Comment 2 Andrew Overholt CLA 2009-11-04 09:34:51 EST
That not a bad idea, Benjamin.  Someone on irc (blackxorred?) was thinking of something similar with and XML file and XSLT, I believe.
Comment 3 Benjamin Drung CLA 2009-11-04 15:16:43 EST
A simple CVS would be enough. A XML file would be an overkill for this task.
Comment 4 Benjamin Drung CLA 2009-11-20 04:30:29 EST
Created attachment 152685 [details]
system-jars.patch

Here is a patch for adding a symlink script. It supports multiple search locations and wildcards. Please test if it works for Fedora.
Comment 5 Benjamin Drung CLA 2009-11-23 15:15:04 EST
Created attachment 152893 [details]
system-jars-v2.patch

Here is an updated version of the patch.
Comment 6 Benjamin Drung CLA 2009-11-23 15:37:59 EST
Created attachment 152902 [details]
system-jars-v3.patch

Fixed a typo (CVS -> CSV); patch updated.
Comment 7 Andrew Overholt CLA 2009-11-25 14:33:12 EST
As I've asked before, it would be really great if you could supply patches that actually apply from within Eclipse.  I'll see if I can apply this some other way.
Comment 8 Andrew Overholt CLA 2009-11-25 14:45:48 EST
Created attachment 153108 [details]
patch generated by Eclipse
Comment 9 Andrew Overholt CLA 2009-11-25 14:59:25 EST
Thanks for the patch.  We would prefer most of the work was done in ant instead of shelling out to shell scripts, though.  (Yes, I know we have some existing shell code but we don't want to add more.)  Also, please use a .properties file for the potential JAR locations and use property syntax (key=value).
Comment 10 Benjamin Drung CLA 2010-02-25 17:31:09 EST
Created attachment 160255 [details]
debian.patch

Here's the patch for the symlinkDependencies svn branch to support Debian/Ubuntu.
Comment 11 Andrew Overholt CLA 2010-02-26 09:05:37 EST
Thanks, committed to symlinkDependencies branch as revision 24284.
Comment 12 Benjamin Drung CLA 2010-02-26 10:12:01 EST
Created attachment 160308 [details]
debian2.patch

The debian.patch misses the jetty part. Here is debian2.patch for adding the missing jetty part.
Comment 13 Andrew Overholt CLA 2010-02-26 11:44:46 EST
debian2.patch applied on symlinkDependencies branch.  Thanks.
Comment 14 Andrew Overholt CLA 2010-03-02 09:15:02 EST
Please try the symlinkDependencies branch.  It now symlinks both before the build and after the provision.sdk ant tasks.
Comment 15 Benjamin Drung CLA 2010-03-02 09:42:31 EST
The new symlink code does not work. It fails:

BUILD FAILED
/home/skipper/packages/eclipse/debian.git/build.xml:298: Could not find suitable system JAR for javax.servlet_2.5.0.v200806031605.jar.  Tried:  /usr/share/java/tomcat6-servlet-2.5-api.jar, /usr/share/java/servlet-api-2.5.jar

/usr/share/java/servlet-api-2.5.jar is an existing link.
Comment 16 Andrew Overholt CLA 2010-03-02 10:30:41 EST
Please update (revision 24321) and try again (break vs. continue :).
Comment 17 Benjamin Drung CLA 2010-03-02 12:24:15 EST
It fails now somewhere else:

@dot:
    [mkdir] Created dir: /home/skipper/packages/eclipse/debian.git/build/eclipse-3.5.2-src/plugins/org.eclipse.ecf.provider.filetransfer.httpclient/@dot
    [javac] Compiling 17 source files to /home/skipper/packages/eclipse/debian.git/build/eclipse-3.5.2-src/plugins/org.eclipse.ecf.provider.filetransfer.httpclient/@dot
    [javac] /home/skipper/packages/eclipse/debian.git/build/eclipse-3.5.2-src/plugins/org.eclipse.ecf.provider.filetransfer.httpclient/src/org/eclipse/ecf/internal/provider/filetransfer/httpclient/ECFHttpClientProtocolSocketFactory.java:16: package org.apache.commons.httpclient.params does not exist
    [javac] import org.apache.commons.httpclient.params.HttpConnectionParams;

This symlink exist and is valid:
build/eclipse-3.5.2-src/plugins/org.apache.commons.httpclient_3.1.0.jar
Comment 18 Andrew Overholt CLA 2010-03-02 13:48:35 EST
Did you do a distclean between runs?  Does org.apache.commons.httpclient.params exist in build/eclipse-3.5.2-src/plugins/org.apache.commons.httpclient_3.1.0.jar?

unzip -l build/eclipse-3.5.2-src/plugins/org.apache.commons.httpclient_3.1.0.jar | grep org.apache.commons.httpclient.params

Did the target of the httpclient symlink change between a run that worked and one that didn't?
Comment 19 Benjamin Drung CLA 2010-03-02 13:56:32 EST
Yes, I did a distclean before and org.apache.commons.httpclient.params exists in it. The target of the httpclient symlink did not change.

I assume that the symlink has the wrong name. According to dependencies.properties it should be named

org.apache.commons.httpclient_3.1.0.v20080605-1935.jar
Comment 20 Andrew Overholt CLA 2010-03-04 09:11:07 EST
I think we're good to go here.  Our source releases don't contain any dependency JARs and we maintain properties files with colon-delimited lists of potential system locations.  I think documentation is probably the only remaining piece and that's bug #304569.

I'm going to close this but if anyone has issues, either re-open or (preferably) open new bugs.
Comment 21 Benjamin Drung CLA 2010-03-04 14:31:20 EST
Yes, this bug is fixed in trunk.