scala - Why is there no Main-Class attribute in generated manifest? -



scala - Why is there no Main-Class attribute in generated manifest? -

i have build.sbt file includes assembly plugin. until recent build, main-class attribute beingness included in assembled far jar, of sudden, no longer case.

when effort run jar, inimitable:

no main manifest attribute, in ./target/scala-2.10/foo-0.3.0-snapshot.jar

but using run sbt console, works fine.

my build.sbt looks (the mainclass in assembly added in effort forcefulness indicate assembly plugin should include, though noticed in plugin source code, looks it's checking 1 specified run anyway).

import assemblykeys._ name := "foo" version := "0.3.0-snapshot" organization := "com.mycompany.myproduct" scalaversion := "2.10.4" mainclass in (compile, run) := some("processrelogger") mainclass in assembly := some("processrelogger") assemblysettings librarydependencies ++= seq( "org.scalatest" % "scalatest_2.10" % "1.9.2" % "test", "ch.qos.logback" % "logback-classic" % "1.0.9", "com.typesafe.akka" %% "akka-actor" % "2.2.4", "joda-time" % "joda-time" % "2.3", "com.rabbitmq" % "amqp-client" % "3.3.4", "org.scalaz" % "scalaz-core_2.10" % "7.0.6", "com.typesafe.slick" %% "slick" % "2.0.2", "postgresql" % "postgresql" % "9.1-901.jdbc4", "com.escalatesoft.subcut" %% "subcut" % "2.0" )

and when unzip jar file, , check meta-inf/manifest.mf, there's no main-class: attribute included.

this effort reproduce issue latest version of sbt-assembly 0.11.2.

project/build.properties

sbt.version=0.13.7-m3

project/assembly.sbt

addsbtplugin("com.eed3si9n" % "sbt-assembly" % "0.11.2")

build.sbt

import assemblykeys._ assemblysettings scalaversion := "2.11.2"

src/main/scala/main.scala

object helloapp extends app { println("hello") }

with files above in single project:

> [info] updating {file:/users/jacek/sandbox/sbt-assembly/}sbt-assembly... [info] resolving jline#jline;2.12 ... [info] done updating. [info] sbt 0.13.7-m3 [info] current project {file:/users/jacek/sandbox/sbt-assembly/}sbt-assembly 0.1-snapshot [info] current project built against scala 2.11.2 [info] available plugins: sbt.plugins.ivyplugin, sbt.plugins.jvmplugin, sbt.plugins.coreplugin, sbt.plugins.junitxmlreportplugin, com.typesafe.sbteclipse.plugin.eclipseplugin, net.virtualvoid.sbt.graph.plugin, com.github.tototoshi.sbt.musical.plugin, com.timushev.sbt.updates.updatesplugin, sbtassembly.plugin [info] sbt, sbt plugins, , build definitions using scala 2.10.4 > assembly [info] updating {file:/users/jacek/sandbox/sbt-assembly/}sbt-assembly... [info] resolving jline#jline;2.12 ... [info] done updating. [info] compiling 1 scala source /users/jacek/sandbox/sbt-assembly/target/scala-2.11/classes... [info] including: scala-library-2.11.2.jar [info] checking every *.class/*.jar file's sha-1. [info] merging files... [warn] merging 'meta-inf/manifest.mf' strategy 'discard' [warn] strategy 'discard' applied file [info] sha-1: a5c09d7626fe19f4e3cd98d709966a77f127b048 [info] packaging /users/jacek/sandbox/sbt-assembly/target/scala-2.11/sbt-assembly-assembly-0.1-snapshot.jar ... [info] done packaging. [success] total time: 4 s, completed oct 8, 2014 9:27:41 > eval "unzip -p target/scala-2.11/sbt-assembly-assembly-0.1-snapshot.jar meta-inf/manifest.mf" ! manifest-version: 1.0 implementation-title: sbt-assembly implementation-version: 0.1-snapshot specification-vendor: default specification-title: sbt-assembly implementation-vendor-id: default specification-version: 0.1-snapshot main-class: helloapp implementation-vendor: default [info] ans: int = 0

scala sbt sbt-assembly

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -