我是spankin'的编码新手。实际上,我通过尝试使此东西起作用的实验,已经了解了有关gradle的全部知识。 我试图从一个旧的github文件构建一个.jar文件,并且在过去一周中,我一直在尝试着使这个东西正常工作,并且它总是会吐出错误。我目前比以往任何时候都更接近构建这个东西- 除非有问题。
当我尝试构建jar文件时,出现错误:无法解析配置':classpath'的所有依赖项。还有很多反馈,如下所示。
PS J:\MC\MC2\.minecraft\mods\ElectricalAge-releases-1.12\ElectricalAge-releases-1.12> .\gradlew
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'ElectricalAge-releases-1.12'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve de.undercouch:gradle-download-task:1.2.
Required by:
:ElectricalAge-releases-1.12:unspecified
> Could not HEAD 'http://repo1.maven.org/maven2/de/undercouch/gradle-download-task/1.2/gradle-download-task-1.2.pom'. Received status code 501 from server: HTTPS Required
> Could not HEAD 'http://jcenter.bintray.com/de/undercouch/gradle-download-task/1.2/gradle-download-task-1.2.pom'. Received status code 403 from server: Forbidden
> Could not resolve com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6.
Required by:
:ElectricalAge-releases-1.12:unspecified
> Could not HEAD 'http://repo1.maven.org/maven2/com/jfrog/bintray/gradle/gradle-bintray-plugin/1.6/gradle-bintray-plugin-1.6.pom'. Received status code 501 from server: HTTPS Required
> Could not HEAD 'http://jcenter.bintray.com/com/jfrog/bintray/gradle/gradle-bintray-plugin/1.6/gradle-bintray-plugin-1.6.pom'. Received status code 403 from server: Forbidden
> Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.0.1-2.
Required by:
:ElectricalAge-releases-1.12:unspecified
> Could not HEAD 'http://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.0.1-2/kotlin-gradle-plugin-1.0.1-2.pom'. Received status code 501 from server: HTTPS Required
> Could not HEAD 'http://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin/1.0.1-2/kotlin-gradle-plugin-1.0.1-2.pom'. Received status code 403 from server: Forbidden
> Could not resolve net.md-5:SpecialSource:1.7.3.
Required by:
:ElectricalAge-releases-1.12:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT
> Could not HEAD 'http://repo1.maven.org/maven2/net/md-5/SpecialSource/1.7.3/SpecialSource-1.7.3.pom'. Received status code 501 from server: HTTPS Required
> Could not HEAD 'http://jcenter.bintray.com/net/md-5/SpecialSource/1.7.3/SpecialSource-1.7.3.pom'. Received status code 403 from server: Forbidden
> Could not resolve org.apache.httpcomponents:httpclient:4.3.3.
Required by:
:ElectricalAge-releases-1.12:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT
> Could not HEAD 'http://repo1.maven.org/maven2/org/apache/httpcomponents/httpclient/4.3.3/httpclient-4.3.3.pom'. Received status code 501 from server: HTTPS Required
> Could not HEAD 'http://jcenter.bintray.com/org/apache/httpcomponents/httpclient/4.3.3/httpclient-4.3.3.pom'. Received status code 403 from server: Forbidden
> Could not resolve org.apache.httpcomponents:httpmime:4.3.3.
Required by:
:ElectricalAge-releases-1.12:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT
> Could not HEAD 'http://repo1.maven.org/maven2/org/apache/httpcomponents/httpmime/4.3.3/httpmime-4.3.3.pom'. Received status code 501 from server: HTTPS Required
> Could not HEAD 'http://jcenter.bintray.com/org/apache/httpcomponents/httpmime/4.3.3/httpmime-4.3.3.pom'. Received status code 403 from server: Forbidden
> Could not resolve com.github.abrarsyed.jastyle:jAstyle:1.2.
Required by:
:ElectricalAge-releases-1.12:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT
> Could not HEAD 'http://repo1.maven.org/maven2/com/github/abrarsyed/jastyle/jAstyle/1.2/jAstyle-1.2.pom'. Received status code 501 from server: HTTPS Required
> Could not HEAD 'http://jcenter.bintray.com/com/github/abrarsyed/jastyle/jAstyle/1.2/jAstyle-1.2.pom'. Received status code 403 from server: Forbidden
> Could not resolve net.sf.trove4j:trove4j:2.1.0.
Required by:
:ElectricalAge-releases-1.12:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT
> Could not HEAD 'http://repo1.maven.org/maven2/net/sf/trove4j/trove4j/2.1.0/trove4j-2.1.0.pom'. Received status code 501 from server: HTTPS Required
> Could not HEAD 'http://jcenter.bintray.com/net/sf/trove4j/trove4j/2.1.0/trove4j-2.1.0.pom'. Received status code 403 from server: Forbidden
> Could not resolve com.google.code.gson:gson:2.2.4.
Required by:
:ElectricalAge-releases-1.12:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT
:ElectricalAge-releases-1.12:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT > de.oceanlabs.mcp:RetroGuard:3.6.6
:ElectricalAge-releases-1.12:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT > de.oceanlabs.mcp:mcinjector:3.2-SNAPSHOT
> Could not HEAD 'http://repo1.maven.org/maven2/com/google/code/gson/gson/2.2.4/gson-2.2.4.pom'. Received status code 501 from server: HTTPS Required
> Could not HEAD 'http://jcenter.bintray.com/com/google/code/gson/gson/2.2.4/gson-2.2.4.pom'. Received status code 403 from server: Forbidden
> Could not resolve com.google.guava:guava:18.0.
Required by:
:ElectricalAge-releases-1.12:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT
:ElectricalAge-releases-1.12:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT > net.minecraftforge.srg2source:Srg2Source:3.2-SNAPSHOT
> Could not HEAD 'http://repo1.maven.org/maven2/com/google/guava/guava/18.0/guava-18.0.pom'. Received status code 501 from server: HTTPS Required
> Could not HEAD 'http://jcenter.bintray.com/com/google/guava/guava/18.0/guava-18.0.pom'. Received status code 403 from server: Forbidden
> Could not resolve org.ow2.asm:asm-debug-all:5.0.3.
Required by:
:ElectricalAge-releases-1.12:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT
:ElectricalAge-releases-1.12:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT > net.minecraftforge.srg2source:Srg2Source:3.2-SNAPSHOT
> Could not HEAD 'http://repo1.maven.org/maven2/org/ow2/asm/asm-debug-all/5.0.3/asm-debug-all-5.0.3.pom'. Received status code 501 from server: HTTPS Required
> Could not HEAD 'http://jcenter.bintray.com/org/ow2/asm/asm-debug-all/5.0.3/asm-debug-all-5.0.3.pom'. Received status code 403 from server: Forbidden
> Could not resolve com.github.tony19:named-regexp:0.2.3.
Required by:
:ElectricalAge-releases-1.12:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT
> Could not HEAD 'http://repo1.maven.org/maven2/com/github/tony19/named-regexp/0.2.3/named-regexp-0.2.3.pom'. Received status code 501 from server: HTTPS Required
> Could not HEAD 'http://jcenter.bintray.com/com/github/tony19/named-regexp/0.2.3/named-regexp-0.2.3.pom'. Received status code 403 from server: Forbidden
> Could not resolve com.cloudbees:diff4j:1.1.
Required by:
:ElectricalAge-releases-1.12:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT
> Could not HEAD 'http://repo1.maven.org/maven2/com/cloudbees/diff4j/1.1/diff4j-1.1.pom'. Received status code 501 from server: HTTPS Required
> Could not HEAD 'http://jcenter.bintray.com/com/cloudbees/diff4j/1.1/diff4j-1.1.pom'. Received status code 403 from server: Forbidden
> Could not resolve net.sf.jopt-simple:jopt-simple:4.6.
Required by:
:ElectricalAge-releases-1.12:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT > de.oceanlabs.mcp:RetroGuard:3.6.6
:ElectricalAge-releases-1.12:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT > de.oceanlabs.mcp:mcinjector:3.2-SNAPSHOT
> Could not GET 'http://repo1.maven.org/maven2/net/sf/jopt-simple/jopt-simple/4.6/jopt-simple-4.6.pom'. Received status code 501 from server: HTTPS Required
> Could not GET 'http://jcenter.bintray.com/net/sf/jopt-simple/jopt-simple/4.6/jopt-simple-4.6.pom'. Received status code 403 from server: Forbidden
> Could not resolve org.eclipse.core:jobs:3.5.300-v20130429-1813.
Required by:
:ElectricalAge-releases-1.12:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT > net.minecraftforge.srg2source:Srg2Source:3.2-SNAPSHOT
> Could not HEAD 'http://repo1.maven.org/maven2/org/eclipse/core/jobs/3.5.300-v20130429-1813/jobs-3.5.300-v20130429-1813.pom'. Received status code 501 from server: HTTPS Required
> Could not HEAD 'http://jcenter.bintray.com/org/eclipse/core/jobs/3.5.300-v20130429-1813/jobs-3.5.300-v20130429-1813.pom'. Received status code 403 from server: Forbidden
> Could not resolve org.eclipse:osgi:3.9.1-v20130814-1242.
Required by:
:ElectricalAge-releases-1.12:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT > net.minecraftforge.srg2source:Srg2Source:3.2-SNAPSHOT
> Could not HEAD 'http://repo1.maven.org/maven2/org/eclipse/osgi/3.9.1-v20130814-1242/osgi-3.9.1-v20130814-1242.pom'. Received status code 501 from server: HTTPS Required
> Could not HEAD 'http://jcenter.bintray.com/org/eclipse/osgi/3.9.1-v20130814-1242/osgi-3.9.1-v20130814-1242.pom'. Received status code 403 from server: Forbidden
> Could not resolve org.eclipse.core:contenttype:3.4.200-v20130326-1255.
Required by:
:ElectricalAge-releases-1.12:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT > net.minecraftforge.srg2source:Srg2Source:3.2-SNAPSHOT
> Could not HEAD 'http://repo1.maven.org/maven2/org/eclipse/core/contenttype/3.4.200-v20130326-1255/contenttype-3.4.200-v20130326-1255.pom'. Received status code 501 from server: HTTPS Required
> Could not HEAD 'http://jcenter.bintray.com/org/eclipse/core/contenttype/3.4.200-v20130326-1255/contenttype-3.4.200-v20130326-1255.pom'. Received status code 403 from server: Forbidden
> Could not resolve org.eclipse.core:resources:3.2.1-R32x_v20060914.
Required by:
:ElectricalAge-releases-1.12:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT > net.minecraftforge.srg2source:Srg2Source:3.2-SNAPSHOT
> Could not HEAD 'http://repo1.maven.org/maven2/org/eclipse/core/resources/3.2.1-R32x_v20060914/resources-3.2.1-R32x_v20060914.pom'. Received status code 501 from server: HTTPS Required
> Could not HEAD 'http://jcenter.bintray.com/org/eclipse/core/resources/3.2.1-R32x_v20060914/resources-3.2.1-R32x_v20060914.pom'. Received status code 403 from server: Forbidden
> Could not resolve org.eclipse.equinox:common:3.6.200-v20130402-1505.
Required by:
:ElectricalAge-releases-1.12:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT > net.minecraftforge.srg2source:Srg2Source:3.2-SNAPSHOT
> Could not HEAD 'http://repo1.maven.org/maven2/org/eclipse/equinox/common/3.6.200-v20130402-1505/common-3.6.200-v20130402-1505.pom'. Received status code 501 from server: HTTPS Required
> Could not HEAD 'http://jcenter.bintray.com/org/eclipse/equinox/common/3.6.200-v20130402-1505/common-3.6.200-v20130402-1505.pom'. Received status code 403 from server: Forbidden
> Could not resolve org.eclipse.text:org.eclipse.text:3.5.101.
Required by:
:ElectricalAge-releases-1.12:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT > net.minecraftforge.srg2source:Srg2Source:3.2-SNAPSHOT
> Could not HEAD 'http://repo1.maven.org/maven2/org/eclipse/text/org.eclipse.text/3.5.101/org.eclipse.text-3.5.101.pom'. Received status code 501 from server: HTTPS Required
> Could not HEAD 'http://jcenter.bintray.com/org/eclipse/text/org.eclipse.text/3.5.101/org.eclipse.text-3.5.101.pom'. Received status code 403 from server: Forbidden
> Could not resolve org.eclipse.jgit:org.eclipse.jgit:3.2.0.201312181205-r.
Required by:
:ElectricalAge-releases-1.12:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT > net.minecraftforge.srg2source:Srg2Source:3.2-SNAPSHOT
> Could not HEAD 'http://repo1.maven.org/maven2/org/eclipse/jgit/org.eclipse.jgit/3.2.0.201312181205-r/org.eclipse.jgit-3.2.0.201312181205-r.pom'. Received status code 501 from server: HTTPS Required
> Could not HEAD 'http://jcenter.bintray.com/org/eclipse/jgit/org.eclipse.jgit/3.2.0.201312181205-r/org.eclipse.jgit-3.2.0.201312181205-r.pom'. Received status code 403 from server: Forbidden
> Could not resolve org.eclipse.equinox:preferences:3.5.100-v20130422-1538.
Required by:
:ElectricalAge-releases-1.12:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT > net.minecraftforge.srg2source:Srg2Source:3.2-SNAPSHOT
> Could not HEAD 'http://repo1.maven.org/maven2/org/eclipse/equinox/preferences/3.5.100-v20130422-1538/preferences-3.5.100-v20130422-1538.pom'. Received status code 501 from server: HTTPS Required
> Could not HEAD 'http://jcenter.bintray.com/org/eclipse/equinox/preferences/3.5.100-v20130422-1538/preferences-3.5.100-v20130422-1538.pom'. Received status code 403 from server: Forbidden
> Could not resolve net.sf.jopt-simple:jopt-simple:4.6.
Required by:
:ElectricalAge-releases-1.12:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT > net.minecraftforge.srg2source:Srg2Source:3.2-SNAPSHOT
> Could not GET 'http://repo1.maven.org/maven2/net/sf/jopt-simple/jopt-simple/4.6/jopt-simple-4.6.pom'. Received status code 501 from server: HTTPS Required
> Could not GET 'http://jcenter.bintray.com/net/sf/jopt-simple/jopt-simple/4.6/jopt-simple-4.6.pom'. Received status code 403 from server: Forbidden
> Could not resolve org.eclipse.core:runtime:3.9.0-v20130326-1255.
Required by:
:ElectricalAge-releases-1.12:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT > net.minecraftforge.srg2source:Srg2Source:3.2-SNAPSHOT
> Could not HEAD 'http://repo1.maven.org/maven2/org/eclipse/core/runtime/3.9.0-v20130326-1255/runtime-3.9.0-v20130326-1255.pom'. Received status code 501 from server: HTTPS Required
> Could not HEAD 'http://jcenter.bintray.com/org/eclipse/core/runtime/3.9.0-v20130326-1255/runtime-3.9.0-v20130326-1255.pom'. Received status code 403 from server: Forbidden
> Could not resolve org.ow2.asm:asm-debug-all:5.0.3.
Required by:
:ElectricalAge-releases-1.12:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT > de.oceanlabs.mcp:mcinjector:3.2-SNAPSHOT
> Could not HEAD 'http://repo1.maven.org/maven2/org/ow2/asm/asm-debug-all/5.0.3/asm-debug-all-5.0.3.pom'. Received status code 501 from server: HTTPS Required
> Could not HEAD 'http://jcenter.bintray.com/org/ow2/asm/asm-debug-all/5.0.3/asm-debug-all-5.0.3.pom'. Received status code 403 from server: Forbidden
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
这让我很伤心。我到现在为止已经停下了脚步,因为我的gradle试图使用HTTP协议访问它们时,我的gradle无法访问这些网站,因为它们需要HTTPS协议。
我猜这是因为创建此文件时,gradle尚未切换到被迫使用HTTPS的地步。我浏览了所有可以找到的设置文件,并将所有依赖项更改为HTTPS链接,但无济于事。
请记住,我是一个菜鸟,所以您必须逐步指导我。这是我在github文件中的文件目录。
感谢您的帮助。而且,我没有写任何这些文件。它们都是作者在github上写的:https://github.com/Electrical-Age/ElectricalAge/tree/releases/1.12
答案 0 :(得分:1)
是的,问题是由于该仓库的releases/1.12
分支中使用了非常老的Gradle版本。
gradlew
命令使用的Gradle版本由文件gradle/wrapper/gradle-wrapper.properties
确定。如果您编辑该文件并将distributionUrl
属性更改为使用gradle-4.4-all.zip
(例如此仓库的develop
分支)而不是gradle-2.0-all.zip
,则应该至少能够构建该项目。