Hi,

trying to use jacoco with offline instrumentalization (because I need to use 
mocking with my tests.) Also using maven and surefire to run tests.

I have everything running so far that the following works:

            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>instrument</goal>
                            <goal>restore-instrumented-classes</goal>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

My tests get executed, the instrumentalization works, I get reports in 
target/site/jacoco, the reverting back to original classes works, because my 
app later runs without jacoco.jar ... fine.

Only:
The reports don't get linked into the site documentation.

So, when I remove the report goal from the above and configure a proper site 
report like this ...

            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco.version}</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>report</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>

... and run "mvn clean package site" ... then I get the following error:

Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.0:site 
(default-site) on project Monitoring: Error during page generation: Error 
rendering Maven report: Error while creating report: Error while analyzing 
C:\...\Monitoring\target\classes\a\b\c\LDAPAccessException.class. Class 
a/b/c/LDAPAccessException is already instrumented. -> [Help 1]


The output until it fails is the following ... and you can see that the site 
goal calls "instrument" again. How can I tell it not to, for the sake of my 
site reports and also the other reports which seem to be running on 
instrumented classes?

TIA,

K.





Scanning for projects...
                                                                        
------------------------------------------------------------------------
Building Monitoring 1.0-SNAPSHOT
------------------------------------------------------------------------

--- maven-clean-plugin:2.4.1:clean (default-clean) @ Monitoring ---

--- maven-resources-plugin:2.4.3:resources (default-resources) @ Monitoring ---
Using 'UTF-8' encoding to copy filtered resources.
Copying 3 resources

--- maven-compiler-plugin:2.0.2:compile (default-compile) @ Monitoring ---
Compiling 19 source files to C:\...\Monitoring\target\classes

--- jacoco-maven-plugin:0.7.9:instrument (default) @ Monitoring ---

--- maven-resources-plugin:2.4.3:testResources (default-testResources) @ 
Monitoring ---
Using 'UTF-8' encoding to copy filtered resources.
skip non existing resourceDirectory C:\...\Monitoring\src\test\resources

--- maven-compiler-plugin:2.0.2:testCompile (default-testCompile) @ Monitoring 
---
Compiling 1 source file to C:\...\Monitoring\target\test-classes

--- maven-surefire-plugin:2.20:test (default-test) @ Monitoring ---
file.encoding cannot be set as system property, use 
<argLine>-Dfile.encoding=...</argLine> instead

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running 
...
Tests run: 24, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.86 s - in ...

Results:

Tests run: 24, Failures: 0, Errors: 0, Skipped: 0


--- jacoco-maven-plugin:0.7.9:restore-instrumented-classes (default) @ 
Monitoring ---

--- maven-war-plugin:2.3:war (default-war) @ Monitoring ---
Packaging webapp
Assembling webapp [Monitoring] in 
[C:\...\Monitoring\target\Monitoring-1.0-SNAPSHOT]
Processing war project
Copying webapp webResources [C:\...\Monitoring/src/main/webapp/WEB-INF] to 
[C:\...\Monitoring\target\Monitoring-1.0-SNAPSHOT]
Copying webapp resources [C:\...\Monitoring\src\main\webapp]
Webapp assembled in [112 msecs]
Building war: C:\...\Monitoring\target\Monitoring-1.0-SNAPSHOT.war

--- maven-site-plugin:3.0:site (default-site) @ Monitoring ---
configuring report plugin org.jacoco:jacoco-maven-plugin:0.7.9
configuring report plugin org.apache.maven.plugins:maven-javadoc-plugin:2.9

>>> maven-javadoc-plugin:2.9:javadoc (report:javadoc) @ Monitoring >>>

<<< maven-javadoc-plugin:2.9:javadoc (report:javadoc) @ Monitoring <<<

>>> maven-javadoc-plugin:2.9:test-javadoc (report:test-javadoc) @ Monitoring >>>

--- maven-resources-plugin:2.4.3:resources (default-resources) @ Monitoring ---
Using 'UTF-8' encoding to copy filtered resources.
Copying 3 resources

--- maven-compiler-plugin:2.0.2:compile (default-compile) @ Monitoring ---
Nothing to compile - all classes are up to date

--- jacoco-maven-plugin:0.7.9:instrument (default) @ Monitoring ---

<<< maven-javadoc-plugin:2.9:test-javadoc (report:test-javadoc) @ Monitoring <<<
configuring report plugin org.codehaus.mojo:findbugs-maven-plugin:3.0.4
Fork Value is true
     [java] The following classes needed for analysis were missing:
     [java]   org.jacoco.agent.rt.internal_8ff85ea.Offline
     [java] Missing classes: 1
     [java] Jun 30, 2017 12:48:53 PM java.util.prefs.WindowsPreferences <init>
     [java] WARNUNG: Could not open/create prefs root node 
Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) 
returned error code 5.
Done FindBugs Analysis....
Report plugin org.apache.maven.plugins:maven-project-info-reports-plugin has an 
empty version.

It is highly recommended to fix these problems because they threaten the 
stability of your build.

For this reason, future Maven versions might no longer support building such 
malformed projects.
configuring report plugin 
org.apache.maven.plugins:maven-project-info-reports-plugin:2.9
Relativizing decoration links with respect to project URL: 
http://maven.apache.org
Rendering site with org.apache.maven.skins:maven-default-skin:jar:1.0 skin.
Generating "JaCoCo" report    --- jacoco-maven-plugin:0.7.9
Loading execution data file C:\...\Monitoring\target\jacoco.exec


-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/767771ac-cff8-4ba4-97c1-ef51f4dec360%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to