Y compris arbitraires Classpath entrées dans le projet SBT
Question
J'ai des pots installés sur le système que je veux inclure dans le classpath de mon projet de SBT. À unmanagedClasspath serait l'ajout semble être la voie, mais il rechigne à toute valeur avec des barres obliques -y -. Ne sais pas pourquoi
À l'heure actuelle je les suivantes, qui ajoute avec succès le répertoire « lib » sous mon projet au classpath:
import sbt._
class OvationImporterProject(info: ProjectInfo) extends DefaultProject(info)
{
override def unmanagedClasspath: PathFinder =
{
super.unmanagedClasspath +++ "lib"
}
}
Si j'essaie d'ajouter un chemin absolu là-bas que je reçois le texte suivant:
java.lang.IllegalArgumentException: requirement failed: Path component '/opt/jauimodel/lib/' must not have forward slashes in it at scala.Predef$.require(Predef.scala:112) at sbt.Path$.checkComponent(Path.scala:176) at sbt.RelativePath.(Path.scala:113) at sbt.Path.$div(Path.scala:34) at sbt.Project$class.path(Project.scala:143) at sbt.BasicScalaProject.path(DefaultProject.scala:21) at OvationImporterProject.unmanagedClasspath(OvationImporter.scala:7) ....
Y at-il une bonne façon de le faire?
Merci!
La solution
essayer super.unmanagedClasspath +++ Path.fromFile ( "/ opt / jauimodel / lib /")
ne « lib » peut déclencher relativePath qui déclenchera la méthode checkComponent pour vérifier si.
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow