Skip to content

Maven Build & Configuration Options

Nick Benik edited this page Aug 8, 2019 · 7 revisions

Directory Structure

The following description is simply an overview and may drift to be outdated. The definitive standard is located in PIC-SURE Standard Directory Structure

The following modules are part of the larger PIC-SURE API Maven build:

  • /pic-sure-api-data

    This module contains everything related to database configuration and setup

  • /pic-sure-api-war

    This module contains the code that implements the actual PIC-SURE framework

  • /pic-sure-api-wildfly

    This module is used to stand up a preconfigured wildfly instance. It is used for integration testing.

  • /pic-sure-initializer

    This module does... ?

  • /pic-sure-resources

    This module contains several subprojects that are resources that are exposed by the PIC-SURE framework

  • /pic-sure-util

    This module contains the utility functions that are used in various parts of the PIC-SURE framework and its associated resources.

Maven Options

The Maven build process has several options that were created to simplify things. These can be divided into two categories: debugging and development, and building.

Debugging Commands

Maven has been configured to allow selection of which resources to build:

Command Description
-DskipTests Causes Maven to skip the unit tests within the Surefire plugin
-DdebugIT Causes Maven build to wait for a remote debugger to attach during the integration tests process

The code that waits for the debugger to connect during integration testing this is located here.

Modular Build of Resources

Maven build processes has been built in a modular way to allowing inclusion/exclusion of example PIC-SURE resources within a deployment. This is done by deactivating Maven profiles that, by default, will include a particular resource type in the build.

Profile Name Resource Module Build Property
with-aggregate-resource pic-sure-aggregate-resource project.build.withresource.aggregate
with-ga4gh-resource pic-sure-ga4gh-dos project.build.withresource.ga4gh
with-gnome-count-resource pic-sure-gnome-i2b2-count-resource project.build.withresource.gnomei2b2
with-hsapi-resource pic-sure-hsapi-resource project.build.withresource.hsapi
with-irct-resource pic-sure-irct-resource project.build.withresource.irct

To remove a resource type from the build process specify its profile name on the command line like shown below. This will deactivate the maven profile and will not include specified resource module during building or testing:

    mvn clean install -D!with-ga4gh-resource

When a resource profile has been disabled the above Maven build profile will not be enabled, which they are all by default. This behavior will allow other steps in Maven to identify which actions should not be applied because the resource has not been included in the current run. These are defined here in the code.

Furthermore, if the build properties have not been set then because a resource profile has been disabled, then further settings that control what integration tests are run in the picsure-api-wildfly instance are not run. The relevant code can be seen here.

Integration Settings and Propagation

TODO: finish this

The Standard

  1. All settings in Maven only
  2. Follow naming convention in Maven and Standalone.xml
  3. Use JNDI for accessing values in all jUnit tests

Maven Settings

TODO: Document this

Standalone.xml

TODO: Document this

JNDI Access

TODO: Here is an example