JBoss Community

Adding a Plugin (and/or Feature) To An Existing Component

created by Nick Boldt in JBoss Tools Development - View the full document

First, read this document on how to build JBoss Tools components locally: https://community.jboss.org/wiki/HowtoBuildJBossToolswithMaven3

 

----

 

Now that you can build your component, you can easily add a new plugin to that component. Here's how.

 

0. Make sure your new plugin compiles in your workspace. Ensure your MANIFEST.MF contains all references/includes/requirements you need. Be sure to set the correct Bundle-RequireExecutionEnvironment (eg., JDK5 or JDK6).

 

1. When you are satisfied, you can commit your new plugin project to SVN.

 

cd ~/trunk/as/plugins; \

svn add org.jboss.ide.eclipse.as.rse.core; \

svn ci -m "JBIDE-123456 Initial commit of new as.rse.core plugin" org.jboss.ide.eclipse.as.rse.core

 

2. Next, add a pom.xml file to the root of your new project.

 

You can use m2eclipse to help w/ this if you have it installed; otherwise copy from another existing plugin project and edit appropriately. The version of the pom should match the version in the manifest.mf. Note that 3.2.0.qualifier (in MANIFEST.MF) is equivalent to 3.2.0-SNAPSHOT in the pom.xml.

 

3. Build your plugin:

 

 cd ~/trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core; \
mvn3 clean install

 

4. If your component's new plugin builds successfully, you can commit the pom.xml file, and add a reference to the new plugin (module) in the container pom:

 

 vi ~/trunk/as/plugins/pom.xml

 

5. To ensure that your plugin is available on the update site, be sure that it is contained in at least one feature's feature.xml.

 

 vi ~/trunk/as/features/org.jboss.ide.eclipse.as.feature/feature.xml

 

6. If necessary, create a new feature to contain the new plugin - easiest approach is to copy an existing feature project, and string-replace the various files until it suits your needs. Don't forget to update .project and other hidden files.

 

svn add org.jboss.ide.eclipse.as.new.feature; \

svn ci -m "JBIDE-123456 Initial commit of new as.new feature" org.jboss.ide.eclipse.as.new.feature

 

7. If your component's new feature builds successfully, you can commit the pom.xml file, and add a reference to the new plugin (module) in the container pom:

 

 vi ~/trunk/as/features/pom.xml

 

8. Next, ensure that the feature appears in all appropriate update sites:

 

vi ~/trunk/as/site/category.xml # (the component's update site)

vi ~/trunk/build/aggregate/site/site.xml # (the JBoss Tools aggregate update site)

vi ~/devstudio/trunk/product/site/site.xml # (the JBoss Developer Studio aggregate update site)

 

9. Finally, build the sites locally to ensure the XML is valid and the contents appear correctly. You can then install the new feature from the sites into Eclipse or JBDS to verify it runs as expected (no missing dependencies which prevent the plugin from being activated, no missing metadata such as description, provider, license or copyright while installing, etc.)

 

 cd ~/trunk/as/; mvn clean install; # then point Eclipse at ~/trunk/as/site/target/repository/
  and
cd ~/trunk/build/aggregate/site; mvn clean install; # then point Eclipse at ~/trunk/build/aggregate/site/target/site/

cd ~/devstudio/trunk/product; mvn clean install; # then point Eclipse at ~/devstudio/trunk/product/site/target/site/
  and
cd ~/devstudio/trunk/product; mvn clean install -f pom-site-and-product.xml; # then point JBDS at ~/devstudio/trunk/product/features/com.jboss.jbds/target/repository/

Comment by going to Community

Create a new document in JBoss Tools Development at Community