Я могу воссоздать ошибку без maven
, поэтому похоже, что это может быть связано с тем, как используется scalac
(или ошибка с scalac
):
% rm -rf target
% mkdir -p target/classes
% cat scalac-args | sed "s;~;$HOME;g" | xargs scalac-2.9 # runs successfully
% cat scalac-args | sed "s;~;$HOME;g" | xargs scalac-2.9
#...
56 errors found
(команда sed
просто разрешает каталог .m2
в scalac-args
)
Где scalac-args
равно
-target:jvm-1.5
-classpath
~/.m2/repository/org/scala-lang/scala-library/2.9.1-1/scala-library-2.9.1-1.jar:~/.m2/repository/org/joda/joda-convert/1.2/joda-convert-1.2.jar:~/.m2/repository/joda-time/joda-time/2.1/joda-time-2.1.jar:target/classes
-d
target/classes
src/main/scala/org/scala_tools/time/DurationBuilder.scala
src/main/scala/org/scala_tools/time/Implicits.scala
src/main/scala/org/scala_tools/time/Imports.scala
src/main/scala/org/scala_tools/time/RichAbstractDateTime.scala
src/main/scala/org/scala_tools/time/RichAbstractInstant.scala
src/main/scala/org/scala_tools/time/RichAbstractPartial.scala
src/main/scala/org/scala_tools/time/RichAbstractReadableInstantFieldProperty.scala
src/main/scala/org/scala_tools/time/RichChronology.scala
src/main/scala/org/scala_tools/time/RichDate.scala
src/main/scala/org/scala_tools/time/RichDateMidnight.scala
src/main/scala/org/scala_tools/time/RichDateTime.scala
src/main/scala/org/scala_tools/time/RichDateTimeFormatter.scala
src/main/scala/org/scala_tools/time/RichDateTimeProperty.scala
src/main/scala/org/scala_tools/time/RichDateTimeZone.scala
src/main/scala/org/scala_tools/time/RichDuration.scala
src/main/scala/org/scala_tools/time/RichInstant.scala
src/main/scala/org/scala_tools/time/RichInt.scala
src/main/scala/org/scala_tools/time/RichLocalDate.scala
src/main/scala/org/scala_tools/time/RichLocalDateProperty.scala
src/main/scala/org/scala_tools/time/RichLocalDateTime.scala
src/main/scala/org/scala_tools/time/RichLocalDateTimeProperty.scala
src/main/scala/org/scala_tools/time/RichLocalTime.scala
src/main/scala/org/scala_tools/time/RichLocalTimeProperty.scala
src/main/scala/org/scala_tools/time/RichLong.scala
src/main/scala/org/scala_tools/time/RichMonthDay.scala
src/main/scala/org/scala_tools/time/RichMonthDayProperty.scala
src/main/scala/org/scala_tools/time/RichPartial.scala
src/main/scala/org/scala_tools/time/RichPartialProperty.scala
src/main/scala/org/scala_tools/time/RichPeriod.scala
src/main/scala/org/scala_tools/time/RichReadableDateTime.scala
src/main/scala/org/scala_tools/time/RichReadableDuration.scala
src/main/scala/org/scala_tools/time/RichReadableInstant.scala
src/main/scala/org/scala_tools/time/RichReadableInterval.scala
src/main/scala/org/scala_tools/time/RichReadablePartial.scala
src/main/scala/org/scala_tools/time/RichReadablePeriod.scala
src/main/scala/org/scala_tools/time/RichYearMonth.scala
src/main/scala/org/scala_tools/time/RichYearMonthProperty.scala
src/main/scala/org/scala_tools/time/StaticDateTime.scala
src/main/scala/org/scala_tools/time/StaticDateTimeFormat.scala
src/main/scala/org/scala_tools/time/StaticDateTimeZone.scala
src/main/scala/org/scala_tools/time/StaticDuration.scala
src/main/scala/org/scala_tools/time/StaticInterval.scala
src/main/scala/org/scala_tools/time/StaticLocalDate.scala
src/main/scala/org/scala_tools/time/StaticLocalDateTime.scala
src/main/scala/org/scala_tools/time/StaticLocalTime.scala
src/main/scala/org/scala_tools/time/StaticPartial.scala
src/main/scala/org/scala_tools/time/StaticPeriod.scala
А нужные банки уже загружены.
Если я заменим target/classes
на target/classes/org/scala_tools/time/
в аргументе -classpath
, тогда он будет работать нормально.
% rm -rf target
% mkdir -p target/classes
% cat scalac-args | sed "s;~;$HOME;g" | xargs scalac-2.9 # runs successfully
% cat scalac-args | sed "s;~;$HOME;g" | xargs scalac-2.9 # runs successfully
Похоже, что maven-scala-plugin
ожидает, что scalac
будет искать в подкаталогах, соответствующих пакетам, когда указан каталог на пути, но scalac
этого не делает. Я не уверен, кто не прав.