Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Problem

When reporting a build to Sealights via Maven from the command line, you need to provide a different build name each time you create a new Build Session ID.

...

Code Block
languagebash
mvn clean install -Psealights -DBUILD_NUMBER=`date +"%y%m%d_%H%M"`

Timestamp passed to Sealights 

Using an timestamp generated by Sealights

Sealights Java agents supports a specific SL_Timestamp variable the JSON configuration file to set the Sealights Maven plugin generating automatically a time stamp as a default buildname.
The default format is yyyy.MM.dd-hh.mm.

Code Block
languagexml
titleSample of JSON configuration file
{
  ...
  "buildName": "SL_Timestamp",
  ...
}

Using a timestamp variable in pom.xml

Maven provides a built-in property called ${maven.build.timestamp} that provides the time the build was initiated and this can be used in your Sealights profile after wrapping in another property

...