RSS

Maven and XPages Plugin – From Scratch / Part II – The Plugin

22 Dec

The core purpose of org.openntf.base.* is to bring some core plugins to the community. This plugin could be used in conjunction with other plugins, like org.eclipse.core.runtime. The first plugin that I want to build is a JAXB representation of the domino9 dxl. This plugin should offer some basic method to convert any domino object to a java object tree based on the domino dxl definition. This could be used to explore the design of a domino database, but also to represent the content of a single rich text item.

We will focus in this part on how to build the plugin based on the parent, that we have already build in Part 1

As in Part 1, we will do the stuff again with our Eclipse Kepler IDE.

1. Build a Maven module

100

Go to your parent project and use “right-click” for the context menu. Browse to Maven / New Maven Module Project.

101

The module name should be the same as your plugin id (later).

102

While you fill out the dialog, it seems that the group id is necessary, but you can delete this later. Be sure that you specify as packaging type: eclipse-plugin. This has a huge impact on the build process and your new maven module will now be handled as eclipse-plugin.

Nice we have now created some folders and files, but unfortunately not the necessary files to handle this project as a plugin project.

Create some files….

That a plugin project is a plugin project, it needs to files.

  1. META-INF/MANIFEST.FM
  2. build.properties

With the right content -> so let’s build this files.

Create the META-INF Folder:

103Create the MANIFEST.MF File:

104

Let’s open the MANIFEST.MF File with the Manifest Editor

And we do this with a right-click on the project and browse to “Plugin Tools / Open manifest”

105

Lets fill out some base information for the plugin.

Btw. the Version should correspond to the version in the parent’s pom file, instead of SNAPSHOT use qualifier (as the plugin would expect)

106

Now its a good moment to update the classpath of the plugin project (do it again with a right click on the project) and the go to Plugin Tools / Update classpath

107

To complete the plugin configuration, we add the dependency to org.eclipse.core.runtime108

And we create the file build.properties109

We open again our MANIFEST.MF and go to the last tab called build.properties.

There we complete the build.properties with the yellow marked text. (bin.includes and sources.. are needed for the whole plugin build process)
110

Give the Plugin an Activator

We build now the Activator class for the plugin, by building first the package and then the class.

111

Creating the class file112

Let’s open the MANIFEST.MF again and assign the activator class113

Build a run configuration to build the project with Maven

Now its time for the fun part. We build a run configuration, to execute the goal clean and install in the maven build cycle

  • clean will delete all genearted code
  • install will compile, test and package all code

114

Select “Maven Build” as category and click on the blank sheet to build a new run configuration115

Please fill out all yellow highlighted fields. Be aware of the goals field. We define with -Dnotes-platform=file:/// the external variable ${notes-platform} for our parent pom file.

Click “Run” to check if all is builded correct the output should look like this:

116

 
1 Comment

Posted by on December 22, 2014 in Java, Maven, OpenNTF, XPages

 

Tags: , ,

One response to “Maven and XPages Plugin – From Scratch / Part II – The Plugin

Leave a comment