【问题标题】:Grails 3.3.9 - expecting "interface", found '<newline>'Grails 3.3.9 - 期待“界面”,发现 '<newline>'
【发布时间】:2019-04-03 13:34:05
【问题描述】:

我正在关注官方的 Grail 入门指南 https://docs.grails.org/3.3.9/guide/gettingStarted.html 运行一个 hello world 应用程序。

但是,当我运行命令 grails create-app helloworld --profile=web 时,出现以下错误:

| Error Error initializing classpath: startup failed:
build file '/Users/sdicola/build.gradle': 3: expecting "interface", found '<newline>' @ line 3, column 20.
   @buildRepositories@
                      ^

1 error
 (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
build file '/Users/sdicola/build.gradle': 3: expecting "interface", found '<newline>' @ line 3, column 20.
   @buildRepositories@
                      ^

1 error

| Error Error initializing classpath: startup failed:
build file '/Users/sdicola/build.gradle': 3: expecting "interface", found '<newline>' @ line 3, column 20.
   @buildRepositories@
                      ^

1 error

我正在使用以下软件版本:

java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)


------------------------------------------------------------
Gradle 5.3.1
------------------------------------------------------------

Build time:   2019-03-28 09:09:23 UTC
Revision:     f2fae6ba563cfb772c8bc35d31e43c59a5b620c3

Kotlin:       1.3.21
Groovy:       2.5.4
Ant:          Apache Ant(TM) version 1.9.13 compiled on July 10 2018
JVM:          1.8.0_201 (Oracle Corporation 25.201-b09)
OS:           Mac OS X 10.13.6 x86_64

| Grails Version: 4.0.0.M2
| JVM Version: 1.8.0_201

【问题讨论】:

  • @buildRepositories@ 删除最后一个@
  • 我无权访问源代码
  • 能否提供/Users/sdicola/build.gradle的内容
  • @Vall0n 有趣的是,如果我在一个空目录中创建一个新项目,我得到了这个:
  • C02WW0K9HV2T:gradle-demo sdicola$ grails create-app helloworld |未找到名称 [web] 的错误配置文件

标签: java gradle grails groovy


【解决方案1】:

Grails Dev Discuss 的 Jeff Brown 表示,我删除了一个 grails-app 目录,该目录是在我试图从中运行 create-app 的目录中以某种方式创建的,这解决了问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-18
    • 2019-07-06
    • 1970-01-01
    • 2019-07-11
    • 2017-11-19
    • 1970-01-01
    相关资源
    最近更新 更多