gpt4 book ai didi

java - Jenkins:EMMA 验证错误

转载 作者:太空宇宙 更新时间:2023-11-04 07:05:40 35 4
gpt4 key购买 nike

java.lang.VerifyError: Expecting a stackmap frame at branch target 11 in method
tests.FieldTest.<init>()V at offset 4
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)

有人有想法吗?

构建.xml

<?xml version="1.0" encoding="UTF-8"?>
<project name="TicTacToe" default="jar" basedir=".">

<property name="src.dir" value="${basedir}/src" />
<property name="src.dir.tests" value="${src.dir}/tests" />

<property name="lib.dir" value="${basedir}/lib" />
<property name="lib.dir.compile" value="${lib.dir}/compile" />
<property name="lib.dir.test" value="${lib.dir}/test" />

<property name="target.dir" value="${basedir}/target" />
<property name="target.dir.classes" value="${target.dir}/classes" />
<property name="target.dir.test.classes" value="${target.dir}/test-classes" />
<property name="target.dir.test.reports" value="${target.dir}/test-reports" />
<property name="target.dir.test.coverage" location="${target.dir}/coverage" />
<property name="target.dir.test.coverage.meta" location="${target.dir}/coverage/metadata" />
<property name="target.dir.test.instrumentation" location="${target.dir}/instr-classes" />
<property name="target.dir.doc" value="${target.dir}/doc" />

<path id="project.classpath">
<fileset dir="${lib.dir.compile}" includes="*.jar" />
</path>

<path id="path.classes.run">
<path refid="project.classpath" />
<path location="${target.dir.classes}" />
</path>

<path id="path.test.run">
<path refid="path.classes.run" />
<path location="target.dir.test.classes" />
</path>

<target name="clean">
<delete dir="${target.dir}" />
</target>

<target name="prepare">
<mkdir dir="${target.dir}" />
<mkdir dir="${target.dir.classes}" />
<mkdir dir="${target.dir.classes}" />
<mkdir dir="${target.dir.doc}" />
<mkdir dir="${target.dir.test.classes}" />
<mkdir dir="${target.dir.test.reports}" />
<mkdir dir="${target.dir.test.coverage}" />
<mkdir dir="${target.dir.test.coverage.meta}" />
<mkdir dir="${target.dir.test.instrumentation}" />
</target>

<target name="prebuild.classes">
<javac srcdir="${src.dir}" destdir="${target.dir.classes}" excludes="${src.dir.tests}" classpathref="project.classpath" includeantruntime="false" />
</target>

<target name="prebuild.test" depends="prebuild.classes">
<javac srcdir="${src.dir.tests}" destdir="${target.dir.test.classes}" classpathref="path.classes.run" includeantruntime="false" />
</target>

<property name="emma.dir" value="/home/tebbje/emma/lib" />
<property name="emma.enabled" value="true" />

<path id="emma.lib">
<pathelement location="${emma.dir}/emma.jar" />
<pathelement location="${emma.dir}/emma_ant.jar" />
</path>

<taskdef resource="emma_ant.properties" classpathref="emma.lib" />

<target name="reports" depends="prebuild.test">

<copy todir="${target.dir.test.instrumentation}">
<fileset dir="${target.dir.test.classes}" />
</copy>

<emma enabled="${emma.enabled}">
<instr instrpath="${target.dir.test.instrumentation}" metadatafile="${target.dir.test.coverage.meta}/metadata.emma" merge="true" mode="overwrite" />
</emma>

<junit printsummary="yes" fork="true" haltonfailure="no">
<classpath>
<pathelement location="${target.dir.test.coverage.instrumentation}" />
<pathelement location="${target.dir.test.classes}" />
<path refid="path.test.run" />

<path refid="emma.lib" />

</classpath>
<!--
<jvmarg value="-Demma.coverage.out.file=${target.dir.test.coverage.meta}/metadata.emma" />
<jvmarg value="-Demma.coverage.out.merge=true" />
//-->
<formatter type="xml" />
<formatter type="plain" />

<batchtest todir="${target.dir.test.reports}">
<fileset dir="${src.dir}">
<include name="**/*Test.java" />
</fileset>
</batchtest>
</junit>

<junitreport tofile="TESTS-TestSuites.xml" todir="${lib.dir.test}">
<fileset dir="${lib.dir.test}">
<include name="TEST-*.xml" />
</fileset>
<report format="frames" todir="${lib.dir.test}" />
</junitreport>
<!--
<emma enabled="${emma.enabled}">
<report sourcepath="${src.dir}">
<fileset dir="${target.dir.test.coverage.meta}">
<include name="*.emma" />
</fileset>
<txt outfile="./reports/coverage/coverage.txt" />
<html outfile="./reports/coverage/coverage.html" depth="class" />
</report>
</emma>
//-->
</target>

<target name="javadoc.generate">
<javadoc packagenames="*" sourcepath="${src.dir}" destdir="${target.dir.doc}" classpathref="project.classpath" />
</target>

<target name="javadoc" depends="javadoc.generate">
<jar destfile="${target.dir}/${ant.project.name}-javadoc.jar" basedir="${target.dir.doc}" />
</target>

<target name="sources">
<jar destfile="${target.dir}/${ant.project.name}-sources.jar" basedir="${src.dir}" />
</target>

<target name="jar">
<echo message="Project looks good! Deploy JAR..." />

<jar destfile="${target.dir}/${ant.project.name}.jar" basedir="${target.dir.classes}">
<manifest>
<attribute name="Main-Class" value="control.Control" />
</manifest>
<zipgroupfileset dir="./lib/compile" includes="**/*.jar" />
</jar>
</target>

</project>

最佳答案

为什么你使用 Emma 而不是 Jacoco? Jacoco 大部分都是开箱即用的,并且仍在开发中。我想艾玛不会再进一步​​了。

https://wiki.jenkins-ci.org/display/JENKINS/JaCoCo+Plugin

关于java - Jenkins:EMMA 验证错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21432476/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com