Gradle

Record Java application with RevDeBug

Estimated reading time: 2 mins

Last edited: 04 Nov 2019

Requirements

Required knowledge:

Other requirements:

  • Java version: RevDeBug is compatible with java version 7 and 8

  • Maven version: RevDeBug is compatible with Maven 2.0.1 or higher
  • Gradle version: RevDeBug is compatible with Gradle 1.0 or higher

  • any Java application - you can use our RevDeBug Java Demo application
Adding RevDeBug to Gradle build pipeline

Add following lines to the main build.gradle file in the root node:

build.gradle

    repositories {
        maven {
            url 'https://maven.revdebug.com'
        }
    }

    //if your target java version is 7 change to compiler7
    dependencies {
        compileOnly 'com/revdebug:compiler8:5.1'
        implementation 'com/revdebug:RevDeBug:5.1'
    }

    //* compile keyword instead of implementation for Gradle version less //than 3.0

    //* compile keyword instead of compileOnly for Gradle version less than //2.12
 
    
Configuration connection to RevDeBug DevOps Monitor

Add following lines to the main build.gradle file in the root node:

build.gradle

 //if your target java version is 7 change to compiler7
    compileJava {
        options.compilerArgs = [
        "-processor",
                "compiler8.ast.RevDeBugProcessor",
                "-ArecordServerAddress=[SERVER_ADDRESS]",
                "-ArecordServerPort=42734",
                "-ArecordingMode=CrashRecorder",
                "-AapplicationName=[APP_NAME]",
                "-AsolutionName=[PROJECT_NAME]",
                "-ArepositoryPath=[STORAGE_PATH]",
                "-AuploadMetadata=true"
    ]} 
    

There are seven customizable fields in RevDeBug DevOps Monitor connection section:

  • ArecordServerAddress:

    Here you have to enter your recording servers IP address or hostname (If you’re using Docker use the Ifconfig command to get the IP address)

  • ArecordServerPort:42734

    Default port to connect to RevDeBug DevOps Monitor.

  • ArecordingMode:

    RevDeBug offers two ways to record your applications:

    • CrashRecorder - records only a set amount of steps back (1.000 by default) and the bug itself. This mode is very light and fits well for production use.
    • LiveRecorder - records everything that has occurred in the application including every line of code executed, every variable value, every exception and the performance data. This mode is suggested to be used only locally in the testing environment.
  • AapplicationName:

    Here you have to enter your application name.

  • AsolutionName:

    Here you have to enter your working java directory name.

  • ArepositoryPath:

    Path to your RevDeBug recordings directory.

  • AuploadMetadata:

    This option allows you to see recordings in RevDeBug DevOps Monitor