$ {session.executionRootDirectory} not recognized by sonar-maven-plugin

I have several levels of Maven nested projects where each module can participate in global integration tests. To have global coverage with multiple modules, I configured jacoco to use and share the same file through modules using the Maven variable ${session.executionRootDirectory}:

<execution>
    <id>pre-integration-test</id>
    <phase>pre-integration-test</phase>
    <goals>
        <goal>prepare-agent-integration</goal>
    </goals>
    <configuration>
        <propertyName>jacoco.failsafeArgLine</propertyName>
        <destFile>${session.executionRootDirectory}/target/jacoco-it.exec</destFile>
    </configuration>
</execution>

Thus, the same data file is used by each module, regardless of how deeply it is embedded in the submodules. I checked that the correct data file is generated by jacoco when running "mvn clean install".

Now the problem occurs at startup mvn sonar:sonar. It seems that the plugin cannot replace this variable in a real way. In magazines

I see the following:
[INFO] JaCoCoItSensor: JaCoCo IT report not found: /home/tomcat/.jenkins/jobs/MYJOB/workspace/${session.executionRootDirectory}/target/jacoco-it.exec

@{session.executionRootDirectory}.

?

+4
1

SonarSource, :

<plugin>
    <groupId>com.github.goldin</groupId>
    <artifactId>properties-maven-plugin</artifactId>
    <version>0.2.5</version>
    <executions>
        <execution>
            <id>set-sonar.jacoco.reportPath</id>
            <goals>
                <goal>set-properties</goal>
            </goals>
            <phase>initialize</phase>
            <configuration>
                <rawProperties>
                    sonar.jacoco.itReportPath = ${session.executionRootDirectory}/target/jacoco-it.exec
                </rawProperties>
                <addDollar>true</addDollar>
            </configuration>
        </execution>
    </executions>
</plugin>

... , , Maven 3.1+, , Maven 3.2.3.

+1

All Articles