13

I was trying to use the jira-rest-java-client provided by Atlassian in a Scala program I am developing. I am using Eclipse as my 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.

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. The compile showed me this error:

Missing dependency 'class javax.annotation.Nullable'

Any ideas?

Jeffrey Cameron
  • 9,975
  • 10
  • 45
  • 77

2 Answers2

22

I found the answer in this issue on googlecode: http://code.google.com/p/guava-libraries/issues/detail?id=1095. To correct the problem in sbt you need to add this dependency:

"com.google.code.findbugs" % "jsr305" % "1.3.+"
Jeffrey Cameron
  • 9,975
  • 10
  • 45
  • 77
0

The Scala compiler requires all annotation classes in the classpath. 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.

In my built.sbt I had the following line:

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.

Andrey E
  • 856
  • 8
  • 18