#AskMe

Sample layout pom.xml for Java project

To make you get into Maven 2 project easily, let’s have a look to pom.xml general layout for Java project, here it is:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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/maven-v4_0_0.xsd">

	<modelVersion>4.0.0</modelVersion>
    <groupId>com.osify.training</groupId>
    <artifactId>sample-java-training</artifactId>
    <packaging>jar</packaging>
    <name>Osify Training Sample</name>
    <description>Osify Training Sample</description>
	<version>1.0.0-SNAPSHOT</version>

	<parent/>
	<prerequisites />
	<repositories/> 

	<scm/>

	<properties/>

	<dependencies>
		<dependency/>
	</dependencies>	

	<build>
		<sourceDirectory>src/main/java</sourceDirectory>
		<outputDirectory>target/classes</outputDirectory>
		<testSourceDirectory>src/test/java</testSourceDirectory>

	    <resources>
			<resource>
				<directory>src/main/resources/conf</directory>
			</resource>	
			<resource/>
		</resources>
		<testResources>
			<testResource/>
		</testResources>
		<plugins>
			<plugin/>				
    	</plugins>
	</build>
</project>

Sort explanation of each elements:

Full list explanation, you can find at http://maven.apache.org/pom.html