- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有以下 gradle 文件中的 gradle 构建错误。但我不知道为什么它失败了。
请指教。
谢谢,
buildscript {
repositories {
maven { url "http://repo.spring.io/libs-snapshot" }
mavenLocal()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.0.0.RC4")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'spring-boot' <== This is line 14
jar {
baseName = 'gs-spring-boot'
version = '0.1.0'
}
repositories {
mavenCentral()
maven { url "http://repo.spring.io/libs-snapshot" }
}
dependencies {
// tag::jetty[]
compile("org.springframework.boot:spring-boot-starter-web") {
exclude module: "spring-boot-starter-tomcat"
}
compile("org.springframework.boot:spring-boot-starter-jetty")
// end::jetty[]
// tag::actuator[]
compile("org.springframework.boot:spring-boot-starter-actuator")
// end::actuator[]
testCompile("junit:junit")
}
task wrapper(type: Wrapper) {
gradleVersion = '1.11'
}
@localhost hello]$ gradle
org.gradle.api.internal.LocationAwareException: Build file '/home/xxx/dev/src/main/java/hello/build.gradle' line: 14
A problem occurred evaluating root project 'hello'.
at org.gradle.initialization.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:85)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:112)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:78)
at org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:42)
at org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:28)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139)
at org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionReportingAction.java:31)
at org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionReportingAction.java:20)
at org.gradle.launcher.Main.doAction(Main.java:48)
at org.gradle.launcher.exec.EntryPoint.run(EntryPoint.java:45)
at org.gradle.launcher.Main.main(Main.java:39)
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.gradle.launcher.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
at org.gradle.launcher.ProcessBootstrap.run(ProcessBootstrap.java:32)
at org.gradle.launcher.GradleMain.main(GradleMain.java:24)
Caused by: org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'hello'.
at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:54)
at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:127)
at org.gradle.configuration.BuildScriptProcessor.evaluate(BuildScriptProcessor.java:38)
at org.gradle.configuration.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:43)
at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:462)
at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:74)
at org.gradle.configuration.ProjectEvaluationConfigurer.execute(ProjectEvaluationConfigurer.java:23)
at org.gradle.configuration.ProjectEvaluationConfigurer.execute(ProjectEvaluationConfigurer.java:21)
at org.gradle.configuration.DefaultBuildConfigurer$1.execute(DefaultBuildConfigurer.java:38)
at org.gradle.configuration.DefaultBuildConfigurer$1.execute(DefaultBuildConfigurer.java:35)
at org.gradle.api.internal.project.AbstractProject.configure(AbstractProject.java:438)
at org.gradle.api.internal.project.AbstractProject.allprojects(AbstractProject.java:433)
at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:35)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:139)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:110)
... 19 more
Caused by: java.lang.NoSuchMethodError: org.gradle.api.tasks.TaskContainer.create(Ljava/lang/String;Ljava/lang/Class;)Lorg/gradle/api/Task;
at org.springframework.boot.gradle.SpringBootPlugin.addRepackageTask(SpringBootPlugin.java:94)
at org.springframework.boot.gradle.SpringBootPlugin.applyRepackage(SpringBootPlugin.java:60)
at org.springframework.boot.gradle.SpringBootPlugin.apply(SpringBootPlugin.java:48)
at org.springframework.boot.gradle.SpringBootPlugin.apply(SpringBootPlugin.java:1)
at org.gradle.api.internal.plugins.DefaultProjectsPluginContainer.providePlugin(DefaultProjectsPluginContainer.java:107)
at org.gradle.api.internal.plugins.DefaultProjectsPluginContainer.addPluginInternal(DefaultProjectsPluginContainer.java:71)
at org.gradle.api.internal.plugins.DefaultProjectsPluginContainer.apply(DefaultProjectsPluginContainer.java:37)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyPlugin(DefaultObjectConfigurationAction.java:101)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$200(DefaultObjectConfigurationAction.java:32)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$3.run(DefaultObjectConfigurationAction.java:72)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:114)
at org.gradle.api.internal.project.AbstractProject.apply(AbstractProject.java:840)
最佳答案
那个方法create(String,Class<?>)
是在 Gradle 1.6 中引入的,所以我怀疑你有一个发霉的 Gradle 包装器(或其他一些困惑的 Gradle 环境)。配置说生成的包装器是 1.11,但我想也许您正在使用旧版本?
关于gradle - 来自 gradle 的 org.gradle.api.internal.LocationAwareException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22356216/
我正在尝试在Android Studio 3.0.1中导入一些源代码,但出现以下错误:The app gradle file must have a dependency at org.gradle.
我想构建我的项目,但突然不知从哪里冒出这个错误。我的项目没有错误。请有人帮助我 我的 Gradle android { compileSdkVersion 26 defaultConfig {
我已经将gradle更新到最新版本,现在出现此错误。org.gradle.internal.exceptions.LocationAwareException: Execution failed fo
两天后,我找到了针对此 ReportedException: org.gradle.internal.exceptions.LocationAwareException 的搜索解决方案。我知道这个问题
我有以下 gradle 文件中的 gradle 构建错误。但我不知道为什么它失败了。 请指教。 谢谢, buildscript { repositories { maven {
我正在为我们的圈子 CI 服务器而苦苦挣扎。更具体地说是单元测试失败。在我的 circle.yml 文件中调用 build: working_directory: ~/code docker: -
我正在尝试为我的应用构建发行版 当我使用minifyEnabled false时,它没有问题,但是一旦将其设置为true,它就会失败,这是我的Gradle代码: apply plugin: 'com.
当我使用 react-native 创建 apk 时出现错误。 Executing task ':app:bundleReleaseJsAndAssets' (up-to-date check too
我是一名优秀的程序员,十分优秀!