三、 将项目打包成Deployable features
1. 找到一个 startup.jar 文件( startup.jar 是rcp的入口,里面有main函数。你把第一步可运行的rcp应用中的 eclipse.exe 用这个startup.jar代替,运行startup.jar也可启动你的rcp应用 )。在 org.jdbm.gd.jpdl.feature 新建一个文件夹rootfiles(作为应用的根),并将刚才的startup.jar放在rootfiles下面(在附件中下载)
2. 把 org.jdbm.gd.jpdl.feature 中build.properties文件内容改为
bin.includes = feature.xml
root = rootfiles
3. 用jdk的keytool工具生成一个key文件
在目录D:\xvxv\jbpm\下用控制台执行命令keytool -genkey -alias myjbpm -keyalg RSA -keystore D:\xvxv\jbpm\key跟据提示执行,记往输入的密码
在D:\xvxv\jbpm\下生成了一个文件key
4. 打包:
右键org.jdbm.gd.jpdl.feature工程,选择Export,选择Deployable features
出现一个窗口,在Destination中配置生成包的路径
在options中选择第二个
在jar signing中使用你生成的key文件
在java web start中配置你的java web start信息,并完成配置
在你的桌面会生成一个myRcp1文件夹,打包成功。
四、用java web start来发布你的 Deployable features
在myeclipse下建一个web工程
jbpmJws.jnlp
<?xml version="1.0" encoding="UTF-8"?> <jnlp codebase="http://192.168.32.28:8080/jbpm-cn/jbpm"> <information> <title>JBPM in web start</title> <vendor>Lively Corporation</vendor> <description>HelloWorld Test Example for WebStart.</description> <homepage href="http://192.168.32.28:8080/jbpm/index.jsp" /> <offline-allowed /> </information> <security> <!-- 设置此RCP应用对文件系统进行完全的访问权限 --> <all-permissions /> </security> <!-- 设置此应用程序的启动类,RCP应用总是由此类来引导启动 --> <application-desc main-class="org.eclipse.core.launcher.WebStartMain"> <!-- 这里可以设置应用程序启动时所要传递的参数, 与eclipse.exe所使用的参数类似 --> <argument>-nosplash</argument> </application-desc> <resources> <!-- 指定此应用程序所使用的JRE版本 --> <j2se version="1.5+" /> <!-- 指定启动类所在的Jar包,发布RCP应用时总是要下载此Jar包 --> <jar href="startup.jar" /> <!-- 这里设置扩展配置文件的地址,对于JWS管理器来说, 一个扩展配置文件即对应一个库,主应用程序可以使用多个库来完成特定的功能。 扩展配置文件也是可以再包含扩展配置文件的,即可以递归使用 --> <extension name="Examples RCP Feature" href="features/org.jdbm.gd.jpdl.feature_1.0.0.jnlp" /> <!-- <extension name="Examples RCP Feature" href="./jar/jws/features/org.eclipse.rcp_3.3.0.v20070607-8y8eE8NEbsN3X_fjWS8HPNG.jnlp" /> --> <!-- 这里设置RCP应用程序的工作空间目录与普通RCP应用中config.ini的配置项类似 --> <property name="osgi.instance.area" value="C:/Documents and Settings/jbpm-jws/WorkSpace/jbpm" /> <!-- 设置RCP应用的配置文件目录 --> <property name="osgi.configuration.area" value="C:/Documents and Settings/jbpm-jws/configuration" /> <!-- 设置RCP应用启动时所要运行的产品Id,与config.ini中的配置相同 --> <property name="osgi.splashPath" value="platform:/base/plugins/org.jbpm.gd.jpdl" /> <property name="eclipse.product" value="org.jbpm.gd.jpdl.product" /> <property name="osgi.bundles" value="org.eclipse.equinox.common@2:start,org.eclipse.update.configurator@3:start,org.eclipse.core.runtime@start"/> <property name="osgi.bundles.defaultStartLevel" value="4" /> </resources> </jnlp>
org.jdbm.gd.jpdl.feature_1.0.0.jnlp
<?xml version="1.0" encoding="UTF-8"?> <jnlp codebase="http://192.168.32.28:8080/jbpm-cn/jbpm"> <information> <title>Feature Feature</title> <vendor>Lively Corporation</vendor> <offline-allowed/> </information> <security> <all-permissions/> </security> <component-desc/> <resources> <j2se version="1.5+" /> </resources> <resources> <jar href="plugins/com.genuitec.javascript.debug.mozilla_6.0.0.zmyeclipse60020070820.jar"/> <jar href="plugins/com.ibm.icu_3.6.1.v20070417.jar"/> <jar href="plugins/org.apache.xerces_2.8.0.v200705301630.jar"/> <jar href="plugins/org.apache.xml.resolver_1.1.0.v200705310020.jar"/> <jar href="plugins/org.eclipse.compare_3.3.0.I20070606.jar"/> <jar href="plugins/org.eclipse.core.commands_3.3.0.I20070605-0010.jar"/> <jar href="plugins/org.eclipse.core.contenttype_3.2.100.v20070319.jar"/> <jar href="plugins/org.eclipse.core.databinding_1.0.0.I20070606-0010.jar"/> <jar href="plugins/org.eclipse.core.expressions_3.3.0.v20070606-0010.jar"/> <jar href="plugins/org.eclipse.core.filebuffers_3.3.0.v20070606-0010.jar"/> <jar href="plugins/org.eclipse.core.filesystem_1.1.0.v20070606.jar"/> <jar href="plugins/org.eclipse.core.filesystem.win32.x86_1.1.0.v20070510.jar"/> <jar href="plugins/org.eclipse.core.jobs_3.3.0.v20070423.jar"/> <jar href="plugins/org.eclipse.core.net_1.0.0.I20070531.jar"/> <jar href="plugins/org.eclipse.core.resources_3.3.0.v20070604.jar"/> <jar href="plugins/org.eclipse.core.resources.compatibility_3.2.100.v20070502.jar"/> <jar href="plugins/org.eclipse.core.resources.win32_3.3.0.v20070226.jar"/> <jar href="plugins/org.eclipse.core.runtime_3.3.100.v20070530.jar"/> <jar href="plugins/org.eclipse.core.runtime.compatibility.registry_3.2.100.v20070316.jar"/> <jar href="plugins/org.eclipse.core.variables_3.2.0.v20070426.jar"/> <jar href="plugins/org.eclipse.debug.core_3.3.0.v20070607-1800.jar"/> <jar href="plugins/org.eclipse.debug.ui_3.3.0.v20070607-1800.jar"/> <jar href="plugins/org.eclipse.draw2d_3.2.100.v20070529.jar"/> <jar href="plugins/org.eclipse.emf.common_2.3.0.v200706262000.jar"/> <jar href="plugins/org.eclipse.emf.ecore_2.3.0.v200706262000.jar"/> <jar href="plugins/org.eclipse.emf.ecore.xmi_2.3.0.v200706262000.jar"/> <jar href="plugins/org.eclipse.equinox.app_1.0.0.v20070606.jar"/> <jar href="plugins/org.eclipse.equinox.common_3.3.0.v20070426.jar"/> <jar href="plugins/org.eclipse.equinox.preferences_3.2.100.v20070522.jar"/> <jar href="plugins/org.eclipse.equinox.registry_3.3.0.v20070522.jar"/> <jar href="plugins/org.eclipse.gef_3.2.100.v20070620.jar"/> <jar href="plugins/org.eclipse.help_3.3.0.v20070524.jar"/> <jar href="plugins/org.eclipse.jdt.compiler.apt_1.0.0.v20070510-2000.jar"/> <jar href="plugins/org.eclipse.jdt.compiler.tool_1.0.0.v_771.jar"/> <jar href="plugins/org.eclipse.jdt.core_3.3.0.v_771.jar"/> <jar href="plugins/org.eclipse.jdt.core.manipulation_1.1.0.v20070606-0010.jar"/> <jar href="plugins/org.eclipse.jdt.debug_3.3.0.v20070530a.jar"/> <jar href="plugins/org.eclipse.jdt.debug.ui_3.2.100.v20070531-1800.jar"/> <jar href="plugins/org.eclipse.jdt.launching_3.3.0.v20070510.jar"/> <jar href="plugins/org.eclipse.jdt.ui_3.3.0.v20070607-0010.jar"/> <jar href="plugins/org.eclipse.jem.util_2.0.0.v200705302225.jar"/> <jar href="plugins/org.eclipse.jface_3.3.0.I20070606-0010.jar"/> <jar href="plugins/org.eclipse.jface.databinding_1.1.0.I20070606-0010.jar"/> <jar href="plugins/org.eclipse.jface.text_3.3.0.v20070606-0010.jar"/> <jar href="plugins/org.eclipse.ltk.core.refactoring_3.3.0.v20070606-0010.jar"/> <jar href="plugins/org.eclipse.ltk.ui.refactoring_3.3.0.v20070606-0010.jar"/> <jar href="plugins/org.eclipse.osgi_3.3.0.v20070530.jar"/> <jar href="plugins/org.eclipse.osgi.util_3.1.200.v20070605.jar"/> <jar href="plugins/org.eclipse.search_3.3.0.v20070606-0010.jar"/> <jar href="plugins/org.eclipse.swt_3.3.0.v3346.jar"/> <jar href="plugins/org.eclipse.swt.win32.win32.x86_3.3.0.v3346.jar"/> <jar href="plugins/org.eclipse.team.core_3.3.0.I20070607.jar"/> <jar href="plugins/org.eclipse.team.ui_3.3.0.I20070607.jar"/> <jar href="plugins/org.eclipse.text_3.3.0.v20070606-0010.jar"/> <jar href="plugins/org.eclipse.ui_3.3.0.I20070614-0800.jar"/> <jar href="plugins/org.eclipse.ui.console_3.2.0.v20070530.jar"/> <jar href="plugins/org.eclipse.ui.editors_3.3.0.v20070606-0010.jar"/> <jar href="plugins/org.eclipse.ui.forms_3.3.0.v20070511.jar"/> <jar href="plugins/org.eclipse.ui.ide_3.3.0.I20070620.jar"/> <jar href="plugins/org.eclipse.ui.navigator_3.3.0.I20070605-0010.jar"/> <jar href="plugins/org.eclipse.ui.navigator.resources_3.3.0.I20070605-0010.jar"/> <jar href="plugins/org.eclipse.ui.views_3.2.100.I20070319-0010.jar"/> <jar href="plugins/org.eclipse.ui.views.properties.tabbed_3.3.0.I20070605-0010.jar"/> <jar href="plugins/org.eclipse.ui.win32_3.2.100.I20070319-0010.jar"/> <jar href="plugins/org.eclipse.ui.workbench_3.3.0.I20070608-1100.jar"/> <jar href="plugins/org.eclipse.ui.workbench.texteditor_3.3.0.v20070606-0010.jar"/> <jar href="plugins/org.eclipse.update.configurator_3.2.100.v20070615.jar"/> <jar href="plugins/org.eclipse.update.core_3.2.100.v20070615.jar"/> <jar href="plugins/org.eclipse.update.core.win32_3.2.100.v20070615.jar"/> <jar href="plugins/org.eclipse.update.ui_3.2.100.v20070615.jar"/> <jar href="plugins/org.eclipse.wst.common.core_1.1.101.v200706120315.jar"/> <jar href="plugins/org.eclipse.wst.common.environment_1.0.200.v200705302225.jar"/> <jar href="plugins/org.eclipse.wst.common.frameworks_1.1.102.v200706071630.jar"/> <jar href="plugins/org.eclipse.wst.common.project.facet.core_1.2.0.v200706071740.jar"/> <jar href="plugins/org.eclipse.wst.common.ui_1.1.200.v200705302225.jar"/> <jar href="plugins/org.eclipse.wst.common.uriresolver_1.1.201.v200705302225.jar"/> <jar href="plugins/org.eclipse.wst.sse.core_1.1.201.zmyeclipse60020070820.jar"/> <jar href="plugins/org.eclipse.wst.sse.ui_1.0.302.zmyeclipse60020070820.jar"/> <jar href="plugins/org.eclipse.wst.validation_1.1.101.zmyeclipse60020070820.jar"/> <jar href="plugins/org.eclipse.wst.xml.core_1.1.200.zmyeclipse60020070820.jar"/> <jar href="plugins/org.eclipse.wst.xml.ui_1.0.300.zmyeclipse60020070820.jar"/> <jar href="plugins/org.jbpm.gd.common_3.2.0.alpha1.jar"/> <jar href="plugins/org.jbpm.gd.jpdl_3.2.0.alpha1.jar"/> <jar href="plugins/org.mozilla.xpcom_1.8.1.3-20070320.jar"/> <jar href="plugins/org.eclipse.core.runtime.compatibility.auth_3.2.100.v20070502.jar"/> <jar href="plugins/org.eclipse.core.databinding.beans_1.0.0.I20070606-0010.jar"/> </resources> </jnlp>
Config.ini
#Product Runtime Configuration File osgi.splashPath=platform:/base/plugins/org.jbpm.gd.jpdl eclipse.product=org.jbpm.gd.jpdl.product osgi.bundles=org.eclipse.equinox.common@2:start,org.eclipse.update.configurator@3:start,org.eclipse.core.runtime@start osgi.bundles.defaultStartLevel=4
将你打的包按上图中的目加入到你的web工程中,发布到服务器中,在index.jsp中加入一个超链接到你的jbpmJws.jnlp中。
(附件中的jbpm.rar中有org.jbpm.gd.common,org.jbpm.gd.common,org.jdbm.gd.jpdl.feature三个工程)