Started by user zhangboyi Running as SYSTEM Building in workspace /var/lib/jenkins/workspace/maven_test2 The recommended git tool is: NONE No credentials specified > git rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository > git config remote.origin.url https://github.com/zhangboyi/maven_demo.git # timeout=10 Fetching upstream changes from https://github.com/zhangboyi/maven_demo.git > git --version # timeout=10 > git --version # 'git version 2.7.4' > git fetch --tags --progress https://github.com/zhangboyi/maven_demo.git +refs/heads/*:refs/remotes/origin/* # timeout=10 > git rev-parse refs/remotes/origin/test^{commit} # timeout=10 Checking out Revision dbf6906123ce969f2e12f014a19419a4f3b39b69 (refs/remotes/origin/test) > git config core.sparsecheckout # timeout=10 > git checkout -f dbf6906123ce969f2e12f014a19419a4f3b39b69 # timeout=10 Commit message: "update" > git rev-list --no-walk dbf6906123ce969f2e12f014a19419a4f3b39b69 # timeout=10 [maven_test2] $ /bin/sh -xe /tmp/jenkins2058903182559249478.sh + java -version Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 java version "1.8.0_121" Java(TM) SE Runtime Environment (build 1.8.0_121-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode) + ant -version Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 Apache Ant(TM) version 1.10.8 compiled on May 10 2020 + mvn test Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 [INFO] Scanning for projects... [INFO] [INFO] -----------------------< org.example:maven_demo >----------------------- [INFO] Building maven_demo 1.0-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ maven_demo --- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] Copying 2 resources [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ maven_demo --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ maven_demo --- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory /var/lib/jenkins/workspace/maven_test2/src/test/resources [INFO] [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ maven_demo --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ maven_demo --- [INFO] Surefire report directory: /var/lib/jenkins/workspace/maven_test2/target/surefire-reports
------------------------------------------------------- T E S T S ------------------------------------------------------- Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 Running com.example.boyi.TestMaximun Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.013 sec Running com.example.boyi.HelloWorldTest Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec Results : Tests run: 5, Failures: 0, Errors: 0, Skipped: 0 [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.259 s [INFO] Finished at: 2020-11-03T17:51:47+08:00 [INFO] ------------------------------------------------------------------------ + ant rebuild -buildfile /var/lib/jenkins/workspace/maven_test2/builds.xml Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 Buildfile: /var/lib/jenkins/workspace/maven_test2/builds.xml compile: dump: [jacoco:dump] Connecting to /[ip]-->hide [jacoco:dump] Dumping execution data to /var/lib/jenkins/workspace/maven_test2/jacoco-integration.exec rebuild: BUILD SUCCESSFUL Total time: 0 seconds [JaCoCo plugin] Collecting JaCoCo coverage data... [JaCoCo plugin] **/**.exec;**/classes;**/src/main/java; locations are configured [JaCoCo plugin] Number of found exec files for pattern **/**.exec: 1 [JaCoCo plugin] Saving matched execfiles: /var/lib/jenkins/workspace/maven_test2/jacoco-integration.exec [JaCoCo plugin] Saving matched class directories for class-pattern: **/classes: [JaCoCo plugin] - /var/lib/jenkins/workspace/maven_test2/target/classes 2 files [JaCoCo plugin] Saving matched source directories for source-pattern: **/src/main/java: [JaCoCo plugin] Source Inclusions: **/*.java,**/*.groovy,**/*.kt,**/*.kts [JaCoCo plugin] Source Exclusions: [JaCoCo plugin] - /var/lib/jenkins/workspace/maven_test2/src/main/java 2 files [JaCoCo plugin] Loading inclusions files.. [JaCoCo plugin] inclusions: [] [JaCoCo plugin] exclusions: [] [JaCoCo plugin] Thresholds: JacocoHealthReportThresholds [minClass=0, maxClass=0, minMethod=0, maxMethod=0, minLine=0, maxLine=0, minBranch=0, maxBranch=0, minInstruction=0, maxInstruction=0, minComplexity=0, maxComplexity=0] [JaCoCo plugin] Publishing the results.. [JaCoCo plugin] Loading packages.. [JaCoCo plugin] Done. [JaCoCo plugin] Overall coverage: class: 0, method: 0, line: 0, branch: 0, instruction: 0, complexity: 0 Finished: SUCCESS 在2020年10月29日星期四 UTC+8 下午4:11:37<Boyi Zhang> 写道: > https://github.com/zhangboyi/maven_demo/tree/test > > I have met the following conditions: > > The JaCoCo Ant tasks require > > - Ant 1.7.0 or higher and > - Java 1.5 or higher (for both, the Ant runner and the test executor). > > > Looking forward to your reply. thanks. > > > 在2020年10月29日星期四 UTC+8 下午4:08:18<Boyi Zhang> 写道: > >> yes,I know. This way you can output the correct result. >> but, I do it this way for ”ant task“, resulting in a coverage of 0. >> build.xml is in >> https://github.com/zhangboyi/maven_demo/blob/master/src/main/resources/build.xml >> . >> >> >> 在2020年10月9日星期五 UTC+8 下午9:38:52<Evgeny Mandrikov> 写道: >> >>> And also for your information >>> JaCoCo version 0.7.5 that you use ( >>> https://github.com/zhangboyi/maven_demo/blob/494ee90cacd693c3a4a15d323bf709241d1da801/pom.xml#L11 >>> >>> ) >>> is 5 years old >>> and does not support latest Java versions. >>> Please use latest JaCoCo version. >>> >>> >>> On Friday, October 9, 2020 at 3:20:24 PM UTC+2 Evgeny Mandrikov wrote: >>> >>>> After >>>> >>>> git clone https://github.com/zhangboyi/maven_demo.git >>>> cd maven_demo >>>> >>>> and checkout of the latest as of now commit >>>> >>>> git checkout 494ee90cacd693c3a4a15d323bf709241d1da801 >>>> >>>> and uncommenting jacoco-maven-plugin in pom.xml >>>> >>>> execution of >>>> >>>> mvn verify >>>> >>>> produces definitely not zeros as you can see below >>>> >>>> >>>> [image: maven_demo.png] >>>> >>>> On Friday, October 9, 2020 at 5:05:40 AM UTC+2 [email protected] >>>> wrote: >>>> >>>>> >>>>> https://github.com/zhangboyi/maven_demo.git >>>>> 在2020年10月9日星期五 UTC+8 上午11:02:33<Boyi Zhang> 写道: >>>>> >>>>>> Jacoco analyzed the unit test classes as if they were normal classes, >>>>>> resulting in a coverage of 0.(jacoco把单元测试类也当做普通类来分析,导致覆盖率为0。) >>>>> >>>>> -- 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/8a0b3591-c280-40e5-9515-7e4ae492d97en%40googlegroups.com.
