Eclipse Equinox how to configure automatic download of packages in the plugin folder

I followed http://www.eclipse.org/equinox/documents/quickstart-framework.php , but it seems old and invalid.

There are no such packages as described by org.eclipse.update.configurator_3.2.100.jar

I tried with org.eclipse.equinox.simpleconfigurator_1.0.200.v20100503 but it does not work.

Can anyone tell me how to get Equinox to automatically download packages inside the plugins folder?

+7
source share
3 answers

The simplest approach would be to use Apache Felix File Install . It works fine with Equinox, you only need to set the File Install configuration options to the /config.ini configuration. Note that if you run Equinox through a JAR start or through a binary file, the working directory will be the parent of the config // plugins / directory.

Excerpt from our config.ini project:

# Start File Install itself osgi.bundles=reference\:file\: org.apache.felix.fileinstall_3.1.0.jar@1 \:start # The name of the directory to watch felix.fileinstall.dir=./plugins # A regular expression to be used to filter file names # We have all bundles in plugins/ directory, this regexp # forbids monitoring bundles that are started via osgi.bundles property felix.fileinstall.filter=^(?!org.apache.felix.fileinstall|org.eclipse.osgi).* # Determines if File Install waits felix.fileinstall.poll milliseconds before doing an initial scan or not. felix.fileinstall.noInitialDelay=true # Not sure why we have this... felix.fileinstall.start.level=2 

Another possible solution would be to use Eclipse P2 . It is much more advanced and powerful, although it is quite difficult for me to use it.

Itโ€™s good that if your application is agnostically connected with the creation of packages (and this should be so), you can always change your mind later.

+12
source

Here is a snippet from my automated eclipse installer written in ant.

This installs all the features from the custom update site. The code is "as is", but of course I would like something like this to guide me when I wrote it.

This script also uses the antcontrib extension for ant. Antcontrib tasks have ac space prefix: '

Hope this helps.

  <property name="real.eclipse.home" location="${eclipse.home}/eclipse"/> <property file="${real.eclipse.home}/configuration/config.ini" prefix="ECLIPSE_CONFIG"/> <property name="eclipse-plugins.dir" location="${real.eclipse.home}/plugins"/> <path id="newest.equinox.launcher-library.path.id"> <dirset dir="${eclipse-plugins.dir}"> <include name="org.eclipse.equinox.launcher.*"/> </dirset> </path> <property name="equinox.launcher-library.full-path" refid="newest.equinox.launcher-library.path.id"/> <basename property="equinox.launcher-library.dir" file="${equinox.launcher-library.full-path}"/> <echo message="equinox.launcher-library.dir='${equinox.launcher-library.dir}'"/> <path id="newest.equinox.launcher.path.id"> <fileset dir="${eclipse-plugins.dir}"> <include name="org.eclipse.equinox.launcher_*.jar"/> </fileset> </path> <property name="equinox.launcher.jar" refid="newest.equinox.launcher.path.id"/> <basename property="equinox.launcher.jar.basename" file="${equinox.launcher.jar}"/> <echo message="equinox.launcher.jar='${equinox.launcher.jar}'"/> <java jar="${equinox.launcher.jar}" fork="true" failonerror="true" > <arg value="-consolelog"/> <arg value="-application"/> <arg value="org.eclipse.equinox.p2.director"/> <arg value="-repository"/> <arg value="http://${repository.server}/custom-update-site"/> <arg value="-list"/> <redirector logError="true" outputproperty="features.list" > <outputfilterchain> <linecontains> <contains value="feature.group="/> </linecontains> <replaceregex pattern="(.*feature\.group)=.*$" replace="\1"/> </outputfilterchain> </redirector> </java> <ac:for list="${features.list}" delimiter="${line.separator}" trim="true" param="feature"> <sequential> <ac:if> <isset property="feature.comma.list"/> <then> <ac:var name="feature.comma.list" value="${feature.comma.list},@{feature}"/> </then> <else> <property name="feature.comma.list" value="@{feature}"/> </else> </ac:if> </sequential> </ac:for> <echo message="Found following features to install"/> <echo message="${features.list}"/> <java jar="${equinox.launcher.jar}" fork="true" failonerror="true" > <arg value="-consolelog"/> <arg value="-application"/> <arg value="org.eclipse.equinox.p2.director"/> <arg value="-repository"/> <arg value="http://${repository.server}/custom-update-site"/> <arg value="-destination"/> <arg file="${real.eclipse.home}"/> <arg value="-installIU"/> <arg value="${feature.comma.list}"/> <arg value="-profile"/> <arg value="${ECLIPSE_CONFIG.eclipse.p2.profile}"/> </java> 

PS For its utility and complexity, Eclipse P2 is certainly one of the most underrated features.

0
source

In your eclipse installation folder, you have a bundles.info file, for example:

 eclipse-3.6.1/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info 

You can modify the file to add any desired kit, as well as an entry level. But the easiest way to add packages to your eclipse installation is to add them to the dropins folder. This will automatically modify the bundle.info file.

0
source

All Articles