【问题标题】:Getting error on gretty when building html project for libGDX为 libGDX 构建 html 项目时出现错误
【发布时间】:2021-02-21 16:54:30
【问题描述】:

我正在用 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 web-applications libgdx gretty


    【解决方案1】:

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

    查找“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 中存在的任何文本版本)

    在“allprojects”部分,查找“repositories”子部分并添加链接https://plugins.gradle.org/plugin/org.gretty中显示的maven存储库。

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

    保存文件并重建您的项目:

        >gradlew html:superDev
    

    【讨论】:

      猜你喜欢
      • 2014-11-22
      • 2019-08-02
      • 1970-01-01
      • 2019-02-03
      • 2011-11-02
      • 1970-01-01
      • 2019-01-27
      • 2019-08-18
      • 1970-01-01
      相关资源
      最近更新 更多