Clover Core, Ant, Eclipse and IDEA Plugins Developer Guide

Prerequisites

1. Install tools. Mandatory tools are:

  • Ant 1.9.4 (or higher)
  • Maven 3.6.3 (or higher)
  • Git
  • JDK 17
  • IntelliJ IDEA 14
  • Eclipse 4.2.2

Optional tools are:

  • IDEA 15.x, 2016.x - to run tests against newer IDEA versions
  • Eclipse 4.3.1, 4.4.0, 4.5.1, 4.6.0 - to run tests against newer Eclipse versions

 

2. Set environment variables:

  • ANT_HOME=/path/to/apache-ant
  • M2_HOME=/path/to/maven3
  • JAVA_HOME=/path/to/jdk17

 

3. Check out main Clover repository:

git clone ssh://git@github.com/openclover/clover.git


4. Set up paths to JDK, IDEA and Eclipse:

Open <clover>/build.properties and put proper paths.


5. Download, repack and install third party libraries:

# cd clover
mvn install -f clover-core-libs/jarjar/pom.xml
mvn install -Pworkspace-setup -f clover-core-libs/pom.xml
mvn install -Pworkspace-setup -f clover-eclipse-libs/pom.xml
mvn install -Pworkspace-setup -f clover-jtreemap/pom.xml
mvn install -Pworkspace-setup -f clover-idea-libs/pom.xml

 

6. Install Atlassian fork of KTreeMap library:

Add https://packages.atlassian.com/mvn/maven-atlassian-external to your list of Maven repositories in settings.xml OR Download the following files and install locally:
PACKAGES_ATLASSIAN_COM=https://packages.atlassian.com/mvn/maven-atlassian-external/
KTREEMAP_PATH=net/sf/jtreemap/ktreemap/1.1.0-atlassian-01

wget $PACKAGES_ATLASSIAN_COM/$KTREEMAP_PATH/ktreemap-1.1.0-atlassian-01.jar
wget $PACKAGES_ATLASSIAN_COM/$KTREEMAP_PATH/ktreemap-1.1.0-atlassian-01.pom
mvn install:install-file -Dfile=ktreemap-1.1.0-atlassian-01.jar -DpomFile=ktreemap-1.1.0-atlassian-01.pom

Build and test

Building from a command line

# Compile everything and run all tests
mvn test

# Install all modules locally, without testing
mvn install -DskipTests=true

# Run tests for three main modules
mvn test -pl clover-ant,clover-core,clover-groovy

To learn about other targets available see Build system.

Building Clover from IntelliJ IDEA

  1. Compile sources using Maven first using commands listed above. This is because the script downloads third party JARs as well as generates some Java sources.
  2. Open Clover project in IDEA by importing the root pom.xml file.

Release and publish

To create a snapshot version of Clover Core as well as plugins for Ant, Eclipse and IDEA:

mvn install -DskipTests=true

To create a stable version of Clover Core as well as plugins for Ant, Eclipse and IDEA:

  1. update com.atlassian.clover.registry.format.RegHeader#REG_FORMAT_VERSION (only if format of the database has changed)

  2. run a command and specify version numbers and tag in an interactive console
mvn release:prepare release:perform

Artefacts will be created in:

  • OpenClover Runtime - clover-runtime/target
  • OpenClover Core - clover-all/target
  • OpenClover for Ant - clover-ant-zip/target
  • OpenClover for Eclipse - clover-eclipse/org.openclover.eclipse.updatesite/target
  • OpenClover for IDEA - clover-idea/target