Adding vendor information to MANIFEST.MF using sbt-assembly

I use sbt-assembly to create a runnable jar, but my application crashes because jai imageio loads the provider name from the MANIFEST.MF file. If I manually edit the META-INF / MANIFEST.MF file with

Manifest-Version: 1.0 Main-Class: myMainClass 

to

 Implementation-Vendor: foo Implementation-Title: bar Implementation-Version: 1.0 Manifest-Version: 1.0 Main-Class: myMainClass 

Everything is working fine.

How to configure sbt or sbt-assembly to include this additional implementation information in the bank? Or is there another way?

(ps: link to where he is looking for information about the package: http://www.java.net/external?url=http://www.java2s.com/Open-Source/Java-Document/6.0-JDK- Modules / Java-Advanced-Imaging / com / sun / media / imageioimpl / common / PackageUtil.java.htm )

+7
source share
2 answers

I use sbt 0.11.2 and, sbt adds manifest information to the jar without any additional configuration :), I'm not sure why you have this problem.

This is an example of MANIFEST.MF squryl jar that I created locally

 Manifest-Version: 1.0 Implementation-Vendor: org.squeryl Implementation-Title: squeryl Implementation-Version: 0.9.5-rc1 Implementation-Vendor-Id: org.squeryl Specification-Vendor: org.squeryl Specification-Title: squeryl Specification-Version: 0.9.5-rc1 Main-Class: org.squeryl.logging.UsageProfileConsolidator 

but it can be configured in the build.sbt or Build.scala file

eg

  import sbt._ import Keys._ import sbt.Package.ManifestAttributes //...... //...... lazy val baseSettings = Defaults.defaultSettings ++ Seq( version := ProjectVersion, organization := Organization, scalaVersion := ScalaVersion, packageOptions := Seq(ManifestAttributes( ("Implementation-Vendor", "myCompany"), ("Implementation-Title", "myLib")))) 
+8
source

The problem is that the sbt build does not add default keys to MANIFEST.MF. The sbt package, on the other hand, does this, which is probably what Jestan Nirozhan uses it.

I created a problem for the sbt build plugin project on github. You can add a comment to increase the likelihood of a correction.

Watch it

0
source

All Articles