If you see it

Live for passion

Maven Notes

1
2
3
4
5
6
7
$ mvn -v  
Apache Maven 3.0.3 (r1075438; 2011-02-28 09:31:09-0800)
Maven home: /usr/share/maven
Java version: 1.6.0_51, vendor: Apple Inc.
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x", version: "10.8.4", arch: "x86_64", family: "mac"

With Eclipse

Add this url to install m2e under “Install new software”. http://download.eclipse.org/technology/m2e/releases/

Create Eclipse project by maven
1
$ mvn eclipse:clean eclipse:eclipse

With IntelliJ

Install the plugins:

Maven 2 Integration
Maven Run Helper

Create IntelliJ project by maven
1
$ mvn idea:clean idea:idea

Noted Command

Running maven install without unit tests sometimes are useful cause it may take longer time for tests to finish and you want the artifact from mvn install.

1
2
3
4
$ mvn -Dmaven.test.skip=true install  
// --- OR ----

$ mvn install -DskipTests

Add maven central repository to pom.xml

1
2
3
4
5
6
7
8
9
10
11
<repositories>
    <repository>
      <id>central</id>
      <name>Maven Repository Switchboard</name>
      <layout>default</layout>
      <url>http://repo1.maven.org/maven2</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
  </repositories>

Generate a simple site running with Jetty

1
2
mvn site:site
mvn site:run

Comments