Sometimes I think it would be good to have an assistant who does finalize all my tasks. Specially the tasks, I was not aware that I did not deliver all information to the community. And what a shame, one of my most favorite project was such an unfinished business. The real bad thing was, I didn’t blog about how to use all the code I’ve developed while I was last time in Ireland to meet my friends at IBM.
But a nice blog post by Eric McCormick (https://edm00se.io/xpages/headless-dde-and-jenkins/) reminds me about my duties. Now Eric, time to explain you how simple you can build full XPages Applications with the headlessdesigner-maven-plugin:
The Project Setup
I’m using the JUnit4XPages Project to explain how to build the example database with the headlessdesigner-maven-plugin. This project is fully mavenized and uses the tycho plugins to build the plugins, feature and the updatesite. The project is with a parent – child structure organized. The following stuff in the parent is relevant for the building of the XPages Application:
ddehd.designerexec and ddehd.notesdata are in this example “externalized” to the environment variables notes-designer and notes-data. Both values are import to invoke the headlessdesigner-maven-plugin. With mvn clean install -Dnotes-designer= -Dnotes-data= can the build be customized.
There is an additional profile, which is only executed if the notes-designer variable is seted. This has the good behavior, that the NSF is only build, if you have specified the location of your IBM Domino Designer. The module org.openntf.junit.odp is with purpose at the end of the sequence, because we need the updatesite first.
The org.openntf.junit.odp contains in the sub directory “on-disk-project” the on-disk representation of the NSF, which means all the code. This Code need the org.openntf.junit.xsp.feature installed on the IBM Domino Designer environment to build. This is the reason, why we build the updatesite before.
The headlessdesigner-maven-plugin supports the deployment of the feature. The pom.xml for org.openntf.junit.xsp.odp looks like this:
ddehd.odpdirectory points to the on-disk-project. Pro Tip: Take this in a subdirectory otherwise the IBM Domino Designer eats your pom.xml ;).
ddehd.targetdatabasename contains the name of your resulting database.
maven.build.timestamp.format is used to build a timestamp that matches the format of the feature.
feature.url points to the file location of the updatesite. This is very powerful, because you can also point to a URL and I think also to a p2 repository. This means for XPages Application, you are capable to point to all the updatesites of the dependencies you have (yes there is a reason why every new plugin project at OpenNTF should have a p2 repository, and why we push them on the openntf.org website, more about this later)
feature.version calculates the current version number. We are using for this the org.codehouse.mojo / build-helper-maven-plugin
In the plugins section is the org.openntf.maven / headlessdesigner-maven-plugin with all additional configurations. I want to point to the features / feature block, where you can define all the features that has to be installed for the headless designer to be able to build your application.
templateBuildNames and templateBuildVersion is a powerful add-on from Jesse Gallagher and results in the following information on the database:
With all that configurations, I’m now able to start the build direct from my eclipse
And it will build the full project:
Done…. (btw. the headlessdesigner-maven-plugin is available in the maven central repository, no installation needed for this, only the IBM Domino Designer must be installed).