jitpack发布,记录一个异常

文章讲述了在使用Gradle构建过程中遇到的错误,因为GradleWrapper文件缺失导致编译器自动使用默认版本,引发了一系列问题。解决方法是将本地的GradleWrapper文件夹上传至项目,确保云端编译器能找到正确的配置。
摘要由CSDN通过智能技术生成

异常日志(全文):

Init SDKMan
Found Android manifest
Android SDK version: . Build tools: 
Found gradle
Gradle build script
WARNING: gradle/wrapper/gradle-wrapper.jar does not exist! Needs to be committed.

ERROR: Gradle wrapper not found. Please add. Using default gradle to build.

grep: gradle/wrapper/gradle-wrapper.properties: No such file or directory
Generating Gradle wrapper v 6.7.1
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2

Welcome to Gradle 4.8.1!

Here are the highlights of this release:
 - Dependency locking
 - Maven Publish and Ivy Publish plugins improved and marked stable
 - Incremental annotation processing enhancements
 - APIs to configure tasks at creation time

For more details see https://docs.gradle.org/4.8.1/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)
> Task :wrapper

BUILD SUCCESSFUL in 2s
1 actionable task: 1 executed
/home/jitpack/build
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2

------------------------------------------------------------
Gradle 4.8.1
------------------------------------------------------------

Build time:   2018-06-21 07:53:06 UTC
Revision:     0abdea078047b12df42e7750ccba34d69b516a22

Groovy:       2.4.12
Ant:          Apache Ant(TM) version 1.9.11 compiled on March 23 2018
JVM:          1.8.0_292 (Private Build 25.292-b10)
OS:           Linux 4.18.0-25-generic amd64

0m0.876s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-8u292-b10-0ubuntu1~16.04.1-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)
Getting tasks: gradle tasks --all
Tasks: 

 ⚠️   WARNING:
 Gradle 'publishToMavenLocal' task not found. Please add the 'maven-publish' or 'maven' plugin.
 See the documentation and examples: https://docs.jitpack.io

Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2

FAILURE: Build failed with an exception.

* Where:
Settings file '/home/jitpack/build/settings.gradle' line: 1

* What went wrong:
A problem occurred evaluating settings 'build'.
> Could not find method dependencyResolutionManagement() for arguments [settings_du0w93dyya4mvuwk4xgqxxi8a$_run_closure1@33bbcfb8] on settings 'build' of type org.gradle.initialization.DefaultSettings.

* 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

BUILD FAILED in 0s
Running: gradle -Pgroup=com.gitee.rumeng -Pversion=1.1.5 publishToMavenLocal
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2

FAILURE: Build failed with an exception.

* Where:
Settings file '/home/jitpack/build/settings.gradle' line: 1

* What went wrong:
A problem occurred evaluating settings 'build'.
> Could not find method dependencyResolutionManagement() for arguments [settings_du0w93dyya4mvuwk4xgqxxi8a$_run_closure1@345ac845] on settings 'build' of type org.gradle.initialization.DefaultSettings.

* 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

BUILD FAILED in 0s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2

FAILURE: Build failed with an exception.

* Where:
Settings file '/home/jitpack/build/settings.gradle' line: 1

* What went wrong:
A problem occurred evaluating settings 'build'.
> Could not find method dependencyResolutionManagement() for arguments [settings_du0w93dyya4mvuwk4xgqxxi8a$_run_closure1@81a8096] on settings 'build' of type org.gradle.initialization.DefaultSettings.

* 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

BUILD FAILED in 0s
Build tool exit code: 0
Looking for artifacts...
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
Looking for pom.xml in build directory and ~/.m2
2024-04-23T07:47:56.719525482Z
Exit code: 0

⚠️ ERROR: No build artifacts found

从上开始细看发现 ERROR: Gradle wrapper not found. Please add. Using default gradle to build
项目没有找到gradle wrapper,项目的目录gradle.wrapper下是有两个文件 gradle-wrapper.jargradle-wrapper.properties
再次回到项目上看,发现gitee仓库中并没有上传该文件夹,原来是已经被 .gitignore 排除了,所以项目在jitpack的云仓库中编译的时候没有找到,然后编译器就自适应给你配置了4.8.1版本的gradle;就有了后续一系列的编译问题。

解决办法:

将本地项目上使用的gradle.wrapper上传到项目,让云端编译器编译的时候能查询到项目使用的gradle配置

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值