我面临以下问题,
[错误]无法执行目标org.apache.maven.plugins:maven-antrun-plugin:1.8:在项目VstsReport:发生Ant BuildException:创建报告时出错
[错误]蚂蚁部分周围……@8:11 in/__w/49/s/target/antrun/build-main.xml:分析myapp/target时出错/demo.war@WEB-INF/lib/lombok-1.16.22.jar@lombok/eclipse/agent/EclipseLoaderPatcherTransplants.SCL.lombok.无法添加具有相同名称的不同类:lombok/eclipse/agent/EclipseLoaderPatcherCransplants-
[ERROR]要查看错误的完整堆栈跟踪,请使用-e开关重新运行Maven。
[错误]使用-X开关重新运行Maven以启用完整的调试日志记录。
我已经尝试将该类从pom.xml中的Jacobo配置中排除,但仍然面临这个问题。
<排除>lombok/eclipse/agent/EclipseLoaderPatcherTransplants.class<排除>
我在gradle中遇到了同样的问题,您需要排除jar,如下所示。
使用--stacktrace选项运行gradle以获得更多日志输出。
Caused by: java.io.IOException: Error while analyzing profilecleaner-1.0.jar@BOOT-INF/lib/lombok-1.16.4.jar@lombok/eclipse/agent/EclipseLoaderPatcherTransplants.SCL.lombok with JaCoCo 0.8.8.202204050719/5dcf34a.
at org.jacoco.core.analysis.Analyzer.analyzerError(Analyzer.java:163)
at org.jacoco.core.analysis.Analyzer.analyzeClass(Analyzer.java:135)
at org.jacoco.core.analysis.Analyzer.analyzeClass(Analyzer.java:158)
at org.jacoco.core.analysis.Analyzer.analyzeAll(Analyzer.java:195)
at org.jacoco.core.analysis.Analyzer.analyzeZip(Analyzer.java:267)
at org.jacoco.core.analysis.Analyzer.analyzeAll(Analyzer.java:198)
at org.jacoco.core.analysis.Analyzer.analyzeZip(Analyzer.java:267)
at org.jacoco.core.analysis.Analyzer.analyzeAll(Analyzer.java:198)
at org.jacoco.ant.ReportTask.createBundle(ReportTask.java:573)
at org.jacoco.ant.ReportTask.createReport(ReportTask.java:545)
at org.jacoco.ant.ReportTask.execute(ReportTask.java:496)
... 150 more
Caused by: java.lang.IllegalStateException: Can't add different class with same name: lombok/eclipse/agent/EclipseLoaderPatcherTransplants
at org.jacoco.core.analysis.CoverageBuilder.visitCoverage(CoverageBuilder.java:106)
at org.jacoco.core.analysis.Analyzer$1.visitEnd(Analyzer.java:100)
at org.objectweb.asm.ClassVisitor.visitEnd(ClassVisitor.java:377)
at org.jacoco.core.internal.flow.ClassProbesAdapter.visitEnd(ClassProbesAdapter.java:100)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:748)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:424)
at org.jacoco.core.analysis.Analyzer.analyzeClass(Analyzer.java:117)
at org.jacoco.core.analysis.Analyzer.analyzeClass(Analyzer.java:133)
... 159 more
并排除罐子
jacocoTestReport{
doFirst {
delete fileTree (dir: "${buildDir}/resources/main", include: "profilecleaner*.jar")
}
}