scalor-maven-plugin
scalor-maven-plugin copied to clipboard
Scala library doesn't get picked if it's in test scope
Hello,
I have a project (Gatling based) that only contains test sources, hence only test dependencies (that pull scala-library transitively).
I then get the following crash:
java.lang.RuntimeException: Missing library, see: defineAuto, regexScalaLibrary.
at com.carrotgarden.maven.scalor.util.Error$Throw$.apply (Error.scala:34)
at com.carrotgarden.maven.scalor.base.ParamsCompiler.$anonfun$defineFindLibrary$1 (Params.scala:253)
at scala.Option.getOrElse (Option.scala:121)
at com.carrotgarden.maven.scalor.base.ParamsCompiler.defineFindLibrary (Params.scala:253)
at com.carrotgarden.maven.scalor.base.ParamsCompiler.defineFindLibrary$ (Params.scala:251)
at com.carrotgarden.maven.scalor.CompileMainMojo.defineFindLibrary (CompileMojo.scala:113)
Things work if I change the scope of the library to compile, but it's not right. I'd like to advertise this plugin to Gatling users, but this one is a blocker for me.
@Andrei-Pozolotin gentle ping
The problem is that resolveCustomInstall triggers at compile phase, but MavenProject#getArtifacts is lazily populated and only contains test artifacts at test phase.
Maybe compile phase should be bypassed upstream if there's nothing to compile (src/main doesn't contain any *.scala files).
WDYT?
ok, thinking