2014-04-14 84 views
0

我試圖使用生成的詹金斯愛瑪代碼覆蓋率報告,但它是失敗的愛瑪代碼覆蓋率不創建報告

版本是成功的。只有emma報告失敗。

這裏是我的pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>ThinClientManager</groupId> 
    <artifactId>ThinClientManager</artifactId> 
    <version>0.0.1-SNAPSHOT</version> 
    <name>ThinClientManager</name> 
    <properties> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
     <included.packages>-Dincluded.packages=hob.tcm</included.packages> 
     <included.adapters>-Dincluded.adapters=coverage,complexity,dependency</included.adapters> 
    </properties> 
    <build> 
     <sourceDirectory>src</sourceDirectory> 
     <resources> 
      <resource> 
       <directory>src</directory> 
       <excludes> 
        <exclude>**/*.java</exclude> 
       </excludes> 
      </resource> 
     </resources> 
     <pluginManagement> 
      <plugins> 
       <plugin> 
        <artifactId>maven-compiler-plugin</artifactId> 
        <version>3.1</version> 
        <configuration> 
         <source /> 
         <target /> 
        </configuration> 
       </plugin> 
       <plugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-surefire-plugin</artifactId> 
        <inherited>true</inherited> 
        <configuration> 
         <forkMode>once</forkMode> 
         <argLine>-javaagent:serenity/serenity.jar -Xms512m -Xmx1024m ${included.packages} ${included.adapters}</argLine> 
        </configuration> 
       </plugin> 
      </plugins> 
     </pluginManagement> 
    </build> 

    <reporting> 
     <plugins> 
      <plugin> 
       <groupId>org.codehaus.mojo</groupId> 
       <artifactId>emma-maven-plugin</artifactId> 
       <version>1.0-alpha-3</version> 
       <inherited>true</inherited> 
      </plugin> 
      <plugin> 
       <groupId>org.codehaus.mojo</groupId> 
       <artifactId>surefire-report-maven-plugin</artifactId> 
       <inherited>true</inherited> 
      </plugin> 
     </plugins> 
    </reporting> 


    <repositories> 
     <!--other repositories if any --> 
     <repository> 
      <id>project.local</id> 
      <name>project</name> 
      <url>file:${project.basedir}/repo</url> 
     </repository> 
    </repositories> 



    <dependencies> 
     <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
      <version>4.4</version> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.example</groupId> 
      <artifactId>ant</artifactId> 
      <version>1.0</version> 
     </dependency> 
     <dependency> 
      <groupId>com.example</groupId> 
      <artifactId>EAAdmin</artifactId> 
      <version>1.0</version> 
     </dependency> 
     <dependency> 
      <groupId>com.example</groupId> 
      <artifactId>hlset</artifactId> 
      <version>1.0</version> 
     </dependency> 
     <dependency> 
      <groupId>com.example</groupId> 
      <artifactId>hlsetutil</artifactId> 
      <version>1.0</version> 
     </dependency> 
     <dependency> 
      <groupId>com.example</groupId> 
      <artifactId>tool</artifactId> 
      <version>1.0</version> 
     </dependency> 
     <dependency> 
      <groupId>com.example</groupId> 
      <artifactId>xstream</artifactId> 
      <version>1.0</version> 
     </dependency> 
    </dependencies> 
</project> 

這裏是我的輸出

[INFO] Scanning for projects... 
[INFO] Searching repository for plugin with prefix: 'emma'. 
[INFO] ------------------------------------------------------------------------ 
[INFO] Building ThinClientManager 
[INFO] task-segment: [emma:emma] 
[INFO] ------------------------------------------------------------------------ 
[INFO] Preparing emma:emma 
[INFO] [resources:resources {execution: default-resources}] 
[INFO] Using 'UTF-8' encoding to copy filtered resources. 
[INFO] Copying 15 resources 
[INFO] [compiler:compile {execution: default-compile}] 
[INFO] Nothing to compile - all classes are up to date 
[INFO] [emma:instrument {execution: default-instrument}] 
[INFO] Instrumenting classes with EMMA 
processing instrumentation path ... 
ERROR: Could not find local repository for 2.2.1 
[INFO] ------------------------------------------------------------------------ 
[ERROR] FATAL ERROR 
[INFO] ------------------------------------------------------------------------ 
[INFO] com.vladium.emma.EMMARuntimeException 
/usr/share/tomcat6/.jenkins/jobs/Workplace Job System (Maven)/workspace/target/generated-classes/emma/classes/hob/props/.svn/prop-base/log.properties.svn-base (Permission denied) 
[INFO] ------------------------------------------------------------------------ 
[INFO] Trace 
com.vladium.emma.EMMARuntimeException: com.vladium.emma.EMMARuntimeException 
    at com.vladium.emma.instr.InstrProcessorST.handleFile(InstrProcessorST.java:567) 
    at com.vladium.util.IPathEnumerator$Factory$PathEnumerator.enumeratePathDir(IPathEnumerator.java:193) 
    at com.vladium.util.IPathEnumerator$Factory$PathEnumerator.enumeratePathDir(IPathEnumerator.java:177) 
    at com.vladium.util.IPathEnumerator$Factory$PathEnumerator.enumeratePathDir(IPathEnumerator.java:177) 
    at com.vladium.util.IPathEnumerator$Factory$PathEnumerator.enumeratePathDir(IPathEnumerator.java:177) 
    at com.vladium.util.IPathEnumerator$Factory$PathEnumerator.enumeratePathDir(IPathEnumerator.java:177) 
    at com.vladium.util.IPathEnumerator$Factory$PathEnumerator.enumeratePathDir(IPathEnumerator.java:177) 
    at com.vladium.util.IPathEnumerator$Factory$PathEnumerator.enumerate(IPathEnumerator.java:97) 
    at com.vladium.emma.instr.InstrProcessorST._run(InstrProcessorST.java:715) 
    at com.vladium.emma.Processor.run(Processor.java:88) 
    at org.codehaus.mojo.emma.task.InstrumentTask.execute(InstrumentTask.java:106) 
    at org.codehaus.mojo.emma.EmmaInstrumentMojo.doExecute(EmmaInstrumentMojo.java:158) 
    at org.codehaus.mojo.emma.AbstractEmmaMojo.execute(AbstractEmmaMojo.java:98) 
    at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490) 
    at hudson.maven.agent.PluginManagerInterceptor.executeMojo(PluginManagerInterceptor.java:182) 
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694) 
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556) 
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecycle(DefaultLifecycleExecutor.java:1205) 
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle(DefaultLifecycleExecutor.java:1038) 
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:643) 
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569) 
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539) 
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387) 
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348) 
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180) 
    at org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExecutorInterceptor.java:65) 
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) 
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) 
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:622) 
    at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) 
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) 
    at hudson.maven.agent.Main.launch(Main.java:205) 
    at hudson.maven.MavenBuilder.call(MavenBuilder.java:154) 
    at hudson.maven.Maven2Builder.call(Maven2Builder.java:79) 
    at hudson.maven.Maven2Builder.call(Maven2Builder.java:55) 
    at hudson.remoting.UserRequest.perform(UserRequest.java:118) 
    at hudson.remoting.UserRequest.perform(UserRequest.java:48) 
    at hudson.remoting.Request$2.run(Request.java:328) 
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) 
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) 
    at java.util.concurrent.FutureTask.run(FutureTask.java:166) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
    at java.lang.Thread.run(Thread.java:701) 
Caused by: java.io.FileNotFoundException: /usr/share/tomcat6/.jenkins/jobs/Workplace Job System (Maven)/workspace/target/generated-classes/emma/classes/hob/props/.svn/prop-base/log.properties.svn-base (Permission denied) 
    at java.io.RandomAccessFile.open(Native Method) 
    at java.io.RandomAccessFile.<init>(RandomAccessFile.java:236) 
    at com.vladium.emma.instr.InstrProcessorST.writeFile(InstrProcessorST.java:815) 
    at com.vladium.emma.instr.InstrProcessorST$FileWriteJob.run(InstrProcessorST.java:882) 
    at com.vladium.emma.instr.InstrProcessorST.drainJobQueue(InstrProcessorST.java:943) 
    at com.vladium.emma.instr.InstrProcessorST.addJob(InstrProcessorST.java:929) 
    at com.vladium.emma.instr.InstrProcessorST.handleFile(InstrProcessorST.java:562) 
    ... 47 more 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 7 seconds 
[INFO] Finished at: Mon Apr 14 13:45:41 CEST 2014 
[INFO] Final Memory: 21M/50M 
[INFO] ------------------------------------------------------------------------ 
[JENKINS] Archiving /usr/share/tomcat6/.jenkins/jobs/Workplace Job System (Maven)/workspace/pom.xml to ThinClientManager/ThinClientManager/0.0.1-SNAPSHOT/ThinClientManager-0.0.1-SNAPSHOT.pom 
channel stopped 
Skipping Emma coverage report as mojo did not run. 
Finished: FAILURE 

我詹金斯配置如下:

構建

根POM - 的pom.xml

目標和選項 - emma:emma

我已經添加了「Record Emma Coverage Report」後製作操作,但它仍然是空的。 我沒有添加歸檔工件後構建操作。

回答

0

我想你在這裏有很多問題。我首先要說的是,不應該使用Serenity代碼覆蓋率和Emma,兩次提高字節碼絕不是一個好主意。請注意,我編寫了Serenity代碼覆蓋Jenkins插件。

從例外情況看,您使用root用戶啓動Tomcat,然後與其他用戶啓動,Jenkins無法訪問它想要的目錄。可能最好將整個目錄$ TOMCAT_INSTALL和〜/ .jenkins分配給要使用的用戶。然後再來一次。

乾杯, 邁克爾

+0

這是很老,我們報廢的一切,使用的Cobertura來代替。我會將你的答案標記爲答案,但是我不再有這樣的環境來測試它。 – mangusbrother

相關問題