我嘗試用Scala和EclipseLink JPA爲我的項目創建一個帶有sbt和sbt-assembly插件的胖jar包,但彙編命令失敗,因爲eclipse.inf文件將發現兩次。通過用sbt和sbt-assembly創建一個胖罐子來解決eclipselink的相關性問題?
> assembly
[info] Including from cache: commonj.sdo-2.1.1.jar
[info] Including from cache: javax.persistence-2.1.0.jar
[info] Including from cache: scala-library.jar
[info] Including from cache: eclipselink-2.5.1.jar
[info] Run completed in 38 milliseconds.
[info] Checking every *.class/*.jar file's SHA-1.
[info] Merging files...
[warn] Merging 'org\eclipse\persistence\descriptors\copying' with strategy 'rename'
[warn] Merging 'META-INF\MANIFEST.MF' with strategy 'discard'
[trace] Stack trace suppressed: run last *:assembly for the full output.
[error] (*:assembly) deduplicate: different file contents found in the following:
[error] C:\Users\u987\WebApps\gr\lib_managed\jars\org.eclipse.persistence\javax.persistence\jav ax.persistence-2.1.0.jar:META-INF/eclipse.inf
[error] C:\Users\u987\WebApps\gr\lib_managed\jars\org.eclipse.persistence\commonj.sdo\commonj.sdo-2.1.1.jar:META-INF/eclipse.inf
我build.sbt樣子:
import AssemblyKeys._
name := "TelegramReceiver"
version := "0.1"
scalaVersion := "2.10.3"
retrieveManaged in ThisBuild := true
libraryDependencies ++= Seq(
"org.scalatest" % "scalatest_2.10" % "2.0" % "test",
"org.eclipse.persistence" % "eclipselink" % "2.5.1"
)
我嘗試從SBT組件插件與mergeStrategy來解決問題,但它不工作。我使用sbt 0.13.1。
在此先感謝您的幫助!
您能否提供您的合併策略和期望結果的示例。你有'eclipse.inf'完全相同的內容,如果不是你想保留哪一個? –