Include Dependencies in JAR using SBT package
Apparently project dependencies are not being packaged into the jar generated by:
sbt package
How can dependencies be included?
scala sbt
add a comment |
Apparently project dependencies are not being packaged into the jar generated by:
sbt package
How can dependencies be included?
scala sbt
github.com/sbt/sbt-assembly
– dmitry
Sep 30 '15 at 8:38
1
scala-sbt.org/sbt-native-packager
– Aaron
Sep 30 '15 at 8:50
@dmitry Has problems with Spark. Stackoverflow is loaded with similar interop problems.
– BAR
Sep 30 '15 at 8:52
@Aaron +1 for learning something new. docs and activity look good. attempting this.
– BAR
Sep 30 '15 at 9:02
stackoverflow.com/questions/38335207/…
– Barbaros Alp
Jul 13 '16 at 12:22
add a comment |
Apparently project dependencies are not being packaged into the jar generated by:
sbt package
How can dependencies be included?
scala sbt
Apparently project dependencies are not being packaged into the jar generated by:
sbt package
How can dependencies be included?
scala sbt
scala sbt
asked Sep 30 '15 at 6:33
BAR
6,3901164122
6,3901164122
github.com/sbt/sbt-assembly
– dmitry
Sep 30 '15 at 8:38
1
scala-sbt.org/sbt-native-packager
– Aaron
Sep 30 '15 at 8:50
@dmitry Has problems with Spark. Stackoverflow is loaded with similar interop problems.
– BAR
Sep 30 '15 at 8:52
@Aaron +1 for learning something new. docs and activity look good. attempting this.
– BAR
Sep 30 '15 at 9:02
stackoverflow.com/questions/38335207/…
– Barbaros Alp
Jul 13 '16 at 12:22
add a comment |
github.com/sbt/sbt-assembly
– dmitry
Sep 30 '15 at 8:38
1
scala-sbt.org/sbt-native-packager
– Aaron
Sep 30 '15 at 8:50
@dmitry Has problems with Spark. Stackoverflow is loaded with similar interop problems.
– BAR
Sep 30 '15 at 8:52
@Aaron +1 for learning something new. docs and activity look good. attempting this.
– BAR
Sep 30 '15 at 9:02
stackoverflow.com/questions/38335207/…
– Barbaros Alp
Jul 13 '16 at 12:22
github.com/sbt/sbt-assembly
– dmitry
Sep 30 '15 at 8:38
github.com/sbt/sbt-assembly
– dmitry
Sep 30 '15 at 8:38
1
1
scala-sbt.org/sbt-native-packager
– Aaron
Sep 30 '15 at 8:50
scala-sbt.org/sbt-native-packager
– Aaron
Sep 30 '15 at 8:50
@dmitry Has problems with Spark. Stackoverflow is loaded with similar interop problems.
– BAR
Sep 30 '15 at 8:52
@dmitry Has problems with Spark. Stackoverflow is loaded with similar interop problems.
– BAR
Sep 30 '15 at 8:52
@Aaron +1 for learning something new. docs and activity look good. attempting this.
– BAR
Sep 30 '15 at 9:02
@Aaron +1 for learning something new. docs and activity look good. attempting this.
– BAR
Sep 30 '15 at 9:02
stackoverflow.com/questions/38335207/…
– Barbaros Alp
Jul 13 '16 at 12:22
stackoverflow.com/questions/38335207/…
– Barbaros Alp
Jul 13 '16 at 12:22
add a comment |
2 Answers
2
active
oldest
votes
There's a project called onejar that will package a project and all its dependencies into a single jar file. There is an SBT plugin as well:
https://github.com/sbt/sbt-onejar
However if you're just looking to create a standard package (deb, rpm, etc.) there is sbt-native-packager:
https://github.com/sbt/sbt-native-packager
It can place all your dependencies into a Linux package and add the appropriate wrappers to load all your dependencies and start your program or service.
add a comment |
Well, I use sbt-assembly
plugin to create jar with dependencies,
(1) add sbt-assembly
to projects/assembly.sbt
echo 'addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.8")' > project/assembly.sbt
(2) run sbt clean assembly
to build the jar.
It will create ${name}-assembly-${version}.jar
in target/scala-${scalaVersion}
(3) Only in case you get infamous de-duplicate error, use assemblyMergeStrategy
as described in here
1
Note that sbt-assembly is not available for scala 2.11 (and never will be)
– HansHarhoff
Feb 17 at 13:43
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f32859316%2finclude-dependencies-in-jar-using-sbt-package%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
There's a project called onejar that will package a project and all its dependencies into a single jar file. There is an SBT plugin as well:
https://github.com/sbt/sbt-onejar
However if you're just looking to create a standard package (deb, rpm, etc.) there is sbt-native-packager:
https://github.com/sbt/sbt-native-packager
It can place all your dependencies into a Linux package and add the appropriate wrappers to load all your dependencies and start your program or service.
add a comment |
There's a project called onejar that will package a project and all its dependencies into a single jar file. There is an SBT plugin as well:
https://github.com/sbt/sbt-onejar
However if you're just looking to create a standard package (deb, rpm, etc.) there is sbt-native-packager:
https://github.com/sbt/sbt-native-packager
It can place all your dependencies into a Linux package and add the appropriate wrappers to load all your dependencies and start your program or service.
add a comment |
There's a project called onejar that will package a project and all its dependencies into a single jar file. There is an SBT plugin as well:
https://github.com/sbt/sbt-onejar
However if you're just looking to create a standard package (deb, rpm, etc.) there is sbt-native-packager:
https://github.com/sbt/sbt-native-packager
It can place all your dependencies into a Linux package and add the appropriate wrappers to load all your dependencies and start your program or service.
There's a project called onejar that will package a project and all its dependencies into a single jar file. There is an SBT plugin as well:
https://github.com/sbt/sbt-onejar
However if you're just looking to create a standard package (deb, rpm, etc.) there is sbt-native-packager:
https://github.com/sbt/sbt-native-packager
It can place all your dependencies into a Linux package and add the appropriate wrappers to load all your dependencies and start your program or service.
answered Dec 1 '16 at 8:21
djsumdog
1,1681232
1,1681232
add a comment |
add a comment |
Well, I use sbt-assembly
plugin to create jar with dependencies,
(1) add sbt-assembly
to projects/assembly.sbt
echo 'addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.8")' > project/assembly.sbt
(2) run sbt clean assembly
to build the jar.
It will create ${name}-assembly-${version}.jar
in target/scala-${scalaVersion}
(3) Only in case you get infamous de-duplicate error, use assemblyMergeStrategy
as described in here
1
Note that sbt-assembly is not available for scala 2.11 (and never will be)
– HansHarhoff
Feb 17 at 13:43
add a comment |
Well, I use sbt-assembly
plugin to create jar with dependencies,
(1) add sbt-assembly
to projects/assembly.sbt
echo 'addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.8")' > project/assembly.sbt
(2) run sbt clean assembly
to build the jar.
It will create ${name}-assembly-${version}.jar
in target/scala-${scalaVersion}
(3) Only in case you get infamous de-duplicate error, use assemblyMergeStrategy
as described in here
1
Note that sbt-assembly is not available for scala 2.11 (and never will be)
– HansHarhoff
Feb 17 at 13:43
add a comment |
Well, I use sbt-assembly
plugin to create jar with dependencies,
(1) add sbt-assembly
to projects/assembly.sbt
echo 'addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.8")' > project/assembly.sbt
(2) run sbt clean assembly
to build the jar.
It will create ${name}-assembly-${version}.jar
in target/scala-${scalaVersion}
(3) Only in case you get infamous de-duplicate error, use assemblyMergeStrategy
as described in here
Well, I use sbt-assembly
plugin to create jar with dependencies,
(1) add sbt-assembly
to projects/assembly.sbt
echo 'addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.8")' > project/assembly.sbt
(2) run sbt clean assembly
to build the jar.
It will create ${name}-assembly-${version}.jar
in target/scala-${scalaVersion}
(3) Only in case you get infamous de-duplicate error, use assemblyMergeStrategy
as described in here
edited Nov 21 at 2:45
answered Dec 1 '16 at 7:55
prayagupd
19.5k889136
19.5k889136
1
Note that sbt-assembly is not available for scala 2.11 (and never will be)
– HansHarhoff
Feb 17 at 13:43
add a comment |
1
Note that sbt-assembly is not available for scala 2.11 (and never will be)
– HansHarhoff
Feb 17 at 13:43
1
1
Note that sbt-assembly is not available for scala 2.11 (and never will be)
– HansHarhoff
Feb 17 at 13:43
Note that sbt-assembly is not available for scala 2.11 (and never will be)
– HansHarhoff
Feb 17 at 13:43
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f32859316%2finclude-dependencies-in-jar-using-sbt-package%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
github.com/sbt/sbt-assembly
– dmitry
Sep 30 '15 at 8:38
1
scala-sbt.org/sbt-native-packager
– Aaron
Sep 30 '15 at 8:50
@dmitry Has problems with Spark. Stackoverflow is loaded with similar interop problems.
– BAR
Sep 30 '15 at 8:52
@Aaron +1 for learning something new. docs and activity look good. attempting this.
– BAR
Sep 30 '15 at 9:02
stackoverflow.com/questions/38335207/…
– Barbaros Alp
Jul 13 '16 at 12:22