[ 
https://issues.apache.org/jira/browse/SUREFIRE-1273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15430917#comment-15430917
 ] 

Tibor Digana commented on SUREFIRE-1273:
----------------------------------------

We use Jenkins, therefore such profile.
The plugin management specifies versions.
build/plugins specify all plugins and their configuration used by default build 
life cycle.
The JaCoCo plugin does not specify phase.

Your POM should look like this in principle.

{code:xml}
<build>
  <pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.7.7.201606060606</version>
      </plugin>
      <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.19.1</version>
      </plugin>
    </plugins>
  </pluginManagement>
    <plugins>
      <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
                  <!-- some other configuration parameters here -->
            </configuration>
      </plugin>
    </plugins>
</build>
<profile>
      <id>jenkins</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>jacoco-agent</id>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
                <configuration>
                  <propertyName>jacoco.agent</propertyName>
                </configuration>
              </execution>
            </executions>
          </plugin>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <configuration>
            <argLine>${jacoco.agent}</argLine>
          </configuration>
        </plugin>
        </plugins>
      </build>
    </profile>
{code}

> Adding plugin inside Maven profile breaks mvn:build on project
> --------------------------------------------------------------
>
>                 Key: SUREFIRE-1273
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1273
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Maven Surefire Plugin
>    Affects Versions: 2.19.1
>         Environment: Windows 10 x64 Professional version 6.3
> Netbeans 8.1 Release
> Maven v3.0.5
> OracleJDKx64 v1.8.0_11
>            Reporter: Jodi
>              Labels: newbie, windows
>         Attachments: pom-jacoco.xml, pom.xml, 
> surefire-plugin-success-jacoco.log, surefire-profiles-error.log
>
>
> ##Conditions which led to the issue
> Prior to the issue occurring, jacoco-maven-plugin OR maven-surefire-plugin 
> failed to work consistently when using docker-maven-plugin, this is an issue 
> which is to be followed up next.
> ##Maven configuration
> After: 
> 1. Opening a project POM which hasn't yet been migrated to docker
> 2. Disabling jacoco-maven-plugin
> 3. Moving maven-surefire-plugin to a "test" profile
> 4. Setting plugin version to 2.19.1 in POM
> 5. Switching to "test" profile
> 6. Run mvn:build from Netbeans
> ##Outcome
> maven-surefire-plugin fails during a normal build command - see attachments



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to