복붙노트

[SCALA] SBT의 DependsOn RootProject는 : 종속성을 컴파일되지 않습니다

SCALA

SBT의 DependsOn RootProject는 : 종속성을 컴파일되지 않습니다

나는 아주 간단한 구성을 가지고 :

  //lazy val bananaRdfProject = RootProject( uri("git://github.com:stample/banana-rdf.git#"+bananaGitBranch) )
  // lazy val bananaRdfProject = RootProject( uri("https://github.com/stample/banana-rdf.git#"+bananaGitBranch) )
  // lazy val bananaRdfProject = ProjectRef( uri("https://github.com/stample/banana-rdf.git#"+bananaGitBranch) ,"banana-rdf")
  lazy val bananaRdfProject = RootProject( file("../banana-rdf") )


  lazy val main = play.Project(appName, appVersion, appDependencies).settings(...)
                     .dependsOn( bananaRdfProject )

나는 bananaRdfProject에 대한 위의 4 명 가지 프로젝트 선언을 사용했습니다.

내가 로컬이 바나나 RDF를 편집 할 수 있습니다, 나는 내가 바나나 RDF를 게시 할 필요가 없습니다 것을, 그것이 내가 내 플레이 프로젝트를 빌드 할 때마다 다시 컴파일 할 ...

내 주요 재생 프로젝트, 그 용도 바나나-RDF를 컴파일 할 때, 그것은하지 컴파일 바나나 RDF를 수행하지만 시도는 주요 프로젝트를 컴파일 : 바나나 RDF 클래스가 클래스 경로에 없기 때문에 컴파일이 실패합니다.

sebastien@clemence-XPS-L412Z:rww-play (master *%)$ ./play.old/play
[info] Loading project definition from /home/sebastien/Bureau/rww-play/project
[warn] there were 1 deprecation warning(s); re-run with -deprecation for details
[warn] one warning found
[info] Loading project definition from /home/sebastien/Bureau/banana-rdf/project
[info] Updating {file:/home/sebastien/Bureau/banana-rdf/project/}banana-rdf-build...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Compiling 2 Scala sources to /home/sebastien/Bureau/banana-rdf/project/target/scala-2.10/sbt-0.13/classes...
[warn] there were 11 deprecation warning(s); re-run with -deprecation for details
[warn] there were 2 feature warning(s); re-run with -feature for details
[warn] two warnings found
[info] Set current project to RWWeb (in build file:/home/sebastien/Bureau/rww-play/)
       _
 _ __ | | __ _ _  _
| '_ \| |/ _' | || |
|  __/|_|\____|\__ /
|_|            |__/

play 2.2-TLS built with Scala 2.10.3-RC3 (running Java 1.7.0_45), http://www.playframework.com

> Type "help play" or "license" for more information.
> Type "exit" or use Ctrl+D to leave this console.

[RWWeb] $ compile
[info] Updating {file:/home/sebastien/Bureau/banana-rdf/}banana...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Updating {file:/home/sebastien/Bureau/rww-play/}RWWeb...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Compiling 53 Scala sources and 1 Java source to /home/sebastien/Bureau/rww-play/target/scala-2.10/classes...
[error] /home/sebastien/Bureau/rww-play/app/controllers/CORSProxy.scala:4: object banana is not a member of package org.w3
[error] import org.w3.banana.plantain.Plantain
[error]               ^
[error] /home/sebastien/Bureau/rww-play/app/controllers/CORSProxy.scala:7: not found: type Plantain
[error] object CORSProxy extends org.www.readwriteweb.play.CORSProxy[Plantain](webClient) 
.................

내 주요 프로젝트를 컴파일하기 전에 바나나 RDF를 컴파일 아닌가요? 그렇지 않은 경우, 외부 RootProject에 따라의 요점은 무엇입니까?

해결법

  1. ==============================

    1.RootProject (파일 ( "../ 바나나 RDF")) 프로젝트 참조는 루트 프로젝트, 그리고 당신이 정말 필요합니다 (RDF 하위 디렉토리에) 바나나-RDF의 하위 프로젝트에 대한 참조를 참조합니다.

    RootProject (파일 ( "../ 바나나 RDF")) 프로젝트 참조는 루트 프로젝트, 그리고 당신이 정말 필요합니다 (RDF 하위 디렉토리에) 바나나-RDF의 하위 프로젝트에 대한 참조를 참조합니다.

    사용 가능한 하위 프로젝트는 https://github.com/w3c/banana-rdf/blob/master/project/build.scala에 정의되어 있습니다. 몇 가지가 있습니다 :

    [main]> projects
    [info] In file:/Users/jacek/sandbox/stackoverflow/19832655/
    [info]   * main
    [info] In https://github.com/w3c/banana-rdf.git
    [info]     banana
    [info]     banana-jena
    [info]     banana-rdf
    [info]     banana-rdf-test-suite
    [info]     banana-sesame
    [info]     examples
    [info]     experimental
    [info]     ldp
    [info]     patch
    

    참조 바나나 RDF하려면 다음 빌드 구성의 오른쪽 모듈 (하위 프로젝트)에서 다음 ProjectRef 가리키는를 사용해야합니다. 바나나 RDF - 잘 하위 프로젝트의 이름으로 ProjectRef을합니다.

    lazy val bananaRdfProject =
      ProjectRef(uri("https://github.com/w3c/banana-rdf.git"), "banana-rdf")
    

    ProjectRef 사용하면 바나나 RDF의 하위 프로젝트에 정의 된 유형을 해석 할 수 있어야합니다.

  2. ==============================

    2.총 프로젝트와의 DependsOn 차이가 있습니다. 이 프로젝트는 클래스 패스에에서 난 당신이 모든 프로젝트가 함께 구축 얻기 위해 통합 할 필요가 있다고 생각이의 DependsOn 만 확인 클래스를 만들지 만, 물론 당신이 최근에 구축하지 않은 경우 오래된 유물이 될 수 있습니다. 더 많은 정보를 위해 SBT 문서를 체크 아웃 : http://www.scala-sbt.org/0.12.3/docs/Getting-Started/Multi-Project.html

    총 프로젝트와의 DependsOn 차이가 있습니다. 이 프로젝트는 클래스 패스에에서 난 당신이 모든 프로젝트가 함께 구축 얻기 위해 통합 할 필요가 있다고 생각이의 DependsOn 만 확인 클래스를 만들지 만, 물론 당신이 최근에 구축하지 않은 경우 오래된 유물이 될 수 있습니다. 더 많은 정보를 위해 SBT 문서를 체크 아웃 : http://www.scala-sbt.org/0.12.3/docs/Getting-Started/Multi-Project.html

  3. from https://stackoverflow.com/questions/19832655/sbt-dependson-rootproject-doesnt-compile-the-dependency by cc-by-sa and MIT license