[英]Missing dependency 'class javax.annotation.Nullable'
I was trying to use the jira-rest-java-client provided by Atlassian in a Scala program I am developing. 我正在尝试在我正在开发的Scala程序中使用Atlassian提供的jira-rest-java-client。 I am using Eclipse as my IDE. 我使用Eclipse作为我的IDE。
When I have an object of type Issue and I try to look at the properties I see there are far fewer properties than are declared in the Java code. 当我有一个类型为Issue的对象时,我试着查看我看到的属性,它们的属性远远少于Java代码中声明的属性。
I thought perhaps this was just Eclipse not finding all properties/methods of an object so I tried putting Issue.getSummary() and doing an sbt compile. 我想也许这只是Eclipse没有找到对象的所有属性/方法所以我尝试放置Issue.getSummary()并进行sbt编译。 The compile showed me this error: 编译向我显示了这个错误:
Missing dependency 'class javax.annotation.Nullable' 缺少依赖项'class javax.annotation.Nullable'
Any ideas? 有任何想法吗?
I found the answer in this issue on googlecode: http://code.google.com/p/guava-libraries/issues/detail?id=1095 . 我在googlecode上找到了这个问题的答案: http : //code.google.com/p/guava-libraries/issues/detail ?id = 1095 。 To correct the problem in sbt you need to add this dependency: 要纠正sbt中的问题,您需要添加此依赖项:
"com.google.code.findbugs" % "jsr305" % "1.3.+"
The Scala compiler requires all annotation classes in the classpath. Scala编译器需要类路径中的所有注释类。 As this class is not available in the classpath, the compilation fails. 由于此类在类路径中不可用,因此编译失败。 In my particular case, the class is not used by the application. 在我的特定情况下,应用程序不使用该类。 Hence, it is sufficient to disable the fatal-warnings
option in the build. 因此,在构建中禁用fatal-warnings
选项就足够了。
In my built.sbt
I had the following line: 在我的built.sbt
我有以下几行:
scalacOptions ++= Seq("-Yno-adapted-args", "-Ywarn-dead-code", "-Ywarn-numeric-widen", "-Ywarn-value-discard", "-Xfatal-warnings")
I removed the "-Xfatal-warnings"
and compilation was successful. 我删除了"-Xfatal-warnings"
并且编译成功。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.