title: My Jacoco report goal is not binding to the test phase
body: <p>The jacoco-ut.exec file is created in target/coverage-reports/jacoco-ut.exec but there is no site/ directory to be seen.</p>
  
  <p>Here is the Jacoco configuration:</p>
  
  <pre><code>  &lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
      &lt;version&gt;2.19.1&lt;/version&gt;
      &lt;configuration&gt;
        &lt;skipTests&gt;false&lt;/skipTests&gt;
        &lt;argLine&gt;${surefireArgLine}&lt;/argLine&gt;
        &lt;excludes&gt;
          &lt;exclude&gt;**/integration/*.java&lt;/exclude&gt;
        &lt;/excludes&gt;
      &lt;/configuration&gt;
    &lt;/plugin&gt;
    &lt;plugin&gt;
      &lt;groupId&gt;org.jacoco&lt;/groupId&gt;
      &lt;artifactId&gt;jacoco-maven-plugin&lt;/artifactId&gt;
      &lt;version&gt;0.7.6.201602180812&lt;/version&gt;
      &lt;configuration&gt;
        &lt;skip&gt;false&lt;/skip&gt;
        &lt;output&gt;file&lt;/output&gt;
        &lt;append&gt;true&lt;/append&gt;
      &lt;/configuration&gt;
      &lt;executions&gt;
        &lt;execution&gt;
          &lt;id&gt;pre-unit-test&lt;/id&gt;
          &lt;goals&gt;
            &lt;goal&gt;prepare-agent&lt;/goal&gt;
          &lt;/goals&gt;
          &lt;configuration&gt;
            &lt;destFile&gt;${project.build.directory}/coverage-reports/jacoco-ut.exec&lt;/destFile&gt;
            &lt;propertyName&gt;surefireArgLine&lt;/propertyName&gt;
          &lt;/configuration&gt;
        &lt;/execution&gt;
        &lt;execution&gt;
          &lt;id&gt;post-unit-test&lt;/id&gt;
          &lt;phase&gt;test&lt;/phase&gt;
          &lt;goals&gt;
            &lt;goal&gt;report&lt;/goal&gt;
          &lt;/goals&gt;
          &lt;configuration&gt;
            &lt;dataFile&gt;${project.build.directory}/coverage-reports/jacoco-ut.exec&lt;/dataFile&gt;
            &lt;outputDirectory&gt;${project.reporting.outputDirectory}/jacoco-ut&lt;/outputDirectory&gt;
          &lt;/configuration&gt;
        &lt;/execution&gt;
      &lt;/executions&gt;
    &lt;/plugin&gt;
  </code></pre>
  
  <p>Here is the console output:</p>
  
  <pre><code>[DEBUG] -----------------------------------------------------------------------
  [DEBUG] Goal:          org.jacoco:jacoco-maven-plugin:0.7.6.201602180812:prepare-agent (pre-unit-test)
  [DEBUG] Style:         Regular
  [DEBUG] Configuration: &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;configuration&gt;
    &lt;address&gt;${jacoco.address}&lt;/address&gt;
    &lt;append&gt;true&lt;/append&gt;
    &lt;classDumpDir&gt;${jacoco.classDumpDir}&lt;/classDumpDir&gt;
    &lt;destFile default-value="${project.build.directory}/jacoco.exec"&gt;/home/stephane/dev/java/projects/x/x/x/target/coverage-reports/jacoco-ut.exec&lt;/destFile&gt;
    &lt;dumpOnExit&gt;${jacoco.dumpOnExit}&lt;/dumpOnExit&gt;
    &lt;exclClassLoaders&gt;${jacoco.exclClassLoaders}&lt;/exclClassLoaders&gt;
    &lt;inclBootstrapClasses&gt;${jacoco.inclBootstrapClasses}&lt;/inclBootstrapClasses&gt;
    &lt;inclNoLocationClasses&gt;${jacoco.inclNoLocationClasses}&lt;/inclNoLocationClasses&gt;
    &lt;jmx&gt;${jacoco.jmx}&lt;/jmx&gt;
    &lt;output&gt;file&lt;/output&gt;
    &lt;pluginArtifactMap&gt;${plugin.artifactMap}&lt;/pluginArtifactMap&gt;
    &lt;port&gt;${jacoco.port}&lt;/port&gt;
    &lt;project&gt;${project}&lt;/project&gt;
    &lt;propertyName&gt;surefireArgLine&lt;/propertyName&gt;
    &lt;sessionId&gt;${jacoco.sessionId}&lt;/sessionId&gt;
    &lt;skip default-value="false"&gt;false&lt;/skip&gt;
  &lt;/configuration&gt;
  [DEBUG] -----------------------------------------------------------------------
  
  [DEBUG] -----------------------------------------------------------------------
  [DEBUG] Goal:          org.jacoco:jacoco-maven-plugin:0.7.6.201602180812:report (post-unit-test)
  [DEBUG] Style:         Regular
  [DEBUG] Configuration: &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;configuration&gt;
    &lt;dataFile default-value="${project.build.directory}/jacoco.exec"&gt;/home/stephane/dev/java/projects/x/x/x/target/coverage-reports/jacoco-ut.exec&lt;/dataFile&gt;
    &lt;outputDirectory default-value="${project.reporting.outputDirectory}/jacoco"&gt;/home/stephane/dev/java/projects/x/x/x/target/site/jacoco-ut&lt;/outputDirectory&gt;
    &lt;outputEncoding default-value="UTF-8"&gt;${project.reporting.outputEncoding}&lt;/outputEncoding&gt;
    &lt;project&gt;${project}&lt;/project&gt;
    &lt;skip default-value="false"&gt;false&lt;/skip&gt;
    &lt;sourceEncoding default-value="UTF-8"&gt;${project.build.sourceEncoding}&lt;/sourceEncoding&gt;
  &lt;/configuration&gt;
  [DEBUG] =======================================================================
  
  [INFO] --- jacoco-maven-plugin:0.7.6.201602180812:prepare-agent (pre-unit-test) @ x ---
  [DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=0, ConflictMarker.markTime=1, ConflictMarker.nodeCount=158, ConflictIdSorter.graphTime=0, ConflictIdSorter.topsortTime=0, ConflictIdSorter.conflictIdCount=47, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=4, ConflictResolver.conflictItemCount=108, DefaultDependencyCollector.collectTime=191, DefaultDependencyCollector.transformTime=5}
  [DEBUG] org.jacoco:jacoco-maven-plugin:jar:0.7.6.201602180812:
  
  [DEBUG]   Excluded: org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1
  [DEBUG]   Excluded: classworlds:classworlds:jar:1.1-alpha-2
  [DEBUG]   Excluded: org.apache.maven.wagon:wagon-provider-api:jar:1.0-alpha-6
  [DEBUG] Configuring mojo org.jacoco:jacoco-maven-plugin:0.7.6.201602180812:prepare-agent from plugin realm ClassRealm[plugin&gt;org.jacoco:jacoco-maven-plugin:0.7.6.201602180812, parent: sun.misc.Launcher$AppClassLoader@70dea4e]
  [DEBUG] Configuring mojo 'org.jacoco:jacoco-maven-plugin:0.7.6.201602180812:prepare-agent' with basic configurator --&gt;
  [DEBUG]   (f) append = true
  [DEBUG]   (f) destFile = /home/stephane/dev/java/projects/x/x/x/target/coverage-reports/jacoco-ut.exec
  [DEBUG]   (f) output = file
  [DEBUG]   (f) pluginArtifactMap = {org.jacoco:jacoco-maven-plugin=org.jacoco:jacoco-maven-plugin:maven-plugin:0.7.6.201602180812:, backport-util-concurrent:backport-util-concurrent=backport-util-concurrent:backport-util-concurrent:jar:3.1:compile, org.codehaus.plexus:plexus-interpolation=org.codehaus.plexus:plexus-interpolation:jar:1.11:compile, junit:junit=junit:junit:jar:4.8.2:compile, org.codehaus.plexus:plexus-utils=org.codehaus.plexus:plexus-utils:jar:1.5.6:compile, org.apache.maven.shared:file-management=org.apache.maven.shared:file-management:jar:1.2.1:compile, org.apache.maven.shared:maven-shared-io=org.apache.maven.shared:maven-shared-io:jar:1.1:compile, org.apache.maven.reporting:maven-reporting-api=org.apache.maven.reporting:maven-reporting-api:jar:2.2.1:compile, org.apache.maven.doxia:doxia-sink-api=org.apache.maven.doxia:doxia-sink-api:jar:1.1:compile, org.apache.maven.doxia:doxia-logging-api=org.apache.maven.doxia:doxia-logging-api:jar:1.1:compile, org.apache.maven.reporting:maven-reporting-impl=org.apache.maven.reporting:maven-reporting-impl:jar:2.1:compile, org.apache.maven.doxia:doxia-core=org.apache.maven.doxia:doxia-core:jar:1.1.2:compile, xerces:xercesImpl=xerces:xercesImpl:jar:2.8.1:compile, commons-lang:commons-lang=commons-lang:commons-lang:jar:2.4:compile, commons-httpclient:commons-httpclient=commons-httpclient:commons-httpclient:jar:3.1:compile, commons-codec:commons-codec=commons-codec:commons-codec:jar:1.2:compile, org.apache.maven.doxia:doxia-site-renderer=org.apache.maven.doxia:doxia-site-renderer:jar:1.1.2:compile, org.apache.maven.doxia:doxia-decoration-model=org.apache.maven.doxia:doxia-decoration-model:jar:1.1.2:compile, org.apache.maven.doxia:doxia-module-xhtml=org.apache.maven.doxia:doxia-module-xhtml:jar:1.1.2:compile, org.apache.maven.doxia:doxia-module-fml=org.apache.maven.doxia:doxia-module-fml:jar:1.1.2:compile, org.codehaus.plexus:plexus-i18n=org.codehaus.plexus:plexus-i18n:jar:1.0-beta-7:compile, org.codehaus.plexus:plexus-velocity=org.codehaus.plexus:plexus-velocity:jar:1.1.7:compile, org.apache.velocity:velocity=org.apache.velocity:velocity:jar:1.5:compile, commons-collections:commons-collections=commons-collections:commons-collections:jar:3.2:compile, commons-validator:commons-validator=commons-validator:commons-validator:jar:1.2.0:compile, commons-beanutils:commons-beanutils=commons-beanutils:commons-beanutils:jar:1.7.0:compile, commons-digester:commons-digester=commons-digester:commons-digester:jar:1.6:compile, commons-logging:commons-logging=commons-logging:commons-logging:jar:1.0.4:compile, oro:oro=oro:oro:jar:2.0.8:compile, xml-apis:xml-apis=xml-apis:xml-apis:jar:1.0.b2:compile, org.jacoco:org.jacoco.agent=org.jacoco:org.jacoco.agent:jar:runtime:0.7.6.201602180812:compile, org.jacoco:org.jacoco.core=org.jacoco:org.jacoco.core:jar:0.7.6.201602180812:compile, org.ow2.asm:asm-debug-all=org.ow2.asm:asm-debug-all:jar:5.0.4:compile, org.jacoco:org.jacoco.report=org.jacoco:org.jacoco.report:jar:0.7.6.201602180812:compile}
  [DEBUG]   (f) project = MavenProject: com.x:3.2.1 @ /home/stephane/dev/java/projects/x/x/x/pom.xml
  [DEBUG]   (f) propertyName = surefireArgLine
  [DEBUG]   (f) skip = false
  [DEBUG] -- end configuration --
  [INFO] surefireArgLine set to -javaagent:/home/stephane/.m2/repository/org/jacoco/org.jacoco.agent/0.7.6.201602180812/org.jacoco.agent-0.7.6.201602180812-runtime.jar=destfile=/home/stephane/dev/java/projects/x/x/x/target/coverage-reports/jacoco-ut.exec,append=true,output=file
  </code></pre>
  
  <p>And that's all.</p>
  
  <p>UPDATE: I ran the following command: mvn jacoco:report -X
  and it said something interesting:</p>
  
  <pre><code>[DEBUG]   (f) dataFile = /home/stephane/dev/java/projects/x/x/x/target/jacoco.exec
  [DEBUG]   (f) outputDirectory = /home/stephane/dev/java/projects/x/x/x/target/site/jacoco
  [DEBUG]   (f) outputEncoding = UTF-8
  [DEBUG]   (f) project = MavenProject: com.x:3.2.1 @ /home/stephane/dev/java/projects/x/x/x/pom.xml
  [DEBUG]   (f) skip = false
  [DEBUG]   (f) sourceEncoding = UTF-8
  [DEBUG] -- end configuration --
  [INFO] Skipping JaCoCo execution due to missing execution data file:/home/stephane/dev/java/projects/x/x/x/target/jacoco.exec
  </code></pre>
  
  <p>It is looking up for a jacoco.exec file when I had it create a jacoco-ut.exec file.</p>
  
  <p>This is a bit surprising since the file was created:</p>
  
  <pre><code>$ ll target/coverage-reports/jacoco-ut.exec 
  -rw-rw-r-- 1 stephane 2.9M Mar 29 09:47 target/coverage-reports/jacoco-ut.exec
  </code></pre>
  
  <p>I guess I need to specify that file name in the report configuration somewhere.</p>
  
  <p>UPDATE: After moving the destFile and dataFile configuration above in the Jacoco configuration, the issue was resolved and the report generated in the site/ directory.</p>
  
  <p>The full plugin now looks like:</p>
  
  <pre><code>  &lt;plugin&gt;
      &lt;groupId&gt;org.jacoco&lt;/groupId&gt;
      &lt;artifactId&gt;jacoco-maven-plugin&lt;/artifactId&gt;
      &lt;version&gt;0.7.6.201602180812&lt;/version&gt;
      &lt;configuration&gt;
        &lt;destFile&gt;${project.build.directory}/coverage-reports/jacoco-ut.exec&lt;/destFile&gt;
        &lt;dataFile&gt;${project.build.directory}/coverage-reports/jacoco-ut.exec&lt;/dataFile&gt;
        &lt;skip&gt;${skipTests}&lt;/skip&gt;
        &lt;output&gt;file&lt;/output&gt;
        &lt;append&gt;true&lt;/append&gt;
      &lt;/configuration&gt;
      &lt;executions&gt;
        &lt;execution&gt;
          &lt;id&gt;pre-unit-test&lt;/id&gt;
          &lt;goals&gt;
            &lt;goal&gt;prepare-agent&lt;/goal&gt;
          &lt;/goals&gt;
          &lt;configuration&gt;
            &lt;propertyName&gt;surefireArgLine&lt;/propertyName&gt;
          &lt;/configuration&gt;
        &lt;/execution&gt;
        &lt;execution&gt;
          &lt;id&gt;post-unit-test&lt;/id&gt;
          &lt;phase&gt;test&lt;/phase&gt;
          &lt;goals&gt;
            &lt;goal&gt;report&lt;/goal&gt;
          &lt;/goals&gt;
          &lt;configuration&gt;
            &lt;outputDirectory&gt;${project.reporting.outputDirectory}/jacoco-ut&lt;/outputDirectory&gt;
          &lt;/configuration&gt;
        &lt;/execution&gt;
      &lt;/executions&gt;
    &lt;/plugin&gt;
  </code></pre>
  
  <p>Although the plugin is defined in the plugins element, and not in the pluginManagement element, to get the report I still need to execute the command:</p>
  
  <pre><code>mvn jacoco:report
  </code></pre>
  
  <p>I would like the report to be produced when running the command:</p>
  
  <pre><code>mvn clean install
  </code></pre>