源码构建错误日志如下:
Generating JAR file ‘gradle-api-4.4.jar’
Generating JAR file ‘gradle-test-kit-4.4.jar’
Download https://plugins.gradle.org/m2/me/champeau/gradle/japicmp-gradle-plugin/0.2.8/japicmp-gradle-plugin-0.2.8.pom
Download https://repo.maven.apache.org/maven2/com/github/siom79/japicmp/japicmp/0.13.1/japicmp-0.13.1.pom
Download https://repo.maven.apache.org/maven2/com/github/siom79/japicmp/japicmp-base/0.13.1/japicmp-base-0.13.1.pom
Download https://repo.maven.apache.org/maven2/org/sonatype/oss/oss-parent/9/oss-parent-9.pom
Download https://repo.maven.apache.org/maven2/com/sun/xml/bind/jaxb-impl/2.2.7/jaxb-impl-2.2.7.pom
Download https://repo.maven.apache.org/maven2/com/sun/xml/bind/jaxb-core/2.2.7/jaxb-core-2.2.7.pom
Download https://repo.maven.apache.org/maven2/org/javassist/javassist/3.23.1-GA/javassist-3.23.1-GA.pom
Download https://repo.maven.apache.org/maven2/javax/xml/bind/jaxb-api/2.2.7/jaxb-api-2.2.7.pom
Download https://repo.maven.apache.org/maven2/net/java/jvnet-parent/1/jvnet-parent-1.pom
Download https://repo.maven.apache.org/maven2/javax/activation/activation/1.1/activation-1.1.pom
Download https://repo.maven.apache.org/maven2/com/google/guava/guava/18.0/guava-18.0.pom
FAILURE: Build failed with an exception.
Could not resolve com.google.guava:guava:18.0.
Required by:
project :buildSrc > me.champeau.gradle:japicmp-gradle-plugin:0.2.8 > com.github.siom79.japicmp:japicmp:0.13.1
Could not resolve com.google.guava:guava:18.0.
Could not parse POM https://repo.maven.apache.org/maven2/com/google/guava/guava/18.0/guava-18.0.pom
Could not resolve com.google.guava:guava-parent:18.0.
Could not resolve com.google.guava:guava-parent:18.0.
Could not get resource ‘https://repo.maven.apache.org/maven2/com/google/guava/guava-parent/18.0/guava-parent-18.0.pom’.
Could not GET ‘https://repo.maven.apache.org/maven2/com/google/guava/guava-parent/18.0/guava-parent-18.0.pom’.
Read timed out
Could not resolve com.sun.istack:istack-commons-runtime:2.16.
Required by:
project :buildSrc > me.champeau.gradle:japicmp-gradle-plugin:0.2.8 > com.github.siom79.japicmp:japicmp:0.13.1 > com.sun.xml.bind:jaxb-core:2.2.7
Skipped due to earlier error
Could not resolve com.sun.istack:istack-commons-runtime:2.16.
Could not get resource ‘https://plugins.gradle.org/m2/com/sun/istack/istack-commons-runtime/2.16/istack-commons-runtime-2.16.pom’.
Could not GET ‘https://plugins.gradle.org/m2/com/sun/istack/istack-commons-runtime/2.16/istack-commons-runtime-2.16.pom’.
plugins.gradle.org
Could not resolve com.sun.xml.fastinfoset:FastInfoset:1.2.12.
Required by:
project :buildSrc > me.champeau.gradle:japicmp-gradle-plugin:0.2.8 > com.github.siom79.japicmp:japicmp:0.13.1 > com.sun.xml.bind:jaxb-impl:2.2.7
Skipped due to earlier error
Could not resolve com.sun.xml.fastinfoset:FastInfoset:1.2.12.
Could not get resource ‘https://plugins.gradle.org/m2/com/sun/xml/fastinfoset/FastInfoset/1.2.12/FastInfoset-1.2.12.pom’.
Could not GET ‘https://plugins.gradle.org/m2/com/sun/xml/fastinfoset/FastInfoset/1.2.12/FastInfoset-1.2.12.pom’.
plugins.gradle.org
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
CONFIGURE FAILED in 2m 4s
FAILURE: Build failed with an exception.
Could not resolve com.google.guava:guava:18.0.
Required by:
project :buildSrc > me.champeau.gradle:japicmp-gradle-plugin:0.2.8 > com.github.siom79.japicmp:japicmp:0.13.1
Could not resolve com.google.guava:guava:18.0.
Could not get resource ‘https://repo.maven.apache.org/maven2/com/google/guava/guava/18.0/guava-18.0.pom’.
Could not HEAD ‘https://repo.maven.apache.org/maven2/com/google/guava/guava/18.0/guava-18.0.pom’.
repo.maven.apache.org
Could not resolve com.google.guava:guava:18.0.
Could not get resource ‘https://plugins.gradle.org/m2/com/google/guava/guava/18.0/guava-18.0.pom’.
Could not HEAD ‘https://plugins.gradle.org/m2/com/google/guava/guava/18.0/guava-18.0.pom’.
plugins.gradle.org
Could not resolve com.sun.istack:istack-commons-runtime:2.16.
Required by:
project :buildSrc > me.champeau.gradle:japicmp-gradle-plugin:0.2.8 > com.github.siom79.japicmp:japicmp:0.13.1 > com.sun.xml.bind:jaxb-core:2.2.7
Could not resolve com.sun.istack:istack-commons-runtime:2.16.
Could not get resource ‘https://repo.maven.apache.org/maven2/com/sun/istack/istack-commons-runtime/2.16/istack-commons-runtime-2.16.pom’.
Could not GET ‘https://repo.maven.apache.org/maven2/com/sun/istack/istack-commons-runtime/2.16/istack-commons-runtime-2.16.pom’.
repo.maven.apache.org
Could not resolve com.sun.istack:istack-commons-runtime:2.16.
Could not get resource ‘https://plugins.gradle.org/m2/com/sun/istack/istack-commons-runtime/2.16/istack-commons-runtime-2.16.pom’.
Could not GET ‘https://plugins.gradle.org/m2/com/sun/istack/istack-commons-runtime/2.16/istack-commons-runtime-2.16.pom’.
plugins.gradle.org
Could not resolve com.sun.xml.fastinfoset:FastInfoset:1.2.12.
Required by:
project :buildSrc > me.champeau.gradle:japicmp-gradle-plugin:0.2.8 > com.github.siom79.japicmp:japicmp:0.13.1 > com.sun.xml.bind:jaxb-impl:2.2.7
Could not resolve com.sun.xml.fastinfoset:FastInfoset:1.2.12.
Could not get resource ‘https://repo.maven.apache.org/maven2/com/sun/xml/fastinfoset/FastInfoset/1.2.12/FastInfoset-1.2.12.pom’.
Could not GET ‘https://repo.maven.apache.org/maven2/com/sun/xml/fastinfoset/FastInfoset/1.2.12/FastInfoset-1.2.12.pom’.
repo.maven.apache.org
Could not resolve com.sun.xml.fastinfoset:FastInfoset:1.2.12.
Could not get resource ‘https://plugins.gradle.org/m2/com/sun/xml/fastinfoset/FastInfoset/1.2.12/FastInfoset-1.2.12.pom’.
Could not GET ‘https://plugins.gradle.org/m2/com/sun/xml/fastinfoset/FastInfoset/1.2.12/FastInfoset-1.2.12.pom’.
plugins.gradle.org
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
CONFIGURE FAILED in 6s
Download https://repo.maven.apache.org/maven2/com/google/guava/guava-parent/18.0/guava-parent-18.0.pom
Download https://repo.maven.apache.org/maven2/org/sonatype/oss/oss-parent/7/oss-parent-7.pom
Download https://repo.maven.apache.org/maven2/com/sun/istack/istack-commons-runtime/2.16/istack-commons-runtime-2.16.pom
Download https://repo.maven.apache.org/maven2/com/sun/istack/istack-commons/2.16/istack-commons-2.16.pom
Download https://repo.maven.apache.org/maven2/net/java/jvnet-parent/3/jvnet-parent-3.pom
Download https://repo.maven.apache.org/maven2/com/sun/xml/fastinfoset/FastInfoset/1.2.12/FastInfoset-1.2.12.pom
Download https://repo.maven.apache.org/maven2/com/sun/xml/fastinfoset/fastinfoset-project/1.2.12/fastinfoset-project-1.2.12.pom
Download https://repo.maven.apache.org/maven2/javax/xml/bind/jsr173_api/1.0/jsr173_api-1.0.pom
Download https://repo.maven.apache.org/maven2/com/github/siom79/japicmp/japicmp/0.13.1/japicmp-0.13.1.jar
Download https://repo.maven.apache.org/maven2/com/google/guava/guava/18.0/guava-18.0.jar
Download https://repo.maven.apache.org/maven2/com/sun/xml/bind/jaxb-impl/2.2.7/jaxb-impl-2.2.7.jar
Download https://repo.maven.apache.org/maven2/com/sun/xml/bind/jaxb-core/2.2.7/jaxb-core-2.2.7.jar
Download https://repo.maven.apache.org/maven2/javax/xml/bind/jaxb-api/2.2.7/jaxb-api-2.2.7.jar
Download https://repo.maven.apache.org/maven2/javax/activation/activation/1.1/activation-1.1.jar
Download https://repo.maven.apache.org/maven2/com/sun/istack/istack-commons-runtime/2.16/istack-commons-runtime-2.16.jar
Download https://repo.maven.apache.org/maven2/com/sun/xml/fastinfoset/FastInfoset/1.2.12/FastInfoset-1.2.12.jar
Download https://plugins.gradle.org/m2/me/champeau/gradle/japicmp-gradle-plugin/0.2.8/japicmp-gradle-plugin-0.2.8.jar
Download https://repo.maven.apache.org/maven2/org/javassist/javassist/3.23.1-GA/javassist-3.23.1-GA.jar
Download https://repo.maven.apache.org/maven2/javax/xml/bind/jsr173_api/1.0/jsr173_api-1.0.jar
:buildSrc:clean
:buildSrc:compileJavaE:\workspace\Spring-Framework\buildSrc\src\main\java\org\springframework\build\api\ApiDiffPlugin.java:32: 错误: 找不到符号
import org.gradle.api.tasks.TaskProvider;
^
符号: 类 TaskProvider
位置: 程序包 org.gradle.api.tasks
E:\workspace\Spring-Framework\buildSrc\src\main\java\org\springframework\build\api\ApiDiffPlugin.java:75: 错误: 找不到符号
TaskProvider jar = project.getTasks().withType(Jar.class).named(“jar”);
^
符号: 类 TaskProvider
位置: 类 ApiDiffPlugin
E:\workspace\Spring-Framework\buildSrc\src\main\java\org\springframework\build\api\ApiDiffPlugin.java:75: 错误: 找不到符号
TaskProvider jar = project.getTasks().withType(Jar.class).named(“jar”);
^
符号: 方法 named(String)
位置: 接口 TaskCollection
3 个错误
FAILED
FAILURE: Build failed with an exception.
Compilation failed; see the compiler error output for details.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
CONFIGURE FAILED in 38s
问题分析:
读取不到3个jar包:com.google.guava:guava:18.0…
解决办法:
在build.gralde文件中添加3个jar包的依赖,如下:
dependency “com.google.guava:guava:18.0”
dependency “com.sun.istack:istack-commons-runtime:2.16”
dependency “com.sun.xml.fastinfoset:FastInfoset:1.2.12”