根据插件出盘方式分为三种:
- PDE方式
- 调用pde.exportPlugins进行打包
- 手动过程如下
- java -jar %ECLIPSE_HOME%/plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar -application org.eclipse.ant.core.antRunner -buildfile plugins_build.xml
-
plugins_build.xml如下
<?xml version="1.0" encoding="UTF-8"?> <project default="plugin_export" name="build"> <target name="plugin_export"> <pde.exportPlugins destination="src/${eclipse}" exportSource="false" exportType="directory" plugins="org.knime.core,org.knime.base,org.knime.core.data.uritype,org.knime.ext.sun,org.knime.ext.svg,org.knime.jsnippets,org.knime.product,org.knime.stats,org.knime.timeseries,org.knime.workbench.core,org.knime.workbench.editor,org.knime.workbench.explorer.view,org.knime.workbench.extension,org.knime.workbench.help,org.knime.workbench.repository,org.knime.workbench.ui,org.knime.workbench.ui.layout,org.knime.workbench" useJARFormat="true"/> </target> </project>
- 自动过程如下
- build.xml如下
-
<target name="build_plugins"> <java jar="D:/miner/ae_datastudio2/eclipse_32bit/plugins/${ant.compile.jar}" fork="true" dir="src"> <arg value="-application"/> <arg value="org.eclipse.ant.core.antRunner"/> <arg value="-buildfile"/> <arg value="../${plugins.build.xml}"/> <arg value="-propertyfile"/> <arg value="../${build.properties}"/> <arg value="-data"/> <arg value="../src/workspace"/> <arg value="-debug"/><!-- --> </java> </target>
-
问题
-
依赖workspace和eclipse路径
-
- 手动打包
- 直接使用ant编译并打包插件
- 问题
- 逻辑简单但维护麻烦,难以标准化使用
- Tycho方式
- Tycho可以直接使用mvn org.eclipse.tycho:tycho-pomgenerator-plugin:0.18.1:generate-poms -DgroupId=GROUPID -Dversion=VERSION生成pom.xml文件
- 使用mvn package打包
- 详情见
- http://holbrook.github.io/2014/01/08/build_osgi_bundle_with_tycho_maven_plugin.html
- http://holbrook.github.io/2014/01/21/tycho_vs_maven_bundle_plugin.html