【发布时间】:2019-12-30 07:41:23
【问题描述】:
我从https://github.com/square/okhttp克隆代码
我想看3.10.0版本的源码。
但是无法编译成功。
gongzelong:okhttp gongzelong$ git branch
master
* parent-3.10.0
gongzelong:okhttp gongzelong$ mvn clean verify
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] 'build.plugins.plugin[org.apache.maven.plugins:maven-surefire-plugin].dependencies.dependency.version' for org.mortbay.jetty.alpn:alpn-boot:jar must be a valid version but is '${alpn.jdk8.version}'. @ com.squareup.okhttp3:parent:3.10.0, /Users/gongzelong/Android/okhttp/pom.xml, line 320, column 28
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.squareup.okhttp3:okhttp:3.10.0 (/Users/gongzelong/Android/okhttp/okhttp/pom.xml) has 1 error
[ERROR] 'build.plugins.plugin[org.apache.maven.plugins:maven-surefire-plugin].dependencies.dependency.version' for org.mortbay.jetty.alpn:alpn-boot:jar must be a valid version but is '${alpn.jdk8.version}'. @ com.squareup.okhttp3:parent:3.10.0, /Users/gongzelong/Android/okhttp/pom.xml, line 320, column 28
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
添加我的答案中的代码后,它可以运行'mvn clean verify'
但 IDEA 显示如下错误:
【问题讨论】:
-
希望对您有所帮助:stackoverflow.com/a/55790149/9908240
-
@ViralPatel 谢谢,在本地添加 jar 之前,我希望找出它找不到 jar 的原因。 mvnrepository.com/artifact/org.mortbay.jetty.alpn/alpn-boot,它有 7.1.2.v20141202 alpn。但 IDEA 显示错误。
-
请提供日志或错误信息
-
@ViralPatel 关于 IDEA 错误,请检查屏幕截图。我的意思是错误显示在 IDEA 中。在我按照我在回答中所说的操作后,“mvn clean verify”现在可以正常工作了。
-
如何在 Gradle 中实现 okhttp?