Skip to content
William Zhang edited this page Sep 24, 2016 · 1 revision

How to install

Download the version. 3.3 for JDK 1.7 and 3.2 for JDK 1.6, http://archive.apache.org/dist/maven/maven-3/

$ tar -xzvf apache-maven-3.2.5-bin.tar.gz
$ sudo mv apache-maven-3.2.5 /usr/local/
$ sudo ln -s /usr/local/apache-maven-3.2.5/bin/mvn /usr/local/bin/mvn 

Looks like the following step is optional. And no need to setup JAVA_HOME.

$ cat ~/.bash_profile
export MAVEN_HOME=/usr/local/apache-maven-3.2.5
export PATH=${MAVEN_HOME}/bin:$PATH

$ mvn -v
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-15T01:29:23+08:00)
Maven home: /usr/local/apache-maven-3.2.5
...

Set up the settings: /usr/local/apache-maven-3.2.5/conf/settings.xml

Go to the top directory of a project with pom.xml file. To list the targets:

$ mvn

To comiple:

$ mvn compile

Tutorial

http://wiki.jikexueyuan.com/project/maven/creating-project.html http://wiki.jikexueyuan.com/project/maven/project-templates.html

$ mvn archetype:generate -DgroupId=org.abc.app -DartifactId=hello -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false

If you want to use `-’ in package names, see http://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html

Dependency

Edit it in Eclipse is easy. Edit the pom.xml file is also okay.

<dependencies>
	<dependency>
		<groupId>com.github.shyiko</groupId>
		<artifactId>mysql-binlog-connector-java</artifactId>
		<version>0.2.3-SNAPSHOT</version>
		<scope>system</scope>
		<systemPath>${basedir}/src/lib/mysql-binlog-connector-java-0.2.3-SNAPSHOT.jar</systemPath>
	</dependency>
</dependencies>
Clone this wiki locally