8

http://www.eclipse.org/equinox/documents/quickstart-framework.phpをフォローしましたが、古くて有効ではないようです。

説明されているようなバンドルはありませんorg.eclipse.update.configurator_3.2.100.jar

org.eclipse.equinox.simpleconfigurator_1.0.200.v20100503で試しましたが、機能しません。

誰でもEquinoxにプラグインフォルダ内のバンドルを自動ロードさせる方法を教えてもらえますか?

4

3 に答える 3

14

最も簡単なアプローチは、Apache FelixFileInstallを使用することです。Equinoxで問題なく動作します。必要なのは、ファイルインストール構成パラメーターをconfiguration/config.iniに入れることだけです。ただし、ランチャーJARまたはバイナリを介してEquinoxを起動する場合、作業ディレクトリはconfiguration/またはplugins/ディレクトリの親になることに注意してください。

プロジェクトconfig.iniからの抜粋:

# 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

他の可能な解決策は、EclipseP2を使用することです。使い方はかなり難しいと思いますが、はるかに高度で強力です。

良いことは、アプリケーションがバンドルのプロビジョニング方法にとらわれない場合(そして、この方法である必要があります)、後でいつでも気が変わる可能性があることです。

于 2011-03-02T18:40:08.940 に答える
0

これは、antで書かれた自動Eclipseインストーラーのフラグメントです。

これにより、カスタム更新サイトからすべての機能がインストールされます。コードは「現状のまま」ですが、私がそれを書いたときに私を導くためにこのようなものがあればよかったと思います。

このスクリプトは、antのantcontrib拡張機能も使用します。Antcontribタスクには「ac:」名前空間プレフィックスがあります

お役に立てれば。

    <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その有用性と複雑さのために、EclipseP2は確かに最も文書化されていない機能の1つです。

于 2011-03-02T18:42:50.923 に答える
0

Eclipseのインストールフォルダーには、次のようなファイルがありますbundles.info

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

ファイルを変更して、必要なバンドルと開始レベルを追加できます。ただし、Eclipseインストールにバンドルを追加する最も簡単な方法は、バンドルを「dropins」フォルダーに追加することです。これにより、bundle.infoファイルが自動的に変更されます。

于 2011-03-03T13:53:30.657 に答える