Steps to install RSB using jar files:
-------------------------------------
install maven
set up project
http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html
add rsb code
download jar
give path for jars
mvn install:install-file -DgroupId=rsb -DartifactId=rsb -Dversion=0.11.0 -Dpackaging=jar -Dfile=/usr/share/java/rsb-0.11.0.jar
mvn install:install-file -DgroupId=rsb -DartifactId=protobuf -Dversion=2.4.1 -Dpackaging=jar -Dfile=/usr/share/java/protobuf-java-2.4.1.jar
add dependency in pom file :
rsb
rsb
0.11.0
compile
rsb
protobuf
2.4.1
compile
should compile with this , but if want executable jar to have dependency then add below lines to pom file:
org.apache.maven.plugins
maven-jar-plugin
2.2
org.apache.maven.plugins
maven-assembly-plugin
2.2-beta-4
jar-with-dependencies
org.sample.App
package
single
run command:
mvn package
to compile with dependency :
mvn clean dependency:copy-dependencies package
to run jar:
java -cp target/my-app-1.0-SNAPSHOT-jar-with-dependencies.jar com.mycompany.app.App
useful links:
http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html
http://stackoverflow.com/questions/574594/how-can-i-create-an-executable-jar-with-dependencies-using-maven
http://stackoverflow.com/questions/1814526/problem-building-executable-jar-with-maven
http://maven.apache.org/guides/mini/guide-configuring-plugins.html
http://docs.cor-lab.de/build%20system%20essentials-tutorial/trunk/html/build-system-java.html
output:
dragon@dragon:~/rsb/my-app$ java -cp target/my-app-1.0-SNAPSHOT-jar-with-dependencies.jar com.mycompany.app.App
19 Jan, 2014 8:09:17 PM rsb.transport.socket.BusServer$AcceptorThread run
INFO: Waiting for new client connection
19 Jan, 2014 8:09:18 PM rsb.transport.socket.BusServer deactivate
INFO: Trying to deactivate BusServer.
19 Jan, 2014 8:09:18 PM rsb.transport.socket.BusServer$AcceptorThread run
INFO: Shutting down due to request and closed socket.
Steps to install RSB from the source :
-------------------------------------
install maven
set up project
http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html
Installation of RSC and RSBProtocol:
Steps same as the steps for ant on CORLAB site
Build and install RSC Library:
Steps same as the steps for ant on CORLAB site
Need to edit this :
Step 2 and 3 on corlab site Build and install RSC Library
mkdir -p build && cd build
no need of cd build as there are no cmake file in build folder and this gives error
need to specify what in "prefix" install dir is build dir or new dir
download rsb code for corlab site
run mvnprep.sh
changes in pom.xml
UTF-8
/homes/ssharma/rsb/proj/share/rsbprotocol0.11
/usr/bin/protoc
2.4.1
target/generated-protocol
/homes/ssharma/rsb/proj/sbin/spread
1.6
mvn install
mvn test