<?xml version="1.0"?>
<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>
	
	<parent>	
		<groupId>org.sonatype.oss</groupId>
		<artifactId>oss-parent</artifactId>
		<version>7</version>
	</parent>	

	<groupId>org.dihedron.commons</groupId>
	<artifactId>dihedron-commons</artifactId>
	<version>1.1.0</version>
	<packaging>jar</packaging>
	<name>Core Utility Classes &amp; Patterns</name>
	
	<description>Base set of functionalities, including simple utility classes and more complex patterns.</description>

	<developers>
		<developer>
			<id>Dihedron</id>
			<name>Andrea Funtò</name>
			<email>dihedron.dev@gmail.com</email>
			<roles>
				<role>Lead Developer</role>
			</roles>
		</developer>
	</developers>
			
	<scm>	
		<connection>scm:git:git://github.com/dihedron/dihedron-commons.git</connection>
		<developerConnection>scm:git:git@github.com:dihedron/dihedron-commons.git</developerConnection>
		<url>http://github.com/dihedron/dihedron-commons</url>
	</scm>
	
	<licenses>
		<license>
			<comments>Copyright (C) Andrea Funtò 2012-2014 - All rights reserved</comments>
			<name>GNU Lesser General Public License ver. 3 or later</name>
			<url>http://www.gnu.org/licenses/lgpl.html</url>
		</license>
	</licenses>
		
	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>
		<sonar.language>java</sonar.language>
		
		<!-- this provides the ${timestamp} variable to resource filtering -->
		<timestamp>${maven.build.timestamp}</timestamp>

		<java.version>1.7</java.version>
		<slf4j.version>1.7.7</slf4j.version>
		<log4j.version>1.2.17</log4j.version>
		<junit.version>4.11</junit.version>
		<javaee.version>6.0</javaee.version>
	</properties>

	<build>
		<finalName>${project.artifactId}-${project.version}</finalName>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.2</version>
				<configuration>
					<encoding>UTF-8</encoding>
					<source>${java.version}</source>
					<target>${java.version}</target>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>2.10.1</version>
				<configuration>
					<bottom>
            <![CDATA[
              Copyright &copy; 2012-2014 Andrea Funt&ograve;. See <a href="{@docRoot}/doc-files/license.html">here</a> for terms and conditions.
            ]]>
					</bottom>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-resources-plugin</artifactId>
				<version>2.6</version>
				<configuration>
					<encoding>UTF-8</encoding>
				</configuration>
			</plugin>

			<!-- do not place POM and other Maven stuff in generated binaries (JARs and WARs) -->
			<plugin>				
				<artifactId>maven-jar-plugin</artifactId>
				<version>2.5</version>
				<configuration>
					<archive>
						<addMavenDescriptor>false</addMavenDescriptor>
						<manifest>
							<addClasspath>true</addClasspath>
						</manifest>
						<manifestEntries>
							<Codebase>*</Codebase>
							<Permissions>all-permissions</Permissions>
							<!-- 
							<Trusted-Library>true</Trusted-Library>
							-->
							<Application-Name>Dihedron - Common Utilities Library</Application-Name>
						</manifestEntries>
					</archive>					
				</configuration>
			</plugin>	
			<plugin>				
				<artifactId>maven-war-plugin</artifactId>
				<version>2.5</version>
				<configuration>
					<archive>
						<addMavenDescriptor>false</addMavenDescriptor>
					</archive>
				</configuration>
			</plugin>
		</plugins>

		<resources>
			<resource>
				<directory>src/main/resources</directory>
				<filtering>true</filtering>
			</resource>
		</resources>
	</build>
			
	<dependencies>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<scope>compile</scope>
		</dependency>
		<dependency>  
			<groupId>javax</groupId>  
			<artifactId>javaee-api</artifactId>    
			<scope>provided</scope>  
		</dependency>		
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-log4j12</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>log4j</groupId>
			<artifactId>log4j</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>			
	</dependencies>
	
	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-api</artifactId>
				<version>${slf4j.version}</version>
			</dependency>
			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-log4j12</artifactId>
				<version>${slf4j.version}</version>
			</dependency>
			<dependency>
				<groupId>log4j</groupId>
				<artifactId>log4j</artifactId>
				<version>${log4j.version}</version>
			</dependency>
			<dependency>
				<groupId>junit</groupId>
				<artifactId>junit</artifactId>
				<version>${junit.version}</version>
			</dependency>
			<dependency>  
				<groupId>javax</groupId>  
				<artifactId>javaee-api</artifactId>  
				<version>${javaee.version}</version>  
			</dependency>  	
		</dependencies>
	</dependencyManagement>
	
	<profiles>
		<profile>
			<id>release-profile</id>

			<activation>
				<property>
					<name>release</name>
					<value>true</value>
				</property>
			</activation>

			<build>
				<plugins>
					<plugin>
						<inherited>true</inherited>
						<artifactId>maven-source-plugin</artifactId>
						<executions>
							<execution>
								<id>attach-sources</id>
								<goals>
									<goal>jar</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<inherited>true</inherited>
						<artifactId>maven-javadoc-plugin</artifactId>
						<executions>
							<execution>
								<id>attach-javadocs</id>
								<goals>
									<goal>jar</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<inherited>true</inherited>
						<artifactId>maven-deploy-plugin</artifactId>
						<configuration>
							<updateReleaseInfo>true</updateReleaseInfo>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
