exclude jars with SBT assemble plugin

Rajeev

I am struggling to give exclude pattern in build.scala. I have seen few posts where they mentioned about build.sbt. I am new to sbt. Can someone help me to write exclude pattern in build.scala.

I want to exclude below two packages which causes error while running assembly : xmlbeans and xml-apis

Error : 
[trace] Stack trace suppressed: run last app/*:assembly for the full output.
[error] (app/*:assembly) deduplicate: different file contents found in the following:
[error] /Users/rajeevprasanna/.ivy2/cache/org.apache.xmlbeans/xmlbeans/jars/xmlbeans-2.3.0.jar:org/w3c/dom/TypeInfo.class
[error] /Users/rajeevprasanna/.ivy2/cache/xml-apis/xml-apis/jars/xml-apis-1.3.03.jar:org/w3c/dom/TypeInfo.class

I wrote build.scala in reference to this file : https://github.com/eed3si9n/sbt-assembly-full-config-sample/blob/master/project/builds.scala

Richard Close

Figure out which dependency ("oldstuff") is pulling in the wrong version of xmlbeans or xml-apis, and exclude one or both dependencies like so:

libraryDependencies ++= Seq(
  "org.old"  % "oldstuff"" % "0.5" 
     exclude ("org.apache.xmlbeans", "xmlbeans")
     exclude ("xml-apis", "xml-apis"),
  ...
  ...
)

You may need to look in your ~/.ivy2/cache directory to get the exact names.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to exclude LICENSE files in sbt-android-sdk plugin?

From Dev

How to exclude transitive dependency in Sbt ( in context of assembly plugin )?

From Dev

Downloading source jars in sbt?

From Dev

SBT unmanaged jars

From Dev

Maven Launch4j Plugin - how to configure to exclude jars used by the .exe?

From Dev

SBT: Get dependendOn projects as jars

From Dev

Gradle: Exclude distribution zip task from assemble

From Dev

How to exclude javascript dependencies using the sbt-scalajs plugin in a scalajs-react project?

From Dev

SBT: Exclude resource subdirectory

From Dev

SBT: Exclude resource subdirectory

From Dev

gradle exclude specific jars from runtime dependencies

From Dev

sbt-scoverage exclude syntax

From Dev

Using a custom sbt plugin

From Dev

SBT Plugin that adds Plugins

From Dev

SBT Scala Assembly Plugin

From Dev

Using a custom sbt plugin

From Dev

JaCoCo gradle plugin exclude

From Dev

maven exclude plugin in dependency

From Dev

Adding sbt native packager plugin in SBT

From Dev

Jenkens Plugin (build with Maven) and external jars

From Dev

Maven assembly plugin creates two unexpected jars

From Dev

How to customize where ServiceLoader looks for Plugin Jars

From Dev

Where does the lib directory for unmanaged jars in sbt directory structure go?

From Dev

Command line arguments not working for sbt-assembly jars

From Dev

sbt-assembly: prefix extracted files from some jars

From Dev

Can SBT resolve only .pom files as dependencies without jars?

From Dev

How to show download progress while SBT is downloading jars?

From Dev

How to show download progress while SBT is downloading jars?

From Dev

Sbt, local sbt plugin, using jooq code generation plugin

Related Related

HotTag

Archive