problem with executing "sbt clean assembly" command
N-NSH opened this issue · comments
Hi dear friends,
I have problems with executing "sbt clean assembly" command, whenever i use the command "sbt clean" it works well, but it does not recognize "sbt assembly" as a known command.I use centos 7.
I appreciate any help.
Thanks in advance
Most likely you are running the command from the wrong directory. You need to be in the root directory of the project, i.e. mqtt-mongo
. SBT will find the assembly plugin in project/plugins.sbt
. Here is a sequence of commands that should work assuming you checked out the project to mqtt-mongo
directory:
# go to the root directory of the project
cd mqtt-mongo
# download sbt runner script, i.e local sbt install
./get_sbt.sh
# run sbt and build the jar
./sbt clean assembly
# now you can run the jar with
java -jar target/scala-2.11/mqtt-mongo-assembly-0.1.jar
Please paste console output if this does not work for some reason.
Cheers.
Thanks dear,
but unfortunately i still have problems.
I've downloaded your project and put it in ~/mqtt-mongo-master path.
output:
[root@localhost mqtt-mongo-master]# ./sbt clean assembly
Downloading sbt launcher for 0.13.13:
From http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/0.13.13/sbt-launch.jar
To /root/.sbt/launchers/0.13.13/sbt-launch.jar
Download failed. Obtain the jar manually and place it at /root/.sbt/launchers/0.13.13/sbt-launch.jar
Do you think that i installed sbt incorrectly? or sth like this.
I also do the instructions on windows 8. I just downloaded your project and put the extracted file under c drive. here is the output:
C:\mqtt-mongo-master>get_sbt.sh
C:\mqtt-mongo-master>sbt clean assembly
C:\mqtt-mongo-master>rem Download this JAR to this dir: https://repo.typesafe.co
m/typesafe/ivy-releases/org.scala-sbt/sbt-launch/0.13.7/sbt-launch.jar?_ga=1.476
12455.1882964693.1406200696
C:\mqtt-mongo-master>set SCRIPT_DIR=C:\mqtt-mongo-master\
C:\mqtt-mongo-master>java -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256m -Xm
x1024M -Xss2M -jar "C:\mqtt-mongo-master\sbt-launch.jar" clean assembly
Unrecognized VM option 'MaxPermSize=256m'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
I also downloaded the sbt-launch.jar file in in the mqtt-mongo-master folder.
Hi @useruseri . There are 2 ways to install SBT - either: 1) with a package manager on Unix / installer on Windows, or 2) via the get_sbt.sh
=> sbt
script provided which will download the jar for you and place it in your home directory - uses: https://github.com/paulp/sbt-extras.
In your first case on Linux there is probably some network error. You should be able to download the jar with wget
or in some other way. Alternatively you can install sbt with a package manager like yum install sbt
or similar. Take a look at the official SBT installation instructions if everything else fails.
In the second case on Windows remove the MaxPermSize=256m
or other unsupported command line arguments. The error you are getting is that this option is not recognized. Try to run with java -jar sbt-launch.jar clean assembly
.
I might add auto-publish of the built jar to maven if I find some time.