English 中文(简体)
我如何打造一个短片的里CP,以便能够自动更新其特征?
原标题:How do I build an Eclipse RCP app so that its features can be updated automatically?

我正在开发一个将包含几个特征的清洁生产应用方案。

我的林研中心申请被组合起来,以便检查每当其启动时的最新情况。 我目前的问题是,在建筑时间,我的一个特点需要停止,以便在这一自动检查中更新,而不强迫用户人工安装。 我需要独立于该系统的其他特点更新这一特点。

因此,为了回头,我只想自动地找到一个冰箱,以便有一套装有低温和反应装置的特性,从而独立于其他特征之外更新;而且,这并不要求低温反应器的用户人工安装。

最佳回答

与此同时,Tycho明确支持这一使用案例。 从Tycho 0.20.0开始,你可以将Tycho安装一个与产品分开的RCP特征。 这样,这些特点就可以独立于产品之外加以更新(或甚至不列入任何内容)。

为独立安装特征,在产品文档中分别添加一个特性(installMode=“root”。 例:

<features>
   <feature id="org.eclipse.platform"/>
   <feature id="updatable.feature" installMode="root"/>
</features>

For more information, see this documentation page.

问题回答

After a long search, I have found the answer. It s kind of a kludge, but I m willing to do anything at this point. My solution is dependent upon the fact that my built RCP application includes p2 application org.eclipse.equinox.p2.director. I guess if your RCP app doesn t contain this application, you can refer to another Eclipse install in order to launch the Director. I just did it this way to avoid having an instance of Eclipse sitting on my build machine.

I used the p2-dev mailing list, and Paul Webster answered my question. (Thanks Paul)

He suggested using ant to launch the p2 director application to install the IU into my built RCP application.

Here s his answer on the p2-dev mailing list http://dev.eclipse.org/mhonarc/lists/p2-dev/msg04735.html

这里是我即将到来的目标。

<target name="install_IU">
  <path id="launcher.paths">
    <fileset
       dir="${app.dir}"
       includes="plugins/org.eclipse.equinox.launcher_*" />
  </path>
  <property
      name="launcherPath"
      refid="launcher.paths" />
  <echo>-installIU ${iu.id} </echo>
  <java 
      jar="${launcherPath}"
      failonerror="false"
      dir="${app.dir}"
      timeout="900000"
      fork="true"
      output="${basedir}/director.log"
      resultproperty="directorcode">
      <arg line="-application org.eclipse.equinox.p2.director" />
      <arg line="-noSplash" />
      <arg line="-installIUs ${iu.id}" />
      <arg line="-repository ${iu.repo}" />
      <arg line="-destination ${app.dir}" />
      <arg line="-bundlepool ${app.dir}" />
  </java>

  <zip destfile="${app.zip}"
    basedir="${app.dir}"/>
</target>

我将这一点放在同一个项目中,该项目通过Tycho生产我的Eclipse RCP申请。 Tycho在一份称为“目标”的名录中制作了我的建筑工艺品,因此,我对上层目标参数的看法就是如此。

<target name="modify_x86">
  <antcall target="install_IU">
    <param name="iu.id" value="com.mydomain.the.feature.i.want.to.install.feature.feature.group"/>
    <param name="iu.repo" value="http://mydomain.com/thep2repository/where/i/deploy/the/feature/to/install"/>
    <param name="app.dir" value="${basedir}/target/products/com.mydomain.myRCPapplication/win32/win32/x86"/>
    <param name="app.zip" value="${basedir}/target/products/com.mydomain.myRCPapplication-win32.win32.x86.zip"/>
  </antcall>
</target>

我在每一个平台上都有另外几个目标,即我的林研中心申请的建立。

Hope this helps.

UPDATE: May 8th, 2014. Tobias has brought it to my attention that I should change the accepted answer from this one to the one that has the new feature that was added to Tycho 0.20.0 that enables this behavior in a much more simple fashion. So, the new accepted answer is the proper solution for this question now.

在我找到这里记录和接受的答复之前,我尝试并且未能以以下方式解决这一问题:

我试图在产品定义中说明特征。 成功安装了这一特征,但是,它使我无法独立地更新该特征,而不受《荒漠化公约》申请的其他特征的影响。

我有一个P2触角指挥系统,目前正在工作。 它使用2.inf文档,为RCP申请中的现有更新网站增加了一个存放处。 ......

instructions.configure=
 org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(location:http${#58}//myUpdateSsite/myFeature,type:0,name:My Feature Name,enabled:true);
 org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(location:http${#58}//myUpdateSsite/myFeature,type:1,name:My Feature Name,enabled:true);\

我曾尝试添加一条这样的线,以便安装这一特征,但当我操作压碎的清洁装置时,我的缝 建筑失败。

instructions.configure=
 org.eclipse.equinox.p2.touchpoint.eclipse.installFeature(feature:My Feature Name,featureId:com.my.domain.my.feature.id,version:1.0.0);

Here s some of the error message from maven / tycho

An error occurred while configuring the installed items session context was:
(profile=DefaultProfile, phase=org.eclipse.equinox.internal.p2.engine.phases.Configure, operand=null --> 
[R]{my.domain.my.rcp.product.plugin 1.1.6.20120427-1346}, 
action=org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.InstallFeatureAction).
Installable unit contains no artifacts: [R]my.domain.my.rcp.product.plugin 1.1.6.20120427-1346.

My intuition tells me that this error message is saying that my RCP application plugin is missing something that will tell p2 where to find the feature that I want to install at build time. I think???





相关问题
In Eclipse, why doesn t "Show In" appear for non-Java files?

If I have a *java file open, I can right click on the source, scroll down to "Show In (Alt-Shift-W)", and select Navigator. If I have an *xml, *jsp, or pretty much anything besides a Java source ...

Eclipse: Hover broken in debug perspective

Since upgrading Eclipse (Galileo build 20090920-1017), hover in debug no longer displays a variable s value. Instead, hover behaves as if I were in normal Java perspective: alt text http://...

Eclipse smart quotes - like in Textmate

Happy Friday — Does anyone know if eclipse has the notion of smart quotes like Textmate. The way it works is to select some words and quote them by simply hitting the " key? I m a newbie here so be ...

Indentation guide for the eclipse editor

Is there a setting or plugin for eclipse that can show indentation guides in the editor? Something like the Codekana plugin for visual studio (not so fancy is also OK). Important that it works with ...

Adding jar from Eclipse plugin runtime tab

I want to add .jar files for plugin from the Runtime tab of manifest file. When I use the Add... button, I can see only sub-directories of the plugin project. So if I want to add same .jar file to ...

How to copy multiple projects into single folder in eclipse

I have two projects, Project1 and Project2. Now i want to copy this projects into eclipse workspace but i want these projects to be in a single folder like below. Eclipse Workspace -> Project -> ...

Java: Finding out what is using all the memory

I have a java application that runs out of memory, but I have no idea which code is allocating the memory. Is there an application with which I can check this? I use Eclipse.

热门标签