我使用以下sbt
項目結構中的IntelliJ 13.1的IntelliJ SBT插件在工程項目定義/ Build.scala
.
├── build.sbt
├── project
│ ├── Build.scala
│ ├── plugins.sbt
├── src
│ ├── main
│ └── test
└── target
我built.sbt
很簡單,我只是宣佈一些依賴。
我project/Build.scala
是一個有點複雜,它採用定義了一個新項目:
懶VAL RiepeteKernel =項目(ID = 「riepete內核」,基地=文件(),設置= defaultSettings 「」)
Intellij似乎不喜歡它。它設置在項目設置兩個附加的模塊,像這樣:
當我嘗試編譯我的項目,我得到以下錯誤:
Error:scalac: Output path /home/simao/code/riepete/project/target/idea-test-classes is shared between:
Module 'riepete-build' tests, Module 'riepete-kernel-build' tests Output path /home/simao/code/riepete/project/target/idea-classes
is shared between: Module 'riepete-build' production,
Module 'riepete-kernel-build' production Please configure separate output
paths to proceed with the compilation.
TIP: you can use Project Artifacts to combine compiled classes if needed.
因爲我只需要我的額外項目在控制檯上運行sbt dist
,如果我刪除intellij創建的一切正常的兩個附加模塊,但每次重新啓動intellij時都需要執行此操作。
有沒有辦法讓intellij不創建這兩個額外的模塊?
謝謝
你是否知道如果可以使用該宏創建一些'Settings'到項目中? 爲什麼不明智地拿起項目,如果它是這樣定義的?謝謝 – simao 2014-10-22 12:22:35
當然。這是可能的。您可以在項目中調用'settings'方法並添加您的設置:'lazy val riepete = project.in(file(「。」))。settings(....)。settings()',或者您可以使用普通方式。按照正常的方式,我的意思是添加設置鍵給你'build.sbt',例如:'libraryDependencies + = ....'。所有這些設置將被拾取。嘗試從'SBT'選項卡刷新項目(您可以在IntelliJ IDEA的右側邊欄中找到它)。如果不工作,您可以再次導入項目。刪除'.idea'文件夾並重新導入將是最後的解決方案。 – 2014-10-22 15:38:08
你好。是的,這工作。非常感謝! – simao 2014-10-23 16:10:02