开发者

How can i use fragment project for my plugin?

I have working plugin deployed. Now i need to add catalog contribution to existing plugin for xml validation. I have created fragment plugin for that.

Now i need to know How do i publish the fragment? Will there be two separate jar file generated for the plug开发者_运维问答in and placed at client side? Do i need to take care for something important?


Creating a fragment doesn't take much more validation than creating a regular plugin. The only difference I can think of is that you'll have a "fragment.xml" instead of the usual "plugin.xml". A fragment will be deployed as a separate JAR that can be installed (fragments are by nature optional) by the client alongside its "host" plugin.

How the fragment is deployed in your client's Eclipse depends on how you deliver the regular plugin. If you provide them with an update site, you'll have to make sure that your fragment is included in a feature (if you look at the feature.xml, you should have something like this when including a fragment) :

<plugin
     id="com.stackoverflow.plugin.id"
     download-size="0"
     install-size="0"
     version="0.0.0"
     fragment="true" <!-- this is the line of interest -->
     unpack="false"/>

If you deploy the jars, when you select both the plugin and its fragment and use right-click > export > deployable plug-ins and fragments, you'll see that there is a jar for both.

That's it really, the build facilities of Eclipse take care of everything for you, whether you're deploying regular plug-ins or plug-in fragments.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜