在为libGDX构建html项目时出现gretty错误



我正在用gradle构建一个html libGDX项目。

命令后:

>gradlew html:superDev

我得到这个错误信息:

> Task :html:beforeRun FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':html:beforeRun'.
> Could not resolve all files for configuration ':html:grettyRunnerJetty94'.
> Could not find org.gretty:gretty-runner-jetty94:3.0.2.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/org/gretty/gretty-runner-jetty94/3.0.2/gretty-runner-jetty94-3.0.2.pom
- https://dl.google.com/dl/android/maven2/org/gretty/gretty-runner-jetty94/3.0.2/gretty-runner-jetty94-3.0.2.pom
- https://oss.sonatype.org/content/repositories/snapshots/org/gretty/gretty-runner-jetty94/3.0.2/gretty-runner-jetty94-3.0.2.pom
- https://oss.sonatype.org/content/repositories/releases/org/gretty/gretty-runner-jetty94/3.0.2/gretty-runner-jetty94-3.0.2.pom
Required by:
project :html

要解决这个问题,请编辑文件构建。Gradle在你的项目目录中,以反映gretty的新版本(目前是3.0.3,找到任何更新https://plugins.gradle.org/plugin/org.gretty)。

查找section "buildscript"分段"dependencies"

dependencies {
classpath "gradle.plugin.org.gretty:gretty:3.0.3"      
}

替换:

classpath 'org.gretty:gretty:3.0.2'

(或任何错误的版本文本)

:

classpath "gradle.plugin.org.gretty:gretty:3.0.3"

(或gradle链接https://plugins.gradle.org/plugin/org.gretty中存在的任何文本版本行)

在"所有项目"节,查找"存储库"。子节并添加链接https://plugins.gradle.org/plugin/org.gretty中提供的maven存储库。

repositories {
mavenLocal()
mavenCentral()
google()
maven { url "https://plugins.gradle.org/m2/" }
}

保存文件并使用:

重新构建项目
>gradlew html:superDev

最新更新