<dependency>
<groupId>somegroup</groupId>
<artifactId>someartifact</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
<dependencyManagement>
<dependency>
<groupId>somegroup</groupId>
<artifactId>someartifact</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
</dependencyManagement>
<dependency>
<groupId>somegroup</groupId>
<artifactId>someartifact</artifactId>
<!-- není nutné specifikovat verzi -->
</dependency>
<dependency>
<groupId>sample.ProjectA</groupId>
<artifactId>Project-A</artifactId>
<version>1.0</version>
<scope>compile</scope>
<exclusions>
<exclusion> <!-- declare the exclusion here -->
<groupId>sample.ProjectB</groupId>
<artifactId>Project-B</artifactId>
</exclusion>
</exclusions>
</dependency>
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>cz.voho</groupId>
<artifactId>myproject</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>My Project</name>
<description>Sample project with a dependency</description>
<url>http://someproject.com/</url>
<dependencies>
<dependency>
<groupId>com.company</groupId>
<artifactId>somelibrary</artifactId>
<version>1.2.3</version>
</dependency>
</dependencies>
</project>
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>cz.voho</groupId>
<artifactId>myproject</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>My Project</name>
<description>Sample parent project with modules</description>
<url>http://someproject.com/</url>
<modules>
<module>module1</module>
<module>module2</module>
<module>module3</module>
</modules>
</project>
Nastavení enviroments variables(pro Win):
M2=maven-path\bin
M2_HOME=maven-path
do path přidat cestu k mvn (maven-path\bin)
Test že je vše ok – otevřete terminal a napište mvn –version.
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T18:29:23+01:00)
Maven home: /usr/local/Cellar/maven/3.2.5/libexec
Java version: 1.6.0_65, vendor: Apple Inc.
Java home: /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: cs_CZ, platform encoding: MacCentralEurope
OS name: "mac os x", version: "10.11.2", arch: "x86_64", family: "mac"