GithubHelp home page GithubHelp logo

sbt-onejar's Introduction

sbt-onejar: Package your project using One-JAR™*

sbt-onejar is a simple-build-tool plugin for building a single executable JAR containing all your code and dependencies as nested JARs.

Currently One-JAR version 0.9.7 is used. This is included with the plugin, and need not be separately downloaded.

Requirements

Requires SBT 0.12.x, or 0.13.x

Users of SBT 0.7.x are directed to the v0.2.

Currently, you need to include the setting exportJars := true if you have a multi-project build. (Example)

Obtaining

Depend on the plugin by editing project/plugins.sbt:

addSbtPlugin("org.scala-sbt.plugins" % "sbt-onejar" % "0.8")

Introduce Settings

Include the settings from com.github.retronym.SbtOneJar.oneJarSettings.

You can configure mainClass in oneJar := Some("com.acme.Woozler"). It defaults to mainClass in run in Compile.

Examples

Usage

run one-jar task to generate, erm, one JAR. Run it with java -jar <jarname>.

What's in the JAR?

As an example of the structure, here is the contents of scalaz-example_2.8.1-5.1-SNAPSHOT-onejar.jar, a package built from the Scalaz examples module.

.
|-- META-INF
|           `-- MANIFEST.MF
|-- OneJar.class
|-- boot-manifest.mf
|-- com
|   `-- simontuffs
|       `-- onejar
|           |-- Boot$1.class
|           |-- Boot$2.class
|           |-- Boot$3.class
|           |-- Boot.class
|           |-- Handler$1.class
|           |-- Handler.class
|           |-- IProperties.class
|           |-- JarClassLoader$1.class
|           |-- JarClassLoader$2.class
|           |-- JarClassLoader$ByteCode.class
|           |-- JarClassLoader$FileURLFactory$1.class
|           |-- JarClassLoader$FileURLFactory.class
|           |-- JarClassLoader$IURLFactory.class
|           |-- JarClassLoader$OneJarURLFactory.class
|           |-- JarClassLoader.class
|           |-- OneJarFile$1.class
|           |-- OneJarFile$2.class
|           |-- OneJarFile.class
|           `-- OneJarURLConnection.class
|-- doc
|   `-- one-jar-license.txt
|-- lib
|   |-- scala-library.jar
|   |-- scalaz-core_2.8.1-5.1-SNAPSHOT.jar
|   |-- scalaz-example_2.8.1-5.1-SNAPSHOT.jar
|   |-- scalaz-geo_2.8.1-5.1-SNAPSHOT.jar
|   |-- scalaz-http_2.8.1-5.1-SNAPSHOT.jar
|   `-- servlet-api-2.5.jar
|-- main
    `-- scalaz-example_2.8.1-5.1-SNAPSHOT.jar

How does it compare to XXX?

There are other ways to package your application. I based this plugin on Coda Hale's sbt-assembly which builds an über-JAR, directly containing all classes and resources merged together. This approach must be used carefully when there are resources with the same name across multiple JARs.

Kris Nuttycombe's sbt-proguard-plugin also creates an über-JAR, with the possibility to obfuscate and shrink. This is popular for targeting Android. Proguard is a powerful tool, and it takes some effort to configure it correctly.

One-JAR employs some classloader magic to sidestep the über-JAR limitations. It does support classpath scanning, as used in Spring and Hibernate, although there seems to be a performance penalty for this. But if your application, or its libraries, also relies on classloader trickery, you might run into some problems. Caveat Emptor.

Looking for something else? One of these might suit: WebStart, Exe4J, jsmooth, izpack.

http://stackoverflow.com/questions/1967549/java-packaging-tools-alternatives-for-jsmooth-launch4j-onejar

Bugs

Please report bugs and feature requests to the GitHub issue tracker. Bugs with small sample project will get the most attention. Forks and Pull Requests are also welcome.

Problems with One-JAR itself should be reported on it's Issue Tracker

License

Copyright (c) 2011-2011 Jason Zaugg

Published under The MIT License, see LICENSE

The One-JAR License is reproduced below. This plugin is not endorsed in anyway by One-JAR.

One-JAR (http://one-jar.sourceforge.net). Copyright (c) 2004, P. Simon Tuffs ([email protected]). All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

Neither the name of P. Simon Tuffs, nor the names of any contributors, nor the name One-JAR may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

sbt-onejar's People

Contributors

eed3si9n avatar jvirtanen avatar retronym avatar xuwei-k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sbt-onejar's Issues

Taking a lot of time when running with aspectj jar as javaagent

I am using one-jar to package my application. I am also using aspectj for some of the functionality. However, it is taking too much time (5min- 15min) just to start the jar file if I provide the javaagent as the aspectjweaver jar file. It is working fine if I run through sbt, with no delay in weaving. Is there anything I can do to make it faster ?
Also, I guess, I have to explicitly provide the javaagent while running the jar file. Is it not able to take it from the build.sbt, or am I missing something ?

use one-jar for deploy

I need to build a single jar for my module so that it can be used as a javaagent.

I have a multi-module sbt project and this particular module is the lowest level one.

Can I use OneJar to override how the lowest level module is packaged?

Extract contents of main/<projectname>.jar into <projectname>-one-jar.jar before final packaging

One-Jar-Expand might help here as well, but I think not requiring runtime expansion of the fat jar is nicer.

The purpose of this would be to support libraries that cannot handle nested JARs such as (embedded) Jetty. The problem with e.g. Jetty is that it's not able to find .jsp files from within nested JARs just always reporting a 404.

I think adding a setting to enable the "splatting" of the main jar directly into the final jar would not be a difficult task but would provide a clean solution for the aforementioned problem.

If, on the other hand, OneJar already supports this, it would be nice to be able to pass the respective setting through to it via sbt-onejar settings.

modify dependency classpath

I want configuration folder config/* to be part of classpath but not part of -one.jar, how can I achieve this ? Because I want deployment to be
xyz.one-jar.jar
config/

I don't want config to be compiled in jars.

One-Jar as a global plugin

I don't know if this is a bug report, a feature request or a request for additional documentation.

I would like to be able to use one-jar as a global plugin, i.e. declared not in my project but in "~/.sbt/plugins/".

However, according to the documentation in the README (https://github.com/sbt/sbt-onejar/blob/master/README.md), I need to add settings (https://github.com/retronym/sbt-onejar/blob/master/src/sbt-test/one-jar/basic/build.sbt#L1) to my project's build.sbt.

Now, if a user who doesn't have one-jar installed as a global plugin clones my project and tries to run sbt, he will get the following error:

build.sbt:22: error: object github is not a member of package com
seq(com.github.retronym.SbtOneJar.oneJarSettings: _*)
        ^
[error] Type error in expression
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?

Ideally, I would like not to be required to add anything to a project's "build.sbt" in order to use one-jar on this project. Would this be possible? Would it be possible to implement the necessary features to make this possible, at least for simple projects with a single main class?

If it is really necessary to add something in "build.sbt", would it be possible to make it in such a way that users without one-jar globally installed would still be able to run SBT without seeing the error above?

Finally, in case I misunderstood the README documentation somehow, could you please add some remarks in the documentation, explaining how to use one-jar as a globally installed plugin, as I described above?

Thanks!
Best regards!

include main/resources in the jar

Hello,
I have a file in main/resources and I want to include it in the jar. It is not included when running one-jar. Is there a way to include it ?

Unresolved dependencies with sbtVersion=0.12, scalaVersion=2.9.2

[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: com.github.retronym#sbt-onejar;0.7: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested attributes.
[warn] com.github.retronym:sbt-onejar:0.7 (sbtVersion=0.12, scalaVersion=2.9.2)
[warn]
sbt.ResolveException: unresolved dependency: com.github.retronym#sbt-onejar;0.7: not found
at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:214)
at sbt.IvyActions$$anonfun$update$1.apply(IvyActions.scala:122)
at sbt.IvyActions$$anonfun$update$1.apply(IvyActions.scala:121)
at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:114)
at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:114)
at sbt.IvySbt$$anonfun$withIvy$1.apply(Ivy.scala:102)
at sbt.IvySbt.liftedTree1$1(Ivy.scala:49)
at sbt.IvySbt.action$1(Ivy.scala:49)
at sbt.IvySbt$$anon$3.call(Ivy.scala:58)
at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:75)
at xsbt.boot.Locks$GlobalLock.withChannelRetries$1(Locks.scala:58)
at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:79)
at xsbt.boot.Using$.withResource(Using.scala:11)
at xsbt.boot.Using$.apply(Using.scala:10)
at xsbt.boot.Locks$GlobalLock.liftedTree1$1(Locks.scala:51)
at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:51)
at xsbt.boot.Locks$.apply0(Locks.scala:30)
at xsbt.boot.Locks$.apply(Locks.scala:27)
at sbt.IvySbt.withDefaultLogger(Ivy.scala:58)
at sbt.IvySbt.withIvy(Ivy.scala:99)
at sbt.IvySbt.withIvy(Ivy.scala:95)
at sbt.IvySbt$Module.withModule(Ivy.scala:114)
at sbt.IvyActions$.update(IvyActions.scala:121)
at sbt.Classpaths$$anonfun$work$1$1.apply(Defaults.scala:951)
at sbt.Classpaths$$anonfun$work$1$1.apply(Defaults.scala:949)
at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$54.apply(Defaults.scala:972)
at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$54.apply(Defaults.scala:970)
at sbt.Tracked$$anonfun$lastOutput$1.apply(Tracked.scala:35)
at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:974)
at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:969)
at sbt.Tracked$$anonfun$inputChanged$1.apply(Tracked.scala:45)
at sbt.Classpaths$.cachedUpdate(Defaults.scala:977)
at sbt.Classpaths$$anonfun$45.apply(Defaults.scala:856)
at sbt.Classpaths$$anonfun$45.apply(Defaults.scala:853)
at sbt.Scoped$$anonfun$hf10$1.apply(Structure.scala:586)
at sbt.Scoped$$anonfun$hf10$1.apply(Structure.scala:586)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:49)
at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply$12.apply(Structure.scala:311)
at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply$12.apply(Structure.scala:311)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:41)
at sbt.std.Transform$$anon$5.work(System.scala:71)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:232)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:232)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
at sbt.Execute.work(Execute.scala:238)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:232)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:232)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
error sbt.ResolveException: unresolved dependency: com.github.retronym#sbt-onejar;0.7: not found

Unresolved dependency when using sbt-0.11.2

I get an unresolved dependency error when I try to use sbt-onejar 0.6 from sbt-0.11.2. Here's my plugins.sbt:

resolvers += "retronym-releases" at "http://retronym.github.com/repo/releases"

addSbtPlugin("com.github.retronym" % "sbt-onejar" % "0.6")

And here's the error message:

[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: com.github.retronym#sbt-onejar;0.6: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn] 
[warn]  Note: Some unresolved dependencies have extra attributes.  Check that these dependencies exist with the requested attributes.
[warn]      com.github.retronym:sbt-onejar:0.6 (sbtVersion=0.11.2, scalaVersion=2.9.1)
[warn] 
[error] {file:/Users/dlee/prj/operator/node-agent/project/}root/*:update: sbt.ResolveException: unresolved dependency: com.github.retronym#sbt-onejar;0.6: not found

What's weird is that I can see a link to the artifact in the repo (http://retronym.github.com/repo/releases/com/github/retronym/), but get a 404 if I click on it (http://retronym.github.com/repo/releases/com/github/retronym/sbt-onejar_2.9.1_0.11.2/0.6/sbt-onejar-0.6.jar).

How to disable warnings on launch of produced jar?

I've used the sbt-onejar plugin to package my app as single jar. When I invoke it using "java -jar my-jar.jar" I get tons of warnings like these:

JarClassLoader: Warning: JDOMAbout$Author.class in lib/jdom-1.1.jar is hidden by lib/jdom-1.0.jar (with different bytecode)
JarClassLoader: Warning: JDOMAbout$Info.class in lib/jdom-1.1.jar is hidden by lib/jdom-1.0.jar (with different bytecode)
JarClassLoader: Warning: JDOMAbout.class in lib/jdom-1.1.jar is hidden by lib/jdom-1.0.jar (with different bytecode)
JarClassLoader: Warning: org/jdom/adapters/AbstractDOMAdapter.class in lib/jdom-1.1.jar is hidden by lib/jdom-1.0.jar (with different bytecode)
JarClassLoader: Warning: org/jdom/adapters/CrimsonDOMAdapter.class in lib/jdom-1.1.jar is hidden by lib/jdom-1.0.jar (with different bytecode)

Is there some way to turn this noise off?

Support SBT 1.0 and Scala 2.12

Hi,
tried this plugin with SBT 1.0 and Scala 2.12 and I saw it's not supported.
Just wanted to know if the project is still maintained.

I was having troubles with Akka and sbt-assembly so I made some changes to make this plugin working with this configuration.

Failed to run a jar in Docker

I have an sbt project with a very basic class. It works perfectly but when I'm trying to run it in Docker using simple docker run imagename command it throws

Error: Could not find or load main class java -jar scala_test_trash_2.11-1.0-one-jar.jar

Main class:

package com

object Main extends App {
  println("Testing hello world.")
}

build.sbt:

import com.github.retronym.SbtOneJar
import com.github.retronym.SbtOneJar.oneJar
import sbt.Keys.mainClass

name := "scala_test_trash"

version := "0.1"

scalaVersion := "2.11.12"

lazy val rootProject = (project in file("."))
  .settings(
    Seq(exportJars := true),
    SbtOneJar.oneJarSettings,
    libraryDependencies ++= Seq(
      "com.google.cloud" % "google-cloud-pubsub" % "0.34.0-beta",
      "com.sendgrid" % "sendgrid-java" % "2.2.2"
    ),
    mainClass in oneJar := Some("com.Main")
  )

plugins.sbt:

addSbtPlugin("org.scala-sbt.plugins" % "sbt-onejar" % "0.8")

Dockerfile:

FROM gcr.io/google_appengine/openjdk
WORKDIR /test_service
ADD ./target/scala-2.11/scala_test_trash_2.11-0.1-one-jar.jar /test_service
CMD ["java -jar scala_test_trash_2.11-1.0-one-jar.jar"]

RuntimeFailure

java.lang.IllegalArgumentException: URI is not hierarchical
    at java.io.File.<init>(File.java:418)
Exception in thread "main" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.simontuffs.onejar.Boot.run(Boot.java:340)
    at com.simontuffs.onejar.Boot.main(Boot.java:166)
Caused by: java.lang.ExceptionInInitializerError

This runs fine when being executed by sbt run

Excluding jars

Is there a way to exclude certain lib jars? For example, I don't want to include the scala-library.jar since I am using this in a java only project. Also, I have a library that is needed for compilation only and not at runtime.

Scala object not found

Hey hey,

Just tried to add one-jar to extradoc that I forked to see if one could create a binary version negating the need for shell scripts and using the one-jar sbt plugin results in:

λ java -jar extradoc_2.8.0-0.1-SNAPSHOT-onejar.jar
error: fatal error: object scala not found.
one error found

You see this error when the scala library cannot be properly loaded. Any ideas? I'm unsure if this is a direct issue with the plugin or one-jar itself. There was some funky stuff going on with one-jar which was why I have ditched it at work in favour of Apache Shade.

Cheers, Tim

sbt 0.11.3 version

sbt-onejar plugin 0.7 works on sbt 0.11.2 but I want to upgrade sbt to 0.11.3.
It seems that sbt-onejar plugin is ready for sbt 0.11.3 by this commit:
65a61c1

Is the version of sbt-onejar plugin for sbt 0.11.3 already published?
or Are there a plan to release the new version which support sbt 0.11.3?

Pass One-Jar-Expand to sbt-onejar

There don't seem to be a setting or an obvious way to set the One-Jar-Expand attribute you'd normally set by means of a boot-manifest.mf file in the root directory.

Could this be added to sbt-onejar in one way or another?

Default to mainClass in run in Compile not working

I have 2 main classes in my project. Just specifying any of these:

mainClass := Some("project.App")

mainClass in run := Some("project.App")

mainClass in compile := Some("project.App")

will bring up the "Multiple main classes detected, select one to run" dialog in sbt (0.13.0). Using the oneJar scope works. If working as intended, the documentation should be updated.

sbt loads sbt-onejar but rejects one-jar command

After adding plugin to build.sbt, sbt loaded sbt-onejar but then complained "one-jar" is not a valid command???

Java HotSpot(TM) Client VM warning: ignoring option MaxPermSize=256m; support wa
s removed in 8.0
[info] Loading project definition from C:\scala\db\project
[info] Updating {file:/C:/scala/db/project/}db-build...
[info] Resolving org.scala-sbt.ivy#ivy;2.3.0-sbt-2cf13e211b2cb31f0d3b317289dca70
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.s
cala-sbt.plugins/sbt-onejar/scala_2.10/sbt_0.13/0.8/jars/sbt-onejar.jar ...
[info]  [SUCCESSFUL ] org.scala-sbt.plugins#sbt-onejar;0.8!sbt-onejar.jar (2216m
s)
[info] Done updating.
[info] Set current project to db (in build file:/C:/scala/db/)
> one-jar
[error] Not a valid command: one-jar
[error] Not a valid key: one-jar (similar: on-load, unmanaged-jars, export-jars)

[error] one-jar
[error]        ^

Duplicate jars

IMO having duplicate jars is pretty common for a moderately sized project. with sbt one-jar i get this error. I do not seem to find any help to avoid this.

[error] ...*:one-jar: java.util.zip.ZipException: duplicate entry: lib/slf4j-log4j12-1.6.1.jar

Thanks

References to undefined settings

When running oneJar with the following configuration:

  lazy val utils = Project(id="utils", base=file("utils"), settings=utilsSettings)
  val utilsSettings = Seq(
      name := "Utilities",
      version := "1.0.0",
      organization := "myorg",
      libraryDependencies ++= Seq(  
        "org.scalatest" %% "scalatest" % "1.6.1" % "test",

        "org.apache.httpcomponents" % "httpclient" % "4.1.2"
      ),
      unmanagedClasspath in Compile := (file("ant/testlib") ** "*.jar").get.classpath,
      unmanagedClasspath in Runtime := (file("ant/testlib") ** "*.jar").get.classpath,
      mainClass := Some("foo"),
      artifactPath in SbtOneJar.oneJar := file("/tmp/foo.jar"),
      projectID in SbtOneJar.oneJar := ModuleID("a","b","c"),
      exportJars := true
  ) ++ SbtOneJar.oneJarSettings

I get

[error] References to undefined settings: 
[error] 
[error]   utils/compile:package-bin from utils/*:mappings(for one-jar)
[error] 
[error]   utils/runtime:dependency-classpath from utils/*:mappings(for one-jar)
[error] 
[error]   utils/*:module-name from utils/*:artifact(for one-jar)
[error] 
[error]   utils/*:cache-directory(for one-jar) from utils/*:cache-directory(for one-jar)
[error] 
[error]   utils/*:target from utils/*:base-directory(for one-jar-redist)
[error] 
[error]   utils/*:cross-target(for one-jar) from utils/*:artifact-path(for one-jar)
[error]  
[error] Use 'last' for the full log.

Packaging Seems To Ignore Existing Artifact

Hiya,

Not sure if this is by design, but I'm assuming that if I'm in SBT and type...

one-jar

one-jar

...the second invocation should do no work. However it always seems to rebuild the artifact.

My SBT foo isn't strong enough to work out whether this is a missing dependency rule or something else.

Make it more obvious that `one-jar` should be run after `package`

If I understand correctly how sbt-onejar operates then one needs to run the package command first to generate all the "normal" JARs, and only then run the one-jar command to have those compiled into a big fat JAR with the dependencies. However, if the package command hasn't been run previously, one-jar will still happily produce a non-working JAR with just the dependencies in it. I think this serves no value and should be fixed either by automatically running package or displaying an error message.

Good job

As a novice to Scala, I like your plugin very much. It is explained very clearly in the readme, it is compact and it works.

Include main-class name in jar name or generate multiple jars

Currently if your project has multiple main classes, you must select one when running one-jar, but the resultant jar file always has the same name. It would be nice to either (a) automatically include the main class's name in the jar file name, or generate a one-jar for each main class that exists.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.