compiles with maven but not in intellij

I'm trying to compile scouchdb with intellij.  Maven compiles sucessfully, but when I create an intellij file from the pom.xml and add scala facet I get errors.


Steps to reproduce:

# first need to install sjson  to local maven repo (version included in the embedded repo is old)

 

git clone git://github.com/debasishg/sjson.git
cd sjson

# the current at time of writing is: 
git checkout 6bec0590edabb06cf55a81018f4b79e7a5330819
mvn install


# Now get scouchdb
git clone git://github.com/debasishg/scouchdb.git
cd scouchdb
 
# the current at time of writing is: 

git checkout bdd540464242db3032a3e2036680cadb31c4fffc
mvn clean compile

# build  successful

From intellij open pom.xml
right click scouchdb module
select add framework support
check scala
click use libraries
check maven:org-scala-lang-scala-library.2.7.7
and  maven:org-scala-lang-scala-compiler.2.7.7
press okay
now Build->Rebuild Project

I get the following compiler errors... even though it just compiled fine with maven!

Information:Compilation completed with 20 errors and 9 warnings
Information:20 errors
Information:9 warnings
/home/kurtharriger/src/scouchdb/src/main/scala/scouch/db/RichRequest.scala
    Error:Error:line (12)error: class Post needs to be abstract, since method getHttpVersion in trait HttpMessage of type ()org.apache.http.HttpVersion is not defined
class Post(val value: Any, val contentType: Option[String]) extends HttpPost {
/home/kurtharriger/src/scouchdb/src/test/scala/scouch/db/ScalaViewServerSpec.scala
    Error:Error:line (13)error: not found: value Options
import Options._
    Error:Error:line (15)error: attribute argument needs to be a constant; found: classOf[JUnitRunner]
@RunWith(classOf[JUnitRunner])
/home/kurtharriger/src/scouchdb/src/test/scala/scouch/db/SCouchDbSpec.scala
    Error:Error:line (13)error: not found: value Options
import Options._
    Error:Error:line (16)error: attribute argument needs to be a constant; found: classOf[JUnitRunner]
@RunWith(classOf[JUnitRunner])
    Error:Error:line (108)error: value code is not a member of java.lang.Throwable
e.code should equal(409)
    Error:Error:line (118)error: value code is not a member of java.lang.Throwable
e.code should equal(409)
    Error:Error:line (635)error: value code is not a member of java.lang.Throwable
e.code should equal(304)
    Error:Error:line (697)error: value code is not a member of java.lang.Throwable
e.code should equal(403)
/home/kurtharriger/src/scouchdb/src/test/scala/scouch/db/ScalaValidationSpec.scala
    Error:Error:line (13)error: not found: value Options
import Options._
    Error:Error:line (17)error: attribute argument needs to be a constant; found: classOf[JUnitRunner]
@RunWith(classOf[JUnitRunner])
    Error:Error:line (92)error: value code is not a member of java.lang.Throwable
e.code should equal(403)
    Error:Error:line (152)error: value code is not a member of java.lang.Throwable
e.code should equal(403)
    Error:Error:line (182)error: value code is not a member of java.lang.Throwable
e.code should equal(403)
    Error:Error:line (225)error: value code is not a member of java.lang.Throwable
e.code should equal(403)
    Error:Error:line (286)error: value code is not a member of java.lang.Throwable
e.code should equal(403)
/home/kurtharriger/src/scouchdb/src/test/scala/scouch/db/ViewServerWithObjectsSpec.scala
    Error:Error:line (13)error: not found: value Options
import Options._
    Error:Error:line (17)error: attribute argument needs to be a constant; found: classOf[JUnitRunner]
@RunWith(classOf[JUnitRunner])
    Error:Error:line (56)error: value make is not a member of Any
item.make should equal("BMW")
    Error:Error:line (57)error: value model is not a member of Any
item.model should equal("Mini")




I was having the same problem on my other machine last night but some how managed to get it working, how I'm not sure exactly.  I was trying to create a minimal project necessary to reproduce the issue based of maven scala simple archetype  adding only whats necessary... so then killed pretty much everything in scouchdb except pom.xml and richrequest.scala and no compiler error added everything back in and it was working.... now creating a project using the exact same steps as above on that machine work fine.. but not on this one so I'm at a loss... is there some cache somewhere outside the project directory that I might need to purge? have already tried purging my maven repo, but this doesn't seem to help it already builds with maven... just not intellij.
1 comment
Comment actions Permalink

Nevermind.... fixed it.

File -> Invalidate Caches

I'll remember that one next time!!!

0

Please sign in to leave a comment.