﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-Jeffrey's Sky-随笔分类-开源技术</title><link>http://www.blogjava.net/Jeffery001/category/35352.html</link><description>Go with wind</description><language>zh-cn</language><lastBuildDate>Tue, 03 Aug 2010 07:04:10 GMT</lastBuildDate><pubDate>Tue, 03 Aug 2010 07:04:10 GMT</pubDate><ttl>60</ttl><item><title>开源软件问题记录系列 之一 在 Tomcat 中设置 Datasource</title><link>http://www.blogjava.net/Jeffery001/archive/2010/08/02/327728.html</link><dc:creator>Jeffrey Feng</dc:creator><author>Jeffrey Feng</author><pubDate>Mon, 02 Aug 2010 02:51:00 GMT</pubDate><guid>http://www.blogjava.net/Jeffery001/archive/2010/08/02/327728.html</guid><wfw:comment>http://www.blogjava.net/Jeffery001/comments/327728.html</wfw:comment><comments>http://www.blogjava.net/Jeffery001/archive/2010/08/02/327728.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Jeffery001/comments/commentRss/327728.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Jeffery001/services/trackbacks/327728.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 开源软件问题记录系列 之一 在 Tomcat 中设置 Datasource&nbsp;&nbsp;<a href='http://www.blogjava.net/Jeffery001/archive/2010/08/02/327728.html'>阅读全文</a><img src ="http://www.blogjava.net/Jeffery001/aggbug/327728.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Jeffery001/" target="_blank">Jeffrey Feng</a> 2010-08-02 10:51 <a href="http://www.blogjava.net/Jeffery001/archive/2010/08/02/327728.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Drools 规则引擎的使用总结</title><link>http://www.blogjava.net/Jeffery001/archive/2008/11/04/238582.html</link><dc:creator>Jeffrey Feng</dc:creator><author>Jeffrey Feng</author><pubDate>Tue, 04 Nov 2008 06:19:00 GMT</pubDate><guid>http://www.blogjava.net/Jeffery001/archive/2008/11/04/238582.html</guid><wfw:comment>http://www.blogjava.net/Jeffery001/comments/238582.html</wfw:comment><comments>http://www.blogjava.net/Jeffery001/archive/2008/11/04/238582.html#Feedback</comments><slash:comments>13</slash:comments><wfw:commentRss>http://www.blogjava.net/Jeffery001/comments/commentRss/238582.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Jeffery001/services/trackbacks/238582.html</trackback:ping><description><![CDATA[<strong>&nbsp;&nbsp;&nbsp; </strong>前一段时间在开发了一个做文本分析的项目。在项目技术选型的过程中，尝试使用了Drools规则引擎。让它来作为项目中有关模式分析和关键词匹配的任务。但后来，因为某种原因，还是撇开了Drools。现将这个过程中使用Drools的一些经验和心得记录下来。 <br />
<strong>（一）什么时候应该使用规则引擎</strong><br />
&nbsp;&nbsp;&nbsp; 这实际是一个技术选型的问题。但这个问题又似乎是一个很关键的问题（<em>一旦返工的话，你就知道这个问题是多么重要了</em>）。不知大家有没有过这样的经验和体会。往往在项目开始的时候，总会遇到应该选用什么技术？是不是应该使用最新的技术？或者应该选用什么技术呢（<em>PS：现在计算机软件中的各种技术层出不穷，具有类似功能的技术很多</em>）？<br />
&nbsp;&nbsp;&nbsp; 不管怎么样，这些问题总会困扰着我。比如，这次的这个项目。项目要求是要在一些log文件中（<em>这些log文件都是很大的应用系统所产生的，但由于legacy的原因，log本身的维护和规范工作一直没有得到改善，所以想借助于一些外部应用对这些log做以分析和清洗</em>）抽取出有用的信息。<br />
&nbsp;&nbsp;&nbsp; 于是，第一个想到的就是，这是一个文本挖掘类的项目。但又想，要抽取有用信息，必须得建立一些规则或pattern（模式）。所以，我第一个想到了规则引擎。因为这里面要建立好多规则，而这些规则可以独立于代码级别（<em>放到一个单独的drl文件里</em>）并可以用规则引擎去解析和执行。另一个重要的原因是，我原来用过，比较熟悉。这样，也可以节省开发时间吧。于是，好不犹豫的就开始做了Demo....<br />
&nbsp;&nbsp;&nbsp; 但事实上，在经历了一个多星期的编码、测试后，我发现运用规则引擎实在是太笨拙了。<br />
&nbsp;&nbsp;&nbsp; （1）首先必须建立一些数据模型。通过这些模型来refer规则文件中的LHS和Action。<br />
&nbsp;&nbsp;&nbsp; （2）还要考虑规则的conflict。如果有一些规则同时被触发，就要考虑设定规则的优先级或者是设定activiation-group来保证在一个group中的规则只有一个规则可以被触发。<br />
&nbsp;&nbsp;&nbsp; （3）对于&#8216;流&#8217;规则group ruleflow-group的使用。如果要控制在workingmemory中的规则被触发的顺序，则可以将这些规则分组。然后，通过规则建模的方式来实现。但这也添加了一定的effort。修改或者更新不大方便。<br />
&nbsp;&nbsp;&nbsp; 所以，基于上述体会，我更认为规则引擎更适用于那些对非流程性规则匹配的应用。当然，Drools也支持对流程性规则的建模过程。但，这也许不是最好的方式。<br />
<strong>（二）Drools规则引擎的使用杂记</strong><br />
&nbsp;&nbsp;&nbsp; <strong><span style="font-size: 12pt;">（1）Fact 的变更监听</span></strong>。在Drools里，如果一个Fact通过规则而改变，则需将这种改变通知给规则引擎。这里，一般有两种方式：显式和隐式。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 显式---在drl文件中通过 update、modify来通知；在程序中，通过Fact的引用调用modifyObject等方法来实现。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 隐式---通过在java bean实现property Listener Interface来让引擎自动监听到属性值的变化。我更习惯于这种方式。因为，一般看来凡是在规则引擎中添加到fact都是希望引擎来帮你进行管理的。所以，那它自己看到fact的变化是种很省事的办法。也很简单，就是用java bean property 监听的方式。<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; 通过StatefulSession来注册。<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; 调用StatefulSession的某个instance 的insert（Object，true）实现。而这个object是一个java bean。其中，要实现<strong> <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </strong>private final PropertyChangeSupport changes&nbsp; = new PropertyChangeSupport( this );<br />
&nbsp;&nbsp; &nbsp;public void addPropertyChangeListener(final PropertyChangeListener l) {<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; this.changes.addPropertyChangeListener( l );<br />
&nbsp;&nbsp; &nbsp;}<br />
<br />
&nbsp;&nbsp; &nbsp;public void removePropertyChangeListener(final PropertyChangeListener l) {<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; this.changes.removePropertyChangeListener( l );<br />
&nbsp;&nbsp; &nbsp;}<br />
&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 然后在set方法中调用<br />
&nbsp;&nbsp;&nbsp; this.changes.firePropertyChange( "temp",null,this.temp );<br />
<strong>&nbsp;&nbsp;&nbsp;&nbsp; （2）规则触发的优先级、组设置<br />
</strong>&nbsp;&nbsp;&nbsp; 往往，在设计我们自己的规则时，要考虑规则的触发条件。这不仅限于LHS的条件部分，还有规则本身被触发的有些设置等等。这里，列出一些比较常用和有效的规则优先级设置方式，以及需要注意的地方。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A.通过Salience方式。此值可正可负。越大优先级越高，也会被引擎首先执行。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; B.通过ruleflow-group 方式。实际上，使用这种方式也就是在使用建立规则流的方式。在Eclipse 3.3 中，Drools提供了建立规则流的插件。要在drl的同级目录中建立rf和rfm两个文件（当然，插件会帮助你建立这些）。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <img alt="" src="http://www.blogjava.net/images/blogjava_net/jeffery001/a.JPG" width="544" height="520" /><br />
选择RuleFlow File。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 这里，需要注意的一点是要在启动规则引擎的时候，加入启动rule flow的代码。<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp; InputStreamReader source = new InputStreamReader(RuleManager.class<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;.getResourceAsStream(rule_path));<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; PackageBuilder builder = new PackageBuilder();<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;builder.addPackageFromDrl(source);<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;builder.addRuleFlow(new InputStreamReader(RuleManager.class<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;.getResourceAsStream(rule_flow_path)));<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Package pkg = builder.getPackage();<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; RuleBase ruleBase = RuleBaseFactory.newRuleBase();<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ruleBase.addPackage(pkg);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 然后，在每次启动规则引擎的时候，调用如下方法：<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; StatefulSession ss;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ss.startProcess(flowProgress)；<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ss.fireAllRules();<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; flowProgress 是一个string类型。这个flow的名字。<br />
<img alt="" src="http://www.blogjava.net/images/blogjava_net/jeffery001/drools_image/b.jpg" width="393" height="421" /><br />
这个rule flow图中，显示了一个简单的规则流。如RSA就是一个rule-flow的名字。在这个rule set中可以设定一组rules。这样，就可以分开规则执行的顺序。在于rf和rfm同名的另一个 drl文件中定义这些组的名字。通过关键字 ruleflow-group 来表明。<br />
&nbsp;&nbsp;&nbsp;
C.通过activation-group的方式。通过这种方式，可以exclude一组rule中一旦有一个rule被invoke，而其它rule不会被execute。同时，可以搭配使用salience关键字来标明每个rule的优先级，这样就能够使得你想要的一般性概念的rule先被匹配执行。<br />
&nbsp;&nbsp;&nbsp; D.在使用ruleflow-group 的时候要注意使用lock-on-active true 关键字在每个rule。这样可以避免一旦有rule被触发，不会造成循环匹配执行。<br />
&nbsp;&nbsp;&nbsp; E.如果在LHS部分，需要调用某个方法来返回真、假值作为判断的一个条件，那么可以用eval函数。<br />
&nbsp;&nbsp;&nbsp; 如，eval(pattern.matched(5,$line.getCurrLine()))<br />
&nbsp;&nbsp;&nbsp; 其中，pattern是某个加入到workingmemory中的一个实例。matched是这个实例所代表类的一个方法。它返回boolean类型。<br />
&nbsp;&nbsp;&nbsp; <br />
<strong>&nbsp;
(3)Drools规则引擎的使用感受<br />
&nbsp;&nbsp;&nbsp; </strong>总之，Drools还是一个很不错的开源规则引擎。现在v4.0以上的版本已经比以前的版本在速度上有了很大的提升。可以作为我们一般应用程序系统的中间件产品（那些规则不是很经常改变的系统，已经非流程类规则）。但是，这其中还是需要一些额外的effort来学习它的使用文档以及整体架构，有一定的学习曲线。<br />
&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; 最后，我想一个较好的对于技术使用的practice就是：首先知道它能为你做什么，它最好的应用领域，然后再去深入。<strong><br />
&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; （PS:如果谁有使用Drools的问题，可以联系我！一起讨论！）<br />
</strong>
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp;&nbsp; <br />
<br />
<img src ="http://www.blogjava.net/Jeffery001/aggbug/238582.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Jeffery001/" target="_blank">Jeffrey Feng</a> 2008-11-04 14:19 <a href="http://www.blogjava.net/Jeffery001/archive/2008/11/04/238582.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Eclipse 插件开发中的 classnotfound 问题（转载）</title><link>http://www.blogjava.net/Jeffery001/archive/2008/10/14/234166.html</link><dc:creator>Jeffrey Feng</dc:creator><author>Jeffrey Feng</author><pubDate>Tue, 14 Oct 2008 02:19:00 GMT</pubDate><guid>http://www.blogjava.net/Jeffery001/archive/2008/10/14/234166.html</guid><wfw:comment>http://www.blogjava.net/Jeffery001/comments/234166.html</wfw:comment><comments>http://www.blogjava.net/Jeffery001/archive/2008/10/14/234166.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Jeffery001/comments/commentRss/234166.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Jeffery001/services/trackbacks/234166.html</trackback:ping><description><![CDATA[<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span style="font-size: 14pt; color: blue; font-family: 宋体;"><strong>目的</strong></span><span style="font-weight: normal; font-family: 宋体;">：</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">Eclipse</font></span><span style="font-weight: normal; font-family: 宋体;">插件开发中，经常要引用第三方包或者是引用其他插件中的类，由于插件开发环境引用类路径的设置和运行平台引用类路径的设置不同，经常导致开发过程</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">OK</font></span><span style="font-weight: normal; font-family: 宋体;">，一旦运行则出现</span><strong><span style="color: red;" lang="EN-US"><font face="Verdana">NoClassDefFoundError</font></span><span style="color: red; font-family: 宋体;">的问题</span></strong><span style="font-weight: normal; font-family: 宋体;">。本文的目的是全面分析各种情况下类路径的设置，以避免这个问题的出现。</span><span style="font-weight: normal;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><o:p><font face="Verdana"><strong>&nbsp;</strong></font></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span style="font-size: 14pt; color: blue; font-family: 宋体;"><strong>说明</strong></span><span style="font-weight: normal; font-family: 宋体;">：</span><strong><span style="color: blue;" lang="EN-US"><font face="Verdana">Jar</font></span><span style="color: blue; font-family: 宋体;">包和类路径实际上是一个概念</span></strong><span style="font-weight: normal; font-family: 宋体;">，比如类</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">com.bbebfe.Test.class</font></span><span style="font-weight: normal; font-family: 宋体;">打包为</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">test.jar</font></span><span style="font-weight: normal; font-family: 宋体;">包，添加类引用就直接添加</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">test.jar</font></span><span style="font-weight: normal; font-family: 宋体;">包。而如果是添加类文件路径，则添加包目录的上级目录，比如</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">lib/com/bbebfe/Test.class</font></span><span style="font-weight: normal; font-family: 宋体;">，则添加</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">lib</font></span><span style="font-weight: normal; font-family: 宋体;">文件夹，而不是</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">com</font></span><span style="font-weight: normal; font-family: 宋体;">文件夹。在此后的例子中都只说明</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">Jar</font></span><span style="font-weight: normal; font-family: 宋体;">包的形式。</span><span style="font-weight: normal;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span style="font-weight: normal;" lang="EN-US"><o:p><font face="Verdana">&nbsp;</font></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><strong><span style="font-size: 14pt; color: blue; font-family: 宋体;">分析</span><span style="font-size: 10.5pt; color: blue; font-family: 宋体;">：</span><span style="font-size: 10.5pt; color: blue;" lang="EN-US"><font face="Verdana">Eclipse</font></span><span style="font-size: 10.5pt; color: blue; font-family: 宋体;">插件开发对于</span><span style="font-size: 10.5pt; color: blue;" lang="EN-US"><font face="Verdana">Jar</font></span><span style="font-size: 10.5pt; color: blue; font-family: 宋体;">包的引用主要有三种原因：</span><span style="font-size: 10.5pt; color: blue;" lang="EN-US"><o:p></o:p></span></strong></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 18pt; text-indent: -18pt;"><span style="color: rgb(51, 51, 153);" lang="EN-US"><span><strong><font face="Verdana">1．</font></strong><span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"> </span></span></span><strong><span style="color: rgb(51, 51, 153); font-family: 宋体;">插件引用第三方包（普通的</span><span style="color: rgb(51, 51, 153);" lang="EN-US"><font face="Verdana">jar</font></span><span style="color: rgb(51, 51, 153); font-family: 宋体;">包或者类文件，不是插件）。</span><span style="color: rgb(51, 51, 153);" lang="EN-US"><o:p></o:p></span></strong></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 42pt; text-indent: -21pt;"><span style="font-weight: normal;" lang="EN-US"><span><font face="Verdana">a)</font><span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-family: 宋体;"><strong>开发环境引用配置</strong></span><span style="font-weight: normal; font-family: 宋体;">，在</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">prject -&gt; properties -&gt; Java build path</font></span><span style="font-weight: normal; font-family: 宋体;">中设置。</span><span style="font-weight: normal;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 42pt; text-indent: -21pt;"><span style="font-weight: normal;" lang="EN-US"><span><font face="Verdana">b)</font><span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-family: 宋体;"><strong>运行环境引用配置</strong></span><span style="font-weight: normal; font-family: 宋体;">，在</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">plugin manifest</font></span><span style="font-weight: normal; font-family: 宋体;">编辑器的</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">Runtime</font></span><span style="font-weight: normal; font-family: 宋体;">选项卡下的</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">classpath</font></span><span style="font-weight: normal; font-family: 宋体;">中添加</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">tset.jar</font></span><span style="font-weight: normal; font-family: 宋体;">包的引用（在</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">MANIFEST.MF</font></span><span style="font-weight: normal; font-family: 宋体;">中表现为</span><font face="Verdana"><span lang="EN-US"><strong>Bundle-ClassPath: lib/test.jar</strong></span><span style="font-weight: normal;" lang="EN-US">, </span></font><span style="font-weight: normal; font-family: 宋体;">在</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">plugin.xml</font></span><span style="font-weight: normal; font-family: 宋体;">表现为</span><span lang="EN-US"><strong><font face="Verdana">&lt;runtime&gt;</font></strong></span><span style="font-weight: normal; font-family: 宋体;">节下的引用</span><span style="font-weight: normal;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 63pt; text-indent: -63pt;"><span style="font-weight: normal;" lang="EN-US"><span><span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><font face="Verdana">i.</font><span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp; </span></span></span><span style="font-weight: normal; font-family: 宋体;">类文件在</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">lib</font></span><span style="font-weight: normal; font-family: 宋体;">目录下，如下的设置导出</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">lib</font></span><span style="font-weight: normal; font-family: 宋体;">目录下所有目录：</span><span style="font-weight: normal;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 21pt; text-indent: 21pt; text-align: left;" align="left"><span style="font-weight: normal; font-size: 10pt; color: navy; font-family: &quot;Courier New&quot;;" lang="EN-US">&lt;runtime&gt;</span><span style="font-weight: normal; font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-weight: normal; font-size: 10pt; color: black; font-family: &quot;Courier New&quot;;" lang="EN-US"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-weight: normal; font-size: 10pt; color: navy; font-family: &quot;Courier New&quot;;" lang="EN-US">&lt;library</span><span style="font-weight: normal; font-size: 10pt; color: black; font-family: &quot;Courier New&quot;;" lang="EN-US"> </span><span style="font-weight: normal; font-size: 10pt; color: navy; font-family: &quot;Courier New&quot;;" lang="EN-US">name=</span><span style="font-weight: normal; font-size: 10pt; color: green; font-family: &quot;Courier New&quot;;" lang="EN-US">"lib/"</span><span style="font-weight: normal; font-size: 10pt; color: navy; font-family: &quot;Courier New&quot;;" lang="EN-US">&gt;</span><span style="font-weight: normal; font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-weight: normal; font-size: 10pt; color: black; font-family: &quot;Courier New&quot;;" lang="EN-US"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>&nbsp;&nbsp;&nbsp; </span></span><span style="font-weight: normal; font-size: 10pt; color: navy; font-family: &quot;Courier New&quot;;" lang="EN-US">&lt;export</span><span style="font-weight: normal; font-size: 10pt; color: black; font-family: &quot;Courier New&quot;;" lang="EN-US"> </span><span style="font-weight: normal; font-size: 10pt; color: navy; font-family: &quot;Courier New&quot;;" lang="EN-US">name=</span><span style="font-weight: normal; font-size: 10pt; color: green; font-family: &quot;Courier New&quot;;" lang="EN-US">"*"</span><span style="font-weight: normal; font-size: 10pt; color: navy; font-family: &quot;Courier New&quot;;" lang="EN-US">/&gt;</span><span style="font-weight: normal; font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-weight: normal; font-size: 10pt; color: black; font-family: &quot;Courier New&quot;;" lang="EN-US"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-weight: normal; font-size: 10pt; color: navy; font-family: &quot;Courier New&quot;;" lang="EN-US">&lt;/library&gt;</span><span style="font-weight: normal; font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 21pt;"><span style="font-weight: normal; font-size: 10pt; color: black; font-family: &quot;Courier New&quot;;" lang="EN-US"><span>&nbsp;&nbsp; </span></span><span style="font-weight: normal; font-size: 10pt; color: navy; font-family: &quot;Courier New&quot;;" lang="EN-US">&lt;/runtime&gt;</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana"> <o:p></o:p></font></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 63pt; text-indent: -63pt;"><span style="font-weight: normal;" lang="EN-US"><span><span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><font face="Verdana">ii.</font><span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp; </span></span></span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">test.jar</font></span><span style="font-weight: normal; font-family: 宋体;">在</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">lib</font></span><span style="font-weight: normal; font-family: 宋体;">目录下：</span><span style="font-weight: normal;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-weight: normal; font-size: 10pt; color: black; font-family: &quot;Courier New&quot;;" lang="EN-US"><span>&nbsp;&nbsp; </span><span>&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-weight: normal; font-size: 10pt; color: navy; font-family: &quot;Courier New&quot;;" lang="EN-US">&lt;runtime&gt;</span><span style="font-weight: normal; font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-weight: normal; font-size: 10pt; color: black; font-family: &quot;Courier New&quot;;" lang="EN-US"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-weight: normal; font-size: 10pt; color: navy; font-family: &quot;Courier New&quot;;" lang="EN-US">&lt;library</span><span style="font-weight: normal; font-size: 10pt; color: black; font-family: &quot;Courier New&quot;;" lang="EN-US"> </span><span style="font-weight: normal; font-size: 10pt; color: navy; font-family: &quot;Courier New&quot;;" lang="EN-US">name=</span><span style="font-weight: normal; font-size: 10pt; color: green; font-family: &quot;Courier New&quot;;" lang="EN-US">"lib/test.jar"</span><span style="font-weight: normal; font-size: 10pt; color: navy; font-family: &quot;Courier New&quot;;" lang="EN-US">&gt;</span><span style="font-weight: normal; font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-weight: normal; font-size: 10pt; color: black; font-family: &quot;Courier New&quot;;" lang="EN-US"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>&nbsp;&nbsp;&nbsp; </span></span><span style="font-weight: normal; font-size: 10pt; color: navy; font-family: &quot;Courier New&quot;;" lang="EN-US">&lt;export</span><span style="font-weight: normal; font-size: 10pt; color: black; font-family: &quot;Courier New&quot;;" lang="EN-US"> </span><span style="font-weight: normal; font-size: 10pt; color: navy; font-family: &quot;Courier New&quot;;" lang="EN-US">name=</span><span style="font-weight: normal; font-size: 10pt; color: green; font-family: &quot;Courier New&quot;;" lang="EN-US">"*"</span><span style="font-weight: normal; font-size: 10pt; color: navy; font-family: &quot;Courier New&quot;;" lang="EN-US">/&gt;</span><span style="font-weight: normal; font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-weight: normal; font-size: 10pt; color: black; font-family: &quot;Courier New&quot;;" lang="EN-US"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-weight: normal; font-size: 10pt; color: navy; font-family: &quot;Courier New&quot;;" lang="EN-US">&lt;/library&gt;</span><span style="font-weight: normal; font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 21pt;"><span style="font-weight: normal; font-size: 10pt; color: black; font-family: &quot;Courier New&quot;;" lang="EN-US"><span>&nbsp;&nbsp; </span></span><span style="font-weight: normal; font-size: 10pt; color: navy; font-family: &quot;Courier New&quot;;" lang="EN-US">&lt;/runtime&gt;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 63pt; text-indent: -63pt;"><span style="font-weight: normal;" lang="EN-US"><span><span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><font face="Verdana">iii.</font><span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp; </span></span></span><span style="font-weight: normal; font-family: 宋体;">实际上上面的设置可以简化为：</span><span style="font-weight: normal;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 21pt; text-indent: 21pt; text-align: left;" align="left"><span style="font-weight: normal; font-size: 10pt; color: navy; font-family: &quot;Courier New&quot;;" lang="EN-US">&lt;runtime&gt;</span><span style="font-weight: normal; font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-weight: normal; font-size: 10pt; color: black; font-family: &quot;Courier New&quot;;" lang="EN-US"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-weight: normal; font-size: 10pt; color: navy; font-family: &quot;Courier New&quot;;" lang="EN-US">&lt;library</span><span style="font-weight: normal; font-size: 10pt; color: black; font-family: &quot;Courier New&quot;;" lang="EN-US"> </span><span style="font-weight: normal; font-size: 10pt; color: navy; font-family: &quot;Courier New&quot;;" lang="EN-US">name=</span><span style="font-weight: normal; font-size: 10pt; color: green; font-family: &quot;Courier New&quot;;" lang="EN-US">"lib/"</span><span style="font-weight: normal; font-size: 10pt; color: navy; font-family: &quot;Courier New&quot;;" lang="EN-US">/&gt;</span><span style="font-weight: normal; font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 21pt;"><span style="font-weight: normal; font-size: 10pt; color: black; font-family: &quot;Courier New&quot;;" lang="EN-US"><span>&nbsp;&nbsp; </span></span><span style="font-weight: normal; font-size: 10pt; color: navy; font-family: &quot;Courier New&quot;;" lang="EN-US">&lt;/runtime&gt;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 21pt;"><span style="font-weight: normal; font-size: 10pt; color: navy; font-family: &quot;Courier New&quot;;" lang="EN-US"><span>&nbsp;&nbsp;&nbsp; </span></span><span style="font-weight: normal; font-size: 10pt; color: navy; font-family: 宋体;">或者</span><span style="font-weight: normal; font-size: 10pt; color: navy; font-family: &quot;Courier New&quot;;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 21pt; text-indent: 21pt; text-align: left;" align="left"><span style="font-weight: normal; font-size: 10pt; color: navy; font-family: &quot;Courier New&quot;;" lang="EN-US">&lt;runtime&gt;</span><span style="font-weight: normal; font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: left;" align="left"><span style="font-weight: normal; font-size: 10pt; color: black; font-family: &quot;Courier New&quot;;" lang="EN-US"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-weight: normal; font-size: 10pt; color: navy; font-family: &quot;Courier New&quot;;" lang="EN-US">&lt;library</span><span style="font-weight: normal; font-size: 10pt; color: black; font-family: &quot;Courier New&quot;;" lang="EN-US"> </span><span style="font-weight: normal; font-size: 10pt; color: navy; font-family: &quot;Courier New&quot;;" lang="EN-US">name=</span><span style="font-weight: normal; font-size: 10pt; color: green; font-family: &quot;Courier New&quot;;" lang="EN-US">"lib/test.jar"</span><span style="font-weight: normal; font-size: 10pt; color: navy; font-family: &quot;Courier New&quot;;" lang="EN-US">/&gt;</span><span style="font-weight: normal; font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 21pt;"><span style="font-weight: normal; font-size: 10pt; color: black; font-family: &quot;Courier New&quot;;" lang="EN-US"><span>&nbsp;&nbsp; </span></span><span style="font-weight: normal; font-size: 10pt; color: navy; font-family: &quot;Courier New&quot;;" lang="EN-US">&lt;/runtime&gt;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 21pt;"><span style="font-weight: normal;" lang="EN-US"><span><font face="Verdana">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font></span></span><span style="font-weight: normal; font-family: 宋体;">默认即导出</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">lib</font></span><span style="font-weight: normal; font-family: 宋体;">目录下的所有包和</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">jar</font></span><span style="font-weight: normal; font-family: 宋体;">下的所有包</span><span style="font-weight: normal;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span style="font-weight: normal;" lang="EN-US"><span><font face="Verdana">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font></span></span><strong><span style="font-family: 宋体;">实际上，执行</span><span lang="EN-US"><font face="Verdana">b)</font></span><span style="font-family: 宋体;">项设置后，会自动执行</span><span lang="EN-US"><font face="Verdana">a)</font></span><span style="font-family: 宋体;">项设置，使开发环境和运行环境同时有效。</span></strong></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 18pt; text-indent: -18pt;"><span style="color: rgb(51, 51, 153);" lang="EN-US"><span><strong><font face="Verdana">2．</font></strong><span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"> </span></span></span><strong><span style="color: rgb(51, 51, 153); font-family: 宋体;">插件</span><span style="color: rgb(51, 51, 153);" lang="EN-US"><font face="Verdana">B</font></span><span style="color: rgb(51, 51, 153); font-family: 宋体;">引用插件工程</span><span style="color: rgb(51, 51, 153);" lang="EN-US"><font face="Verdana">A</font></span><span style="color: rgb(51, 51, 153); font-family: 宋体;">（非</span><span style="color: rgb(51, 51, 153);" lang="EN-US"><font face="Verdana">Eclipse</font></span><span style="color: rgb(51, 51, 153); font-family: 宋体;">插件，而是自己另外一个插件项目中的类）</span><span style="color: rgb(51, 51, 153);" lang="EN-US"><o:p></o:p></span></strong></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 42pt; text-indent: -21pt;"><span style="font-weight: normal;" lang="EN-US"><span><font face="Verdana">a)</font><span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-weight: normal; font-family: 宋体;">首先必须将</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">A</font></span><span style="font-weight: normal; font-family: 宋体;">中的</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">B</font></span><span style="font-weight: normal; font-family: 宋体;">需要的类暴露（</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">export</font></span><span style="font-weight: normal; font-family: 宋体;">）出来</span><span style="font-weight: normal;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 63pt; text-indent: -63pt;"><span style="font-weight: normal;" lang="EN-US"><span><span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><font face="Verdana">i.</font><span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-weight: normal; font-family: 宋体;">如果有</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">MANIFEST.MF</font></span><span style="font-weight: normal; font-family: 宋体;">文件，则表现为</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">plugin manifest</font></span><span style="font-weight: normal; font-family: 宋体;">编辑器中</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">runtime</font></span><span style="font-weight: normal; font-family: 宋体;">节的</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">exported packages</font></span><span style="font-weight: normal; font-family: 宋体;">，通过这里添加需要</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">export</font></span><span style="font-weight: normal; font-family: 宋体;">的包。在</span><span lang="EN-US"><strong><font face="Verdana">manifest.mf</font></strong></span><span style="font-weight: normal; font-family: 宋体;">文件中是</span><font face="Verdana"><span lang="EN-US"><strong>Export-Package</strong></span><span style="font-weight: normal;" lang="EN-US">: com.bbebfe<o:p></o:p></span></font></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 63pt; text-indent: -63pt;"><span style="font-weight: normal;" lang="EN-US"><span><span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><font face="Verdana">ii.</font><span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-weight: normal; font-family: 宋体;">如果只有</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">plugin.xml</font></span><span style="font-weight: normal; font-family: 宋体;">，则表现为</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">plugin manifest</font></span><span style="font-weight: normal; font-family: 宋体;">编辑器中</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">runtime</font></span><span style="font-weight: normal; font-family: 宋体;">节的</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">library visibility</font></span><span style="font-weight: normal; font-family: 宋体;">。</span><strong><span style="font-family: 宋体;">在</span><span lang="EN-US"><font face="Verdana">plugin.xml</font></span></strong><span style="font-weight: normal; font-family: 宋体;">文件中表现为</span><span style="font-weight: normal;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 63pt;"><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">&lt;runtime&gt;<o:p></o:p></font></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 63pt;"><span style="font-weight: normal;" lang="EN-US"><font face="Verdana"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;library&gt;<o:p></o:p></font></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 63pt;"><span style="font-weight: normal;" lang="EN-US"><font face="Verdana"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;export name=&#8221;com.bbebfe.*&#8221;/&gt;<o:p></o:p></font></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 63pt;"><span style="font-weight: normal;" lang="EN-US"><font face="Verdana"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>...<o:p></o:p></font></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 42pt; text-indent: -21pt;"><span style="font-weight: normal;" lang="EN-US"><span><font face="Verdana">b)</font><span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-weight: normal; font-family: 宋体;">在</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">B</font></span><span style="font-weight: normal; font-family: 宋体;">插件工程的</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">plugin manifest</font></span><span style="font-weight: normal; font-family: 宋体;">编辑器中的</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">dependencies</font></span><span style="font-weight: normal; font-family: 宋体;">选项卡中添加对</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">A</font></span><span style="font-weight: normal; font-family: 宋体;">插件的引用（这要求运行对话框中的</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">plugins</font></span><span style="font-weight: normal; font-family: 宋体;">列表的</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">workspace plugins</font></span><span style="font-weight: normal; font-family: 宋体;">中必须包含</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">A</font></span><span style="font-weight: normal; font-family: 宋体;">插件）。</span><span style="font-weight: normal;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 42pt; text-indent: -21pt;"><span style="font-weight: normal;" lang="EN-US"><span><font face="Verdana">c)</font><span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-weight: normal; font-family: 宋体;">如果</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">B</font></span><span style="font-weight: normal; font-family: 宋体;">工程是一个</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">RCP</font></span><span style="font-weight: normal; font-family: 宋体;">工程，则必须在</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">product</font></span><span style="font-weight: normal; font-family: 宋体;">编辑器的</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">configuration</font></span><span style="font-weight: normal; font-family: 宋体;">选项卡中包含</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">A</font></span><span style="font-weight: normal; font-family: 宋体;">插件工程。</span><span style="font-weight: normal;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 18pt; text-indent: -18pt;"><span style="color: rgb(51, 51, 153);" lang="EN-US"><span><strong><font face="Verdana">3．</font></strong><span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"> </span></span></span><strong><span style="color: rgb(51, 51, 153); font-family: 宋体;">插件</span><span style="color: rgb(51, 51, 153);" lang="EN-US"><font face="Verdana">B</font></span><span style="color: rgb(51, 51, 153); font-family: 宋体;">引用</span><span style="color: rgb(51, 51, 153);" lang="EN-US"><font face="Verdana">Eclipse</font></span><span style="color: rgb(51, 51, 153); font-family: 宋体;">插件</span><span style="color: rgb(51, 51, 153);" lang="EN-US"><font face="Verdana">A</font></span><span style="color: rgb(51, 51, 153); font-family: 宋体;">的类。</span><span style="color: rgb(51, 51, 153);" lang="EN-US"><o:p></o:p></span></strong></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 42pt; text-indent: -21pt;"><span style="font-weight: normal;" lang="EN-US"><span><font face="Verdana">a)</font><span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">Eclipse</font></span><span style="font-weight: normal; font-family: 宋体;">插件中的类都是</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">Exported</font></span><span style="font-weight: normal; font-family: 宋体;">，因此这步省略。</span><span style="font-weight: normal;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 42pt; text-indent: -21pt;"><span style="font-weight: normal;" lang="EN-US"><span><font face="Verdana">b)</font><span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-weight: normal; font-family: 宋体;">在</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">B</font></span><span style="font-weight: normal; font-family: 宋体;">插件工程的</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">plugin manifest</font></span><span style="font-weight: normal; font-family: 宋体;">编辑器中的</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">dependencies</font></span><span style="font-weight: normal; font-family: 宋体;">选项卡中添加对</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">A</font></span><span style="font-weight: normal; font-family: 宋体;">插件的引用（这要求</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">preferences -&gt; plugin development -&gt; target</font></span><span style="font-weight: normal; font-family: 宋体;">目标平台必须包含</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">A</font></span><span style="font-weight: normal; font-family: 宋体;">插件，且运行对话框的</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">plugins</font></span><span style="font-weight: normal; font-family: 宋体;">列表中的</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">target platform</font></span><span style="font-weight: normal; font-family: 宋体;">中必须选中</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">A</font></span><span style="font-weight: normal; font-family: 宋体;">插件）。</span><span style="font-weight: normal;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span style="font-weight: normal;" lang="EN-US"><o:p><font face="Verdana">&nbsp;</font></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span style="font-size: 14pt; color: blue; font-family: 宋体;"><strong>总结</strong></span><span style="font-weight: normal; font-family: 宋体;">：如果</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">B</font></span><span style="font-weight: normal; font-family: 宋体;">插件引用的</span><strong><span lang="EN-US"><font face="Verdana">A</font></span><span style="font-family: 宋体;">也是一个插件</span></strong><span style="font-weight: normal; font-family: 宋体;">，则</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">A</font></span><span style="font-weight: normal; font-family: 宋体;">必须出现在</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">B</font></span><span style="font-weight: normal; font-family: 宋体;">插件的</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">plugin dependencies</font></span><span style="font-weight: normal; font-family: 宋体;">引用中，而不是其他地方，否则肯定会出现运行时</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">NoClassDefFoundError</font></span><span style="font-weight: normal; font-family: 宋体;">问题（因此必须在</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">plugin manifest</font></span><span style="font-weight: normal; font-family: 宋体;">编辑器的</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">dependencies</font></span><span style="font-weight: normal; font-family: 宋体;">选项卡下进行设置）。而且只需要在这里设置的设置对开发环境和运行环境同时有效）</span><span style="font-weight: normal;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span style="font-weight: normal;" lang="EN-US"><o:p><font face="Verdana">&nbsp;</font></o:p></span></p>
<span style="font-size: 14pt; color: blue; font-family: 宋体;"><strong>注意</strong></span><span style="font-weight: normal; font-family: 宋体;">：还有一种情况就是开发环境没有某个包或者插件，而只在运行环境（</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">target</font></span><span style="font-weight: normal; font-family: 宋体;">）中存在，此时就必须设置正确的</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">target</font></span><span style="font-weight: normal; font-family: 宋体;">，然后按照正常程序添加插件引用，但此时已经不能在</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">plugin manifest</font></span><span style="font-weight: normal; font-family: 宋体;">的</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">dependencies</font></span><span style="font-weight: normal; font-family: 宋体;">选项卡中设置（因为在开发环境找不到这个</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">plugin</font></span><span style="font-weight: normal; font-family: 宋体;">），而必须在</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">plugin.xml</font></span><span style="font-weight: normal; font-family: 宋体;">或</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">MANIFEST.MF</font></span><span style="font-weight: normal; font-family: 宋体;">文件中手工设置。</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">plugin</font></span><span style="font-weight: normal; font-family: 宋体;">只要</span><span style="font-weight: normal;" lang="EN-US"><font face="Verdana">target</font></span><span style="font-weight: normal; font-family: 宋体;">中存在该插件，则开发和运行也不会有问题。</span>
<img src ="http://www.blogjava.net/Jeffery001/aggbug/234166.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Jeffery001/" target="_blank">Jeffrey Feng</a> 2008-10-14 10:19 <a href="http://www.blogjava.net/Jeffery001/archive/2008/10/14/234166.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>