在使用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=
然后保存,再编译,该错误即可消除。
网友评论