When I check out https://github.com/alexeyr/scala-time and build it once using Maven, everything works fine. Then I touch src/main/scala/org/scala_tools/time/Implicits.scala to trigger a recompilation. Run mvn compile again, and I get 56 errors similar to
[ERROR] F:\MyProgramming\scala-time\src\main\scala\org\scala_tools\time\StaticDateTime.scala:29: error: value second is not a member of Int
[ERROR] def nextSecond = now + 1.second
It appears not to see the implicits defined in the touched file and imported with import org.scala_tools.time.Implicits._. But at the same time there is no error object Implicits is not a member of package org.scala_tools.time, as I would expect to see in this case.
After mvn clean it can be compiled once without error again.
Can anybody reproduce this?
If yes, how can I fix it?
UPDATE: it also happens with SBT, but only if Implicits.scala is actually changed enough to produce different class files (e.g. add a line object Implicits2 extends Implicits). And the set of errors is different!
I can recreate the error without
maven, so it looks like this might be an issue with howscalacis being used (or a bug withscalac):(the
sedcommand just resolves the.m2directory inscalac-args)Where
scalac-argsisAnd the proper jars have already been downloaded.
If I replace
target/classeswithtarget/classes/org/scala_tools/time/in the-classpathargument, then it works fine then.So it looks like the
maven-scala-pluginexpectsscalacto look in package-appropriate subdirectories when given a directory on the path, butscalacisn't doing that. I'm not sure who's wrong.