> For the complete documentation index, see [llms.txt](https://cover-docs.diffblue.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cover-docs.diffblue.com/features/cover-cli/project-configuration/configuring-cover-to-work-with-your-projects-build-system/default-configuration.md).

# Default configuration

By default, Cover uses its own internal configuration to interact with your project's build system. Currently, Cover supports Maven and Gradle automatically, and provides a sample configuration for Ant that you will need to customize to suit your project. You can retrieve this default configuration and use it as a starting point for defining your own `DiffblueBuild.yaml` file that then overrides the default behaviour.

## Default Maven configuration

For the latest version of this configuration (including comments describing the content, which are omitted here for brevity), run `dcover build-default-config --maven`.

{% code title="DiffblueBuild.yaml" fullWidth="true" %}

```yaml
meta:
  version: 3.2
  toolName: maven

cmd:
  windows:
    - mvnw.cmd
    - mvn.cmd
  linux:
    - mvnw
    - mvn
  macos:
    - mvnw
    - mvn
global:
  flags:
    - -Dmaven.ext.class.path=${DIFFBLUE_MAVEN_SPY_JAR}
    - -Dcom.diffblue.cover.skipTests=true
    - --batch-mode
    - --projects=${MODULE}
    - --settings=${DIFFBLUE_MAVEN_USER_SETTINGS}
    - --global-settings=${DIFFBLUE_MAVEN_GLOBAL_SETTINGS}

  timeout: PT10M

  plugins:
    - name: com.mycila:license-maven-plugin
      disable: disable
      enable: format
      flags: ~
      goals:
        - name: format
          goal: format
          flags: ~
        - name: disable
          goal: ~
          flags:
            - -Dlicense.skip=true

    - name: com.diffplug.spotless:spotless-maven-plugin
      disable: disable
      enable: apply
      flags: ~
      goals:
        - name: apply
          goal: apply
          flags:
            - -DspotlessFiles=${DIFFBLUE_TEST_FILE_REGEX_PATTERN}
        - name: disable
          goal: ~
          flags:
            - -Dspotless.check.skip=true

    - name: org.apache.maven.plugins:maven-checkstyle-plugin
      disable: disable
      enable: check
      flags: ~
      goals:
        - name: check
          goal: checkstyle::check
          flags:
            - -Dcheckstyle.failOnViolation=false
        - name: disable
          goal: ~
          flags:
            - -Dcheckstyle.skip=true

    - name: io.spring.javaformat:spring-javaformat-maven-plugin
      disable: disable
      enable: apply
      flags: ~
      goals:
        - name: apply
          goal: spring-javaformat:apply
          flags: ~
        - name: disable
          goal: ~
          flags:
            - -Dspring-javaformat.skip=true

phase:
  info:
    goals:
      - name: ~
        goal: validate
        flags:
          - --also-make

  classpath:
    goals:
      - name: ~
        goal: dependency:build-classpath

  launcher: ~

  clean:
    goals:
      - name: ~
        goal: clean
        flags:
          - --also-make

  build:
    goals:
      - name: ~
        goal: install
        flags:
          - -Dmaven.compiler.failOnWarning=false
          - --also-make
          - -DskipTests
          - -DskipITs
          - --threads=1C

  test:
    timeout: PT60M
    goals:
      - name: ~
        goal: test
        flags:
          - -DfailIfNoTests=false
          - -Dsurefire.failIfNoSpecifiedTests=false
          - -Dmaven.test.failure.ignore=True
          - ${DIFFBLUE_TEST_FILTER}
    filter:
      default: ~
      neverDiffblue:
        - -Dtest=!${DIFFBLUE_TEST_FILE_GLOB_PATTERN},**/Test*.java,**/*Test.java,**/*Tests.java,**/*TestCase.java
      neverDiffblueTag:
        - -Dtest=!${DIFFBLUE_TEST_FILE_GLOB_PATTERN},**/Test*.java,**/*Test.java,**/*Tests.java,**/*TestCase.java
        - -DexcludedGroups=MaintainedByDiffblue,ContributionFromDiffblue      
      onlyDiffblue:
        - -Dtest=${DIFFBLUE_TEST_FILE_GLOB_PATTERN}
      onlyDiffblueTag:
        - -Dtest=!${DIFFBLUE_TEST_FILE_GLOB_PATTERN},**/Test*.java,**/*Test.java,**/*Tests.java,**/*TestCase.java
        - -Dgroups=MaintainedByDiffblue,ContributionFromDiffblue      
      named:
        - -Dtest=${DIFFBLUE_TEST_FILE}

  coverage:
    timeout: PT60M
    goals:
      - name: org.jacoco:jacoco-maven-plugin
        goal: prepare-agent
        flags:
          - -Djacoco.skip=false

      - name: ~
        goal: test
        flags:
          - -DfailIfNoTests=false
          - -Dsurefire.failIfNoSpecifiedTests=false
          - -Dmaven.test.failure.ignore=True
          - ${DIFFBLUE_TEST_FILTER}

      - name: org.jacoco:jacoco-maven-plugin
        goal: report
        flags:
          - -Djacoco.skip=false
    filter:
      default: ~
      neverDiffblue:
        - -Dtest=!${DIFFBLUE_TEST_FILE_GLOB_PATTERN},**/Test*.java,**/*Test.java,**/*Tests.java,**/*TestCase.java
      neverDiffblueTag:
        - -Dtest=!${DIFFBLUE_TEST_FILE_GLOB_PATTERN},**/Test*.java,**/*Test.java,**/*Tests.java,**/*TestCase.java
        - -DexcludedGroups=MaintainedByDiffblue,ContributionFromDiffblue      
      onlyDiffblue:
        - -Dtest=${DIFFBLUE_TEST_FILE_GLOB_PATTERN}
      onlyDiffblueTag:
        - -Dtest=!${DIFFBLUE_TEST_FILE_GLOB_PATTERN},**/Test*.java,**/*Test.java,**/*Tests.java,**/*TestCase.java
        - -Dgroups=MaintainedByDiffblue,ContributionFromDiffblue      
      named:
        - -Dtest=${DIFFBLUE_TEST_FILE}

  refactor:
    timeout: PT30M
    goals:
      - name: ~
        goal: install:install-file
        once: true
        flags:
          - -Dfile=${DIFFBLUE_COVER_REFACTORING_RECIPES_JAR}
          - -DgroupId=${DIFFBLUE_COVER_REFACTORING_RECIPES_GROUP_ID}
          - -DartifactId=${DIFFBLUE_COVER_REFACTORING_RECIPES_ARTIFACT_ID}
          - -Dversion=${DIFFBLUE_COVER_REFACTORING_RECIPES_VERSION}
          - -Dpackaging=jar
      - name: ~
        goal: install:install-file
        once: true
        flags:
          - -Dfile=${DIFFBLUE_OPEN_REWRITE_JAR}
          - -DgroupId=${DIFFBLUE_OPEN_REWRITE_GROUP_ID}
          - -DartifactId=${DIFFBLUE_OPEN_REWRITE_ARTIFACT_ID}
          - -Dversion=${DIFFBLUE_OPEN_REWRITE_VERSION}
          - -Dpackaging=jar
      - name: ~
        goal: install:install-file
        once: true
        flags:
          - -Dfile=${DIFFBLUE_OPEN_REWRITE_POM}
          - -DgroupId=${DIFFBLUE_OPEN_REWRITE_GROUP_ID}
          - -DartifactId=${DIFFBLUE_OPEN_REWRITE_ARTIFACT_ID}
          - -Dversion=${DIFFBLUE_OPEN_REWRITE_VERSION}
          - -Dpackaging=pom
      - name: org.openrewrite.maven:rewrite-maven-plugin
        goal: run
        flags:
          - -Drewrite.activeRecipes=com.diffblue.cover.refactoring.Recipe
          - -Drewrite.activeStyles=org.openrewrite.java.Autodetect
          - -Drewrite.configLocation=${DIFFBLUE_REWRITE_CONFIG}

  validate:
    timeout: PT60M
    goals:
      - name: ~
        goal: install
        flags:
          - --also-make
```

{% endcode %}

## Default Gradle configuration

For the latest version of this configuration (including comments describing the content, which are omitted here for brevity), run `dcover build-default-config --gradle`.

{% code title="DiffblueBuild.yaml" fullWidth="true" %}

```yaml
meta:
  version: 3.2
  toolName: gradle

cmd:
  windows:
    - ./gradlew.bat
    - ./gradlew
    - gradle.bat
    - gradle
  linux:
    - ./gradlew
    - gradle
  macos:
    - ./gradlew
    - gradle

global:
  flags:
    - --init-script=${DIFFBLUE_GRADLE_INIT_SCRIPT}
    - --info
    - --console=plain
    - -PskipTestOptimizer=true
    - -Dcom.diffblue.cover.buildsystem.gradle.model-jar=${DIFFBLUE_GRADLE_SPY_JAR}
    - --no-daemon

  timeout: PT10M

  plugins:
    - name: io.spring.javaformat.gradle.SpringJavaFormatPlugin
      disable: disable
      enable: format
      flags: ~
      goals:
        - name: format
          goal: ${MODULE_PATH}format
          flags: ~
        - name: disable
          goal: ~
          flags:
            - -Pspring-javaformat.skip=true

phase:

  info: ~
  
  classpath: ~  

  launcher:
    timeout: PT30S
    goals:
      - name: ~
        goal: downloadDependencies
        flags:
          - --
          - --groupId=${DIFFBLUE_GROUP_ID}
          - --artifactId=${DIFFBLUE_ARTIFACT_ID}
          - --version=${DIFFBLUE_VERSION}

  clean:
    goals:
      - name: ~
        goal: ${MODULE_PATH}clean

  build:
    goals:
      - name: ~
        goal: ${MODULE_PATH}assemble
      - name: ~
        goal: ${MODULE_PATH}testClasses

  test:
    timeout: PT60M
    goals:
      - name: ~
        goal: ${MODULE_PATH}test
        flags:
          - ${DIFFBLUE_TEST_FILTER}
    filter:
      default: ~
      neverDiffblue:
        - -PexcludeTests=${DIFFBLUE_TEST_CLASS_GLOB_PATTERN}
      neverDiffblueTag:
        - -PexcludeTests=${DIFFBLUE_TEST_CLASS_GLOB_PATTERN}
        - -PexcludeGroup=MaintainedByDiffblue        
      onlyDiffblue:
        - -PincludeTests=${DIFFBLUE_TEST_CLASS_GLOB_PATTERN}
      onlyDiffblueTag:
        - -PexcludeTests=${DIFFBLUE_TEST_CLASS_GLOB_PATTERN}
        - -PincludeGroup=MaintainedByDiffblue
      named:
        - --tests=${DIFFBLUE_TEST_CLASS}

  coverage:
    timeout: PT60M
    goals:
      - name: ~
        goal: ${MODULE_PATH}test
        flags:
          - -PignoreFailures=true
          - ${DIFFBLUE_TEST_FILTER}
      - name: ~
        goal: ${MODULE_PATH}jacocoTestReport
    filter:
      default: ~
      neverDiffblue:
        - -PexcludeTests=${DIFFBLUE_TEST_CLASS_GLOB_PATTERN}
      neverDiffblueTag:
        - -PexcludeTests=${DIFFBLUE_TEST_CLASS_GLOB_PATTERN}
        - -PexcludeGroup=MaintainedByDiffblue,ContributionFromDiffblue
      onlyDiffblue:
        - -PincludeTests=${DIFFBLUE_TEST_CLASS_GLOB_PATTERN}
      onlyDiffblueTag:
        - -PexcludeTests=${DIFFBLUE_TEST_CLASS_GLOB_PATTERN}
        - -PincludeGroup=MaintainedByDiffblue,ContributionFromDiffblue
        - -PmergeCoverage=true
      named:
        - --tests=${DIFFBLUE_TEST_CLASS}


  refactor:
    timeout: PT50M
    goals:
      - name: ~
        goal: rewriteRun
        flags:
          - --init-script=${DIFFBLUE_COVER_REFACTORING_INIT_SCRIPT}
          - -DconfigFile=${DIFFBLUE_REWRITE_CONFIG}

  validate:
    timeout: PT60M
    goals:
      - name:
        goal: ${MODULE_PATH}build
      - name:
        goal: ${MODULE_PATH}check
```

{% endcode %}

## Default Ant configuration

For the latest version of this configuration (including comments describing the content, which are omitted here for brevity), run `dcover build-default-config --ant`.

{% code fullWidth="true" %}

```yaml
meta:
  version: 3.2
  toolName: ant

cmd:
  windows:
    - ant.cmd
    - ant.bat
    - ant
  linux:
    - ant
  macos:
    - ant
global:
  flags: 
    - -Dcover=true
  timeout: PT10M
  plugins: ~

phase:
  info:
    goals:
      - name: ~
        goal: info
        flags: ~
        
  classpath:
    goals:
      - name: ~
        goal: info
        flags: ~        
        
  launcher: ~
  
  clean:
    goals:
      - name: ~
        goal: clean
        flags: ~

  build:
    goals:
      - name: ~
        goal: compile
        flags: ~

  test:

    timeout: PT60M

    goals:
      - name: ~
        goal: test
        flags:
          - ${DIFFBLUE_TEST_FILTER}

    filter:
      default: ~
      neverDiffblue:
        - -Dtest.excludes=**/*DiffblueTest.*
      neverDiffblueTag:
        - -Dtest.excludes=**/*DiffblueTest.*
        - -Dtest.excludeTags=MaintainedByDiffblue,ContributionFromDiffblue
      onlyDiffblue:
        - -Dtest.includes=**/*DiffblueTest.*
      onlyDiffblueTag:
        - -Dtest.excludes=**/*DiffblueTest.*
        - -Dtest.includeTags=MaintainedByDiffblue,ContributionFromDiffblue
      named:
        - -Dtest.includes=**/${DIFFBLUE_TEST_FILE}.java

  coverage:
    timeout: PT60M
    goals:

      - name: ~
        goal: coverage-report
        flags:
          - ${DIFFBLUE_TEST_FILTER}

    filter:
      default: ~
      neverDiffblue:
        - -Dtest.excludes=**/*DiffblueTest.*
      neverDiffblueTag:
        - -Dtest.excludes=**/*DiffblueTest.*
        - -Dtest.excludeTags=MaintainedByDiffblue,ContributionFromDiffblue
      onlyDiffblue:
        - -Dtest.includes=**/*DiffblueTest.*
      onlyDiffblueTag:
        - -Dtest.excludes=**/*DiffblueTest.*
        - -Dtest.includeTags=MaintainedByDiffblue,ContributionFromDiffblue
      named:
        - -Dtest.includes=**/${DIFFBLUE_TEST_FILE}.java

  refactor: ~

  validate:
    timeout: PT60M
    goals:
      - name: ~
        goal: clean
        flags: ~

      - name: ~
        goal: test
        flags: ~

```

{% endcode %}
