Skip to content

BuildRadiator/BuildRadiatorMavenExtension

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BuildRadiator Maven extension (Event Spy)

Event spies are Maven extensions - not a Maven plugin as such.

This one goes hand in hand with a Build Radiator site.

A build is a number of conceptual steps. Steps starting, passing and failing are events that this extension can pass to the build radiator (build cancellation is is outside the control of this tech).

Setting up the extension for your build

In order to do the step updates on buildradiator.org ...

Go and get the JAR from Maven Central

Check that into (say) lib/, then configure your build script to do:

mvn <phase name> -Dmaven.ext.class.path=lib/buildradiatorextension-1.1.jar

When you are using a service like "Circle CI", and you're happy to check that a 10K jar, you've avoided a bootstrap problem as those CI-as-a-service things won't let you acquire a Maven extension before launching Maven.

If you're using an on-premises Jenkins, you may prefer to simply place the same Jar in the <maven-install-root>/lib/ext/ folder.

Configuring Steps

In your project's POM, you need to identify artifactId/phases/executions where a step starts:

<properties>
  <buildradiator.0>Compile=*</buildradiator.0>
  <buildradiator.1>Unit Tests=buildradiator/process-test-resources/default-testResources</buildradiator.1>
  <buildradiator.2>Service Tests=buildradiator/test/service-tests</buildradiator.2>
  <buildradiator.3>Selenium Tests=buildradiator/test/selenium-tests</buildradiator.3>
  <buildradiator.4>Package=*</buildradiator.4>
</properties>

One step can span multiple artifactId/phases/executions, of course, especially for a multi-module project.
The above was taken from the BuildRadiator project. See pom

If you mis-type a artifactId/phases/executions to the right-hand side of a =, then the build will look like this after it has finished:

It will also look like that if you mis-type a step-name on the left-hand side of a =.

Targeting a radiator other than buildradiator.org

If you have hosted your own build radiator server:

<properties>
  <buildradiator.baseurl>"https://buildradiator.mycompany.com"</buildradiator.baseurl>
</properties>

Be sure to get the http vs https right.

Important environment variables

You need to set these for each CI initiated build, before Maven is launched:

export buildId=<the build number from Jenkin or the commit hash etc>
export radiatorCode=<radiator code from when you created the radiator>
export radiatorSecret=<radiator secret from when you created the radiator>
export buildingThisArtifact=<the name of the root level artifact>

Don't do these on your dev workstation, because updating the build radiator is the business of your CI daemon.

Researching where to make step changes

In your project's POM:

<properties>
  <buildradiator.trace>true</buildradiator.trace>
</properties>

Sample of Maven Phases/Executions

Artifact/Phase/Executions for BuildRaditor itself:

  1. buildradiator/validate/enforce.versions
  2. buildradiator/process-resources/default-resources
  3. buildradiator/compile/default-compile
  4. buildradiator/process-test-resources/default-testResources
  5. buildradiator/test-compile/default-testCompile
  6. buildradiator/test/default-test
  7. buildradiator/test/unit-tests
  8. buildradiator/test/integration-tests
  9. buildradiator/test/functional-tests
  10. buildradiator/package/default-jar
  11. buildradiator/package/fat-jar
  12. buildradiator/install/default-install

Notice that JUnit has three executions - because that's how the "surefire" plugin was set up.
See pom.

Other projects may differ for artifacts, phases and executions. Here are those from an ordinary multi-module project on GitHub:

  1. multi/install/default-install
  2. core/process-resources/default-resources
  3. core/compile/default-compile
  4. core/process-test-resources/default-testResources
  5. core/test-compile/default-testCompile
  6. core/test/default-test
  7. core/package/default-jar
  8. core/install/default-install
  9. app/process-resources/default-resources
  10. app/compile/default-compile
  11. app/process-test-resources/default-testResources
  12. app/test-compile/default-testCompile
  13. app/test/default-test
  14. app/package/default-war
  15. app/package/default
  16. app/install/default-install

About

Event Spy (Maven Extension) for BuildRadiator

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages