-
Notifications
You must be signed in to change notification settings - Fork 35
Adding a new project to the SciJava POM
Including a project in pom-scijava is very beneficial. It means that a given pom-scijava version will be coupled with a specific version of that project, and by using the project.version properties, all consumers of pom-scijava will use only that version of the project.
It also minimizes bookkeeping, as whenever we run the Jenkins Bump-POM-SciJava job, the version property for each project is automatically updated to the latest release. By having a version property, there is no need to go through downstream projects updating their dependencies - a process that only invites mistakes.
There are several steps to include a project in pom-scijava, but they only need to be done once. The following tutorial will guide you through the process.
This tutorial assumes the project is a github project.
We will use these properties throughout the tutorial:
- PROPERTY
- GROUPID
- ARTIFACTID
- VERSION
- URL
- KEY_NAME
The GROUPID and ARTIFACTID come directly from your project's pom.xml.
VERSION refers to the latest deployed version, and is the first version that will be included in pom-scijava (e.g. the only time you will manually set the version).
PROPERTY is the prefix for your project's properties. For example, SciJava-common uses the property "scijava-common". Thus when referencing SciJava-common properties via pom-scijava, you can use "scijava-common.version" or "scijava-common.groupId". This value can be anything you choose, but should be appropriate and unique to your project, to avoid clashing with other properties.
URL is the github url of your project.
KEY_NAME is the short name you give to your deploy key (see step 2).
First, as the jenkins user on dev.loci.wisc.edu, run:
~/bin/add-github-deploy-key.sh KEY_NAME
to generate a SSH public/private key pair. Copy the public key fingerprint from this script's output for use later.
You will need to add this key in github to allow Jenkins access to your project. See the github help page for instructions on setting up a deploy key. Use the following settings for your deploy key:
- Title: [email protected]
- Key: paste the public key fingerprint you copied earlier
Click "Add key" and go to the next step!
First make sure your SciJava-common is up to date.
In pom-scijava/pom.xml :
- Manually increase the minor
<version>
of the pom - e.g.1.32
goes to1.33
- Find the
<properties>
block:- Add a comment block defining your project, e.g.
<!-- project name - URL -->
- If your project's groupId is not already defined, add an entry of the form:
<PROPERTY.groupId>GROUPID</PROPERTY.groupId>
- Add a version entry of the form:
<PROPERTY.version>VERSION</PROPERTY.version>
- Add a comment block defining your project, e.g.
Save and commit your changes.