- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我一直在四处寻找这个问题的解决方案,但我似乎无法找到正确的答案。我相信,我的情况比较特殊,所以这个问题可能更难解决。
问题的核心是我在运行 mvn test
命令时收到的错误消息:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:testCompile (default-testCompile) on project DriveServiceFitnesse: Fatal error compiling: java.lang.ClassCastException: com.sun.tools.javac.code.Attribute$Error cannot be cast to com.sun.tools.javac.code.Attribute$Class -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
但是 mvn compile
并没有通过错误。但是由于我需要 mvn test 来生成测试源,所以我的测试实际上并没有起作用。我知道这是因为,当我运行我的测试时,我得到了这个错误:
Error:java: java.lang.ClassCastException:
com.sun.tools.javac.code.Attribute$Error cannot be cast to
com.sun.tools.javac.code.Attribute$Class
用于编译和运行的项目没有问题。当我尝试将我的项目从 Maven 转换为 Gradle 时出现了这个问题。我遇到了类似的问题,所以我关闭了分支并取消了我原来的工作代码/项目,现在我似乎无法修复它。
如能提供有关此事的任何帮助,我们将不胜感激。如果可能有帮助,我会发布我的 pom.xml 文件。
*编辑:根据我在堆栈跟踪消息中粘贴的建议,我得到:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:testCompile (default-testCompile) on project DriveServiceFitnesse: Fatal error compiling: java.lang.ClassCastException: com.sun.tools.javac.code.Attribute$Error cannot be cast to com.sun.tools.javac.code.Attribute$Class -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:testCompile (default-testCompile) on project DriveServiceFitnesse: Fatal error compiling
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
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:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Fatal error compiling
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:836)
at org.apache.maven.plugin.compiler.TestCompilerMojo.execute(TestCompilerMojo.java:153)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
最佳答案
修正了这个错误。是我的疏忽。问题是出于某种原因,我使用“项目结构”(在 intellij 中)导入的本地 jar 不知何故过期了,即库仍然在列表中,但没有被正确地拉入项目。我删除了引用并重新导入,一切似乎都正常了……唉。
关于java - Maven-compiler-plugin:3.3: testCompile (default-testCompile) 编译失败 Attribute$Error 无法转换为 Attribute$Class,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31571054/
自从我开始工作(约 6 年)以来,我一直是 .NET 的一员。最近在做一个使用Django的项目,需要并行学习Python。很多时候我碰到的 Python 代码看起来很简单,但我就是看不懂。这是其中之
谁能解释一下 JLS §8.4.8.4 中提到的“严格的default-abstract 和default-default 冲突规则” . 它们是否在 JLS 中定义?我似乎找不到他们的定义。 最佳答
我在我的启动图像通用项目中添加了“Default.png,Default-568h@2x.png,Default@2x.png”这三个文件,我有三个不同的图像,分辨率与苹果中提到的完全相同文档,适用于
我试图在删除 AWS RDS MySQL 数据库后删除默认的数据库参数组,但出现以下错误 Failed to delete default.mysql8.0: Default DBParameterG
我想使用 firebase 云函数发送通知,所以我尝试使用 firebase.messaging().getToken() 获取 token ,但我不断收到错误消息: TypeError: fireb
无法通过 Instagram 登录我的应用。我正在使用 react-native instagram 包,但我面临这个问题,因为 _react3.default.creteRef() 不是一个函数。引
从 Rust 1.6 开始,当前特征 Default定义为, pub trait Default { fn default() -> Self; } 为什么不是这个 pub trait Def
在我的第一次代码审查(不久前)中,我被告知在所有 switch 语句中包含默认子句是一种很好的做法。我最近想起了这个建议,但不记得其理由是什么。现在对我来说听起来很奇怪。 始终包含默认语句是否有合理的
这个错误很奇怪。在 firebase 中 react native 有什么问题我已经通过 npm install 安装了 firebase这是我的代码 import React, {Component
对于以下 3 种编译情况: gcc -o helloc hello.c (1) g++ -o hellocpp hello.cpp
我有一个 switch 语句。它几乎可以正常工作,但是它不仅显示一个案例,还显示选定的案例,然后显示默认案例。这是我的代码: var people = { names: ["Sam", "Tim"
这个问题在这里已经有了答案: Default keyword in Swift parameter (1 个回答) 关闭 6 年前。 我试图理解前置条件函数并遇到了“= default”。快速谷歌和
禁止!配置的服务帐户无权访问。服务帐户可能已被撤销。用户“system:serviceaccount:default:default”无法获取命名空间“mycomp-services-process”
我一直在我的 React 中广泛使用命名导出和默认导出,我遇到了这 2 个相似的语法。 从'./Button'导出默认值; export { default } from './Button'; 有人
我很困惑什么时候使用 .prototype 来扩展一个对象,什么时候不使用它。像下面的部分代码,为什么不在FacebookApi.defaults中使用.prototype,难道.prototype只
这个问题在这里已经有了答案: What is the difference between "var=${var:-word}" and "var=${var:=word}"? (4 个答案) 关闭
我想创建一个数据类基类,其中子类中的所有字段都自动可选且默认为无(如果未提供默认值)。 下面的代码……几乎可以满足我的要求,但又不完全是。它出错的方式就像我从未编写过 __init_subclass_
所以我有三个 Typescript 文件: 配置/env/development.ts import { Config } from '../config'; class DevConfig {
我在一个名为 Activity 的表中添加了一个名为 Ordinal 的新列。问题是我给了它一个 UNIQUE 约束,将它设置为允许 NULL(尽管我最终不会想要这个。我只需要将它设置为那个以使脚本更
嗨,我是 struts2 的新手,在我的项目中,我在注册页面使用 json-default 扩展,并使用validation.xml 文件验证它,在同一个项目中,我在登录页面使用 struts-def
我是一名优秀的程序员,十分优秀!