简体   繁体   English

如何构建更新的 Uber Java SDK? 需要 gradle 构建帮助

[英]How to build the updated Uber Java SDK? Assistance with gradle build required

So, I have been using maven for project management and have no idea on running gradle.所以,我一直在使用 maven 进行项目管理,对运行 gradle 一无所知。 This is the Uber Java sdk which uses Gradle for build purposes.这是使用 Gradle 进行构建的 Uber Java sdk。 https://github.com/uber/rides-java-sdk https://github.com/uber/rides-java-sdk

Until now I had been using the SDK by adding the following artifact to my pom.xml file:到现在为止,我一直通过将以下工件添加到我的 pom.xml 文件来使用 SDK:

<dependency>
    <groupId>com.uber.sdk</groupId>
    <artifactId>rides</artifactId>
    <version>0.2.0</version>
</dependency>

The last version which was officially released was 0.2.0.最后一个正式发布的版本是 0.2.0。 Since then, support for getting ride receipts has been added which can be seen in the source code.从那时起,添加了对获取乘车收据的支持,可以在源代码中看到。 I need to fetch ride receipts and hence require the latest changes.我需要获取乘车收据,因此需要最新的更改。

It seems the build.gradle file has a line "apply plugin: 'maven'" which should add the project to my local maven repo. build.gradle 文件似乎有一行“apply plugin: 'maven'”,它应该将项目添加到我的本地 maven 存储库中。 However, when I run gradle install, I get the following error:但是,当我运行 gradle install 时,出现以下错误:

Failed to notify task execution listener.未能通知任务执行侦听器。

Changelog must be updated with v{0.2.1} before release.更改日志必须在发布前更新为 v{0.2.1}。 Please check /home/user/projects/rides-java-sdk-master/CHANGELOG.md请检查/home/user/projects/rides-java-sdk-master/CHANGELOG.md

How do I rectify this error and get the latest build in my local maven repo?如何纠正此错误并在我的本地 maven 存储库中获取最新版本?

Edit:编辑:

After I changed the CHANGELOG.md file to begin with V0.2.1, I get the following error:在我将 CHANGELOG.md 文件更改为以 V0.2.1 开头后,出现以下错误:

FAILURE: Build failed with an exception. FAILURE:构建失败,出现异常。

  • What went wrong: Execution failed for task ':install'.出了什么问题:任务“:安装”执行失败。

    Could not publish configuration 'archives'无法发布配置“档案”

    Cannot publish artifact 'rides-java-sdk-master.zip (com.uber.sdk:rides-java-sdk-master:0.2.1)' (/home/nikhar/projects/rides-java-sdk-master/build/distributions/rides-java-sdk-master-0.2.1.zip) as it does not exist.无法发布工件 'rides-java-sdk-master.zip (com.uber.sdk:rides-java-sdk-master:0.2.1)' (/home/nikhar/projects/rides-java-sdk-master/build /distributions/rides-java-sdk-master-0.2.1.zip) 因为它不存在。

You shouldn't need to fork the repo, build it, or install the pom locally to get the latest chnages.您不需要 fork 存储库、构建它或在本地​​安装 pom 来获取最新的更改。 Just referencing the artifact from maven central (ie https://maven-repository.com/artifact/com.uber.sdk/rides/0.2.0 ) should work.只需从 maven central(即https://maven-repository.com/artifact/com.uber.sdk/rides/0.2.0 )引用工件就可以了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM