Setup - Linux‎ > ‎

Spring ROO





Dependencies: JDK ; JRE ; APACHE MAVEN

 

1.     Installing JDK; JRE :

 

Ø For Ubuntu:

 

ü  -Download: Java JRE/JDK from oracle site: http://www.oracle.com/technetwork/java/javase/downloads/index.html

 

ü  Put the downloaded files under: /home/”username”/Downloads

 

ü  -Create java directory under /usr/local:

mkdir /usr/local/java

 

ü  -copy files in /usr/local/java:

o   sudo cp jdk-7u7-linux-x64.tar.gz /usr/local/java

o   sudo cp jre-7u7-linux-x64.tar.gz /usr/local/java

 

ü  -you should have two uncompressed directories:

o   ls -a

 

o   jdk1.6.0_37

o   jre1.6.0_37

 

ü  -edit /etc/profile with the appropriate system variables:

 

ü  type nano /etc/profile and add those lines below at the end of /etc/profile file:

 

o   JAVA_HOME=/usr/local/java/jdk1.6.0_37

o   PATH=$PATH:$HOME/bin:$JAVA_HOME/bin

o   JRE_HOME=/usr/local/java/jre1.6.0_37

o   PATH=$PATH:$HOME/bin:$JRE_HOME/bin

o   export JAVA_HOME

o   export JRE_HOME

o   export PATH

 

ü  -then save and exit

 

Now we have to inform Ubuntu Linux system where Java JDK/JRE is located:

 

ü  sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jre1.6.0_37/bin/java" 1

ü  sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/java/jdk1.6.0_37/bin/javac" 1

ü  sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/local/java/jre1.6.0_37/bin/javaws" 1

 

 

Then , We have to Inform Ubuntu Linux system that Java JDK/JRE must be the default Java:

 

ü  sudo update-alternatives --set java /usr/local/java/jre1.6.0_37/bin/java

ü  sudo update-alternatives --set javac /usr/local/java/jdk1.6.0_37/bin/javac

ü  sudo update-alternatives --set javaws /usr/local/java/jre1.6.0_37/bin/javaws

 

 

Reload system wide PATH /etc/profile:

ü  ./etc/profile

 

 

Test if java was installed correctly:

 

 

ü  java –version

ü  javac -version



Ø For Fedora:

 

ü  -Download JDK from Oracle site: http://download.oracle.com/otn-pub/java/jdk/6u37-b06/jdk-6u37-linux-x64-rpm.bin

 

-Install the rpm file :

ü  ./jdk-6u37-linux-x64-rpm.bin

 

-Then add the system variables into /etc/profile

 

ü  vi /etc/profile and those lines below at the end of the file:

 

ü  export JAVA_HOME=/usr/java/default

ü  export PATH=$PATH:$JAVA_HOME/bin

ü  export CLASSPATH=.:$JAVA_HOME/jre/lib:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar

 

ü  Reload system Wide PATH:

 

Ø  source /etc/profile

 

ü  -Test if JAVA was installed correctly:

 

 

Ø  java -version

Ø  javac -version




1.     Installing Maven :

 

                                                                                                         i.        On Ubuntu:

 

ü  Download maven from Apache repository:  http://maven.apache.org/download.html

ü  Unpack the maven Library into /usr/local:

ü  cd /usr/local

ü  sudo cp -R apache-maven-3.0.4 /usr/local

 

ü  -Create a symbolic link

sudo ln -s /usr/local/apache-maven-3.0.4/bin/mvn /usr/bin/mvn

 

ü  -check if maven was installed correctly:

mvn -version




Ø On fedora:

 

ü  Download maven from Apache repository:  http://maven.apache.org/download.html

ü  Unpack the maven Library into /usr/local:

ü  cd /usr/local

ü  sudo cp -R apache-maven-3.0.4 /usr/local

 

ü  -Create a symbolic link

              sudo ln -s /usr/local/apache-maven-3.0.4 maven

 

-Now we need to setup maven path:

 

ü  create and edit the file by :

vi /etc/profile.d/maven.sh

 

and add those lines below:

 

ü  export MV_HOME=/usr/local/maven

ü  export PATH=${MV_HOME}/bin:${PATH}

 

ü  Reload system PATH by typing: 

              source /etc/profile.d/maven.sh

 

ü  Then check if maven was installed correctly:

  mvn -version



1.  Installing Spring ROO :

 

a.      Getting Dependencies :

 

You need unzip package to extract files:

 

Ø For ubuntu:

Ø  sudo apt-get install -y unzip

 

 

Ø For fedora:

ü  yum install -y unzip

 

 

b.     ROO install :

 

ü  -Download Spring ROO from the official site : http://s3.amazonaws.com/dist.springframework.org/release/ROO/spring-roo-1.2.0.RELEASE.zip

ü  -Extract the downloaded file under : /usr/local

ü  unzip spring-roo-1.2.2.RELEASE.zip

 

ü  -rename the folder to spring-roo:

mv spring-roo-1.2.2.RELEASE spring-roo

 

Now depending on your system follow instructions:

Ø For Ubuntu :

-Set up the variables environment in /etc/profile by adding those lines below at the end of the file:

 

ü  export ROO_HOME=/usr/local/spring-roo

ü  PATH=${PATH}:$ROO_HOME/bin

ü  export PATH

 

ü  -Check if spring-roo was installed correctly:

o   create a test file: mkdir roo-test

o   Run roo command :roo.sh quit

 

(and you should have ROO logo as an output)

 

ü  remove the test file : rm -r roo-test







Ø For  fedora :

 

ü  -Set up the variables environment in /etc/profile.d/roo.sh by adding those lines below at the end of the file:

vi /etc/profile.d/roo.sh

 

ü  export ROO_HOME=/usr/local/spring-roo

ü  export PATH=${PATH}:$ROO_HOME/bin

 

ü  -Now reload the system Wide PATH:

source /etc/profile

 

ü  -Check if spring-roo was installed correctly:

ü  create a test file: mkdir roo-test

ü  Run roo command :roo.sh quit

 

(and you should have ROO logo as an output)

 

ü  remove the test file : rm -r roo-test




a.      Spring Roo :

 

Before going into the next step, make sure .....

 

 

Ø  mysql database has the mycp schema fully populated as specified in previous chapter <TODO>.

 

Ø  the database is accessible by the root user with password as "password", or change the user/password at <your mycp src location>\src\main\resources\META-INF\spring\database.properties

 

 

ü  Go to the location where you have downloaded the mycp source files and type  in roo.

 

Sometime, you should be able to see that roo is checking the database and updating the local source files and doing database  reverse engineering.





ü  Then do a perform clean and then a perform package


Now Maven will download all the needed jar files into your local  maven  repo and build mycloudportal war file.






If you get some maven dependency  issues, you can download those specific jar files and add it manually using the below command.

 

ü  mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> \

   -DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging>

 

ü  osgi  start –url   file:/// path/ to/ mysql/ connector /jar/ file /mysql-connector-java-5.1.18.jar

Now its time to import the project into STS IDE and start working on the project.

Comments