Local update site with remote features

孤者浪人 提交于 2019-12-11 02:58:23

问题


I would like to create a lightweight eclipse update site that would only reference to feature or plugins in remote update sites, in order to have a single entry point for my team to install and update all the common plugins that we use for some projects.

But I don't find a way to reference these external features/plugins. I've create some archive mapping to the external update sites, but it keeps downloading all the artifacts when building the update site.

Is there a way to prevent that so that we just have the descriptor locally?


回答1:


You can do that but you have to add the plugins and features via archives to your site.xml. Furthermore, it is important to not change the names and to include all plugins that are needed by a feature in the archive path. Here is a snippet of a real example:

<feature url="http://borisvl.github.com/Pdf4Eclipse/features/de.vonloesch.pdf4eclipse_1.0.1.jar" id="de.vonloesch.pdf4eclipse" version="1.0.1">
  <category name="Pdf4Eclipse"/>
</feature>

<archive path="features/de.vonloesch.pdf4eclipse_1.0.1.jar" url="http://borisvl.github.com/Pdf4Eclipse/features/de.vonloesch.pdf4eclipse_1.0.1.jar"/>
<archive path="plugins/de.vonloesch.pdf4Eclipse_1.0.1.201111161450.jar" url="http://borisvl.github.com/Pdf4Eclipse/plugins/de.vonloesch.pdf4Eclipse_1.0.1.201111161450.jar"/>
<archive path="plugins/de.vonloesch.pdf4eclipse.help_1.0.0.201111161450.jar" url="http://borisvl.github.com/Pdf4Eclipse/plugins/de.vonloesch.pdf4eclipse.help_1.0.0.201111161450.jar"/>

As you can see this includes the feature de.vonloesch.pdf4eclipse_1.0.1.jar from a github page. This features includes two plugins which were also added via <archive ... />.

The downside of this approach is that you must include any updated version of the feature by hand, but I do not think there is another possibility to include a foreign feature.




回答2:


You can aggregate other remote update sites if you provide a composite p2 repo that can point to one or more remote repos. In your update directory, create 2 files:

compositeArtifacts.xml:

<?xml version='1.0' encoding='UTF-8'?>
<?compositeArtifactRepository version='1.0.0'?>
<repository name='Local Artifact Repository Collection' type='org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository' version='1'>
  <properties size='2'>
    <property name='p2.timestamp' value='1323486257091'/>
    <property name='p2.compressed' value='true'/>
  </properties>
  <children size='2'>
    <child location='http://download.eclipse.org/eclipse/updates/3.8-I-builds/'/>
    <child location='http://download.eclipse.org/e4/updates/0.12-I-builds'/>
  </children>
</repository>

compositeContent.xml:

<?xml version='1.0' encoding='UTF-8'?>
<?compositeMetadataRepository version='1.0.0'?>
<repository name='Local Content Repository Collection' type='org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository' version='1'>
  <properties size='2'>
    <property name='p2.timestamp' value='1323486257489'/>
    <property name='p2.compressed' value='true'/>
  </properties>
  <children size='2'>
    <child location='http://download.eclipse.org/eclipse/updates/3.8-I-builds/'/>
    <child location='http://download.eclipse.org/e4/updates/0.12-I-builds'/>
  </children>
</repository>

Then you can use your update directory as input to Help>Install New Software



来源:https://stackoverflow.com/questions/8489964/local-update-site-with-remote-features

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!