วันศุกร์ที่ 26 กันยายน พ.ศ. 2551

[ Apache Maven ] how to install Apache Maven on ubuntu linux

Easy installation

$ apt-get install maven2


to verify that it is correctly installed.
$ mvn --version


Manual installation ( working from zip file )

1. download Apache Maven
2. install using instruction in README.txt

1) Unpack the archive where you would like to store the binaries, eg:
$ tar xvjf apache-maven-2.0.8-bin.tar.bz2


2) A directory called "apache-maven-2.0.x" will be created.

3) Add the bin directory to your PATH, eg:

Unix-based Operating Systems (Linux, Solaris and Mac OS X)
export PATH=/usr/local/apache-maven-2.0.x/bin:$PATH


two ways to permanently set path is
way 1 edit /etc/environment
way 2 write .bash_aliases at your home directory
and add

export PATH = YOUR OLD PATH:/usr/local/apache-maven-2.0.x/bin


delete comment to execute .bash_aliases in .bashrc
and run

$ source .bashrc


However, you can edit your classpath in .bashrc directly as well.

4) Make sure JAVA_HOME is set to the location of your JDK

default jdk of ubuntu is openjdk, you may have to install java 6
and this is how to find jdk-6 path --> go to snaptic right click at sun-java6-jdk > Properties

and you can add JAVA_HOME variable in the same way that you add PATH variable.
i.e.
export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.06/

5) Run

$ mvn --version


to verify that it is correctly installed.

Maven Dependency

 list page : http://mvnrepository.com/

http://mvnrepository.com/artifact/javax.servlet/servlet-api

http://mvnrepository.com/artifact/org.testng/testng

http://mvnrepository.com/artifact/com.couchbase.client/couchbase-client

Maven Plugin

list page : https://maven.apache.org/plugins/


https://maven.apache.org/plugins/maven-compiler-plugin/

https://maven.apache.org/plugins/maven-war-plugin/

http://tomcat.apache.org/maven-plugin.html
ref : https://tomcat.apache.org/maven-plugin-trunk/tomcat7-maven-plugin/plugin-info.html

https://maven.apache.org/surefire/maven-surefire-plugin/

pom.xml

   
      1.6
   
    X.X.X
    com.xxx
    xxx
    war
    xxx
    x.x.x
    xxx

    
       
       
            
       
       
            
       
    

    
        
    

    
        
        
    

ไม่มีความคิดเห็น:

LinkWithin

Related Posts Plugin for WordPress, Blogger...