could not set unknown property sonatypeUsername for libraries of type ooh.gr

在使用gradle编译时,出现如下错误:

J:\zkclient-master>gradlew

FAILURE: Build failed with an exception.

  • Where:
    Build file ‘J:\zkclient-master\build.gradle’ line: 9
    7

  • What went wrong:
    A problem occurred evaluating root project ‘zkclient’.

No such property: sonatypeUsername for class: org.gradle.api.publication.maven
.internal.ant.DefaultGroovyMavenDeployer

  • Try:
    Run with –stacktrace option to get the stack trace. Run with –info or –debug
    option to get more log output.

BUILD FAILED

Total time: 2.82 secs

解决

在项目根目录创建名为gradle.properties的属性文件,在文件中输入下面的内容:

sonatypeUsername=
sonatypePassword=
sonatypeRepo=

然后保存,再编译,该错误即可消除。

    原文作者:sirai
    原文地址: https://www.jianshu.com/p/691fc7bb75cf
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞