<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>
	
	<prerequisites>
	    <maven>3.0.4</maven>	    
	</prerequisites>
	
	<!-- Make InfTec projects deployable on Central through sonatype -->
	<parent>
		<groupId>org.sonatype.oss</groupId>
		<artifactId>oss-parent</artifactId>
		<version>7</version>
	</parent>
	
	<groupId>ch.inftec</groupId>
	<artifactId>jb</artifactId>
	<version>1.1</version>
	<packaging>pom</packaging>

	<name>JB</name>
	<description>InfTec Java Base project that holds the root pom all other InfTec projects will derive from</description>

	<url>https://bitbucket.org/inftec/jb</url>
	<licenses>
		<license>
			<name>The Apache Software License, Version 2.0</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
			<distribution>repo</distribution>
		</license>
	</licenses>
	
	<scm>
    	<url>git@bitbucket.org:inftec/jb.git</url>
    	<connection>scm:git:git@bitbucket.org:inftec/jb.git</connection>
  	</scm>
  	
  	<developers>
  		<developer>
  			<id>mme</id>
  			<name>Martin Meyer</name>
  			<email>martin.meyer@inftec.ch</email>
  		</developer>
  	</developers>

	<modules>
		<module>jb-bom</module>
		<module>jb-bom-ee</module>
	</modules>

	<properties>
		<!-- Explicit declaration of Source Encoding -->
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		
		<!-- Plugin versions -->
		<version.maven-clean-plugin>2.5</version.maven-clean-plugin>
		<version.maven-compiler-plugin>3.1</version.maven-compiler-plugin>
		<version.maven-deploy-plugin>2.7</version.maven-deploy-plugin>
		<version.maven-install-plugin>2.5</version.maven-install-plugin>
		<version.maven-jar-plugin>2.4</version.maven-jar-plugin>
		<version.maven-ejb-plugin>2.3</version.maven-ejb-plugin>
		<version.maven-war-plugin>2.1.1</version.maven-war-plugin>
		<version.maven-ear-plugin>2.6</version.maven-ear-plugin>
		<version.maven-resources-plugin>2.6</version.maven-resources-plugin>
		<version.maven-site-plugin>3.3</version.maven-site-plugin>
		<version.maven-javadoc-plugin>2.9.1</version.maven-javadoc-plugin>
		<version.maven-eclipse-plugin>2.9</version.maven-eclipse-plugin>
		<version.maven-source-plugin>2.2.1</version.maven-source-plugin>
		<version.maven-jar-plugin>2.4</version.maven-jar-plugin>
		<version.maven-surefire-plugin>2.16</version.maven-surefire-plugin>
		<version.maven-failsafe-plugin>2.16</version.maven-failsafe-plugin>
		<version.version-maven-plugin>2.1</version.version-maven-plugin>
		<version.nexus-staging-maven-plugin>1.5.1</version.nexus-staging-maven-plugin>
		<version.build-helper-maven-plugin>1.8</version.build-helper-maven-plugin>
		<version.cargo-plugin>1.4.3</version.cargo-plugin>
		<version.jboss-as-maven-plugin>7.5.Final</version.jboss-as-maven-plugin>
	</properties>

	<build>
	    <pluginManagement>
	        <plugins>
	            <!-- Maven core plugins -->
	            <plugin>
	       			<artifactId>maven-clean-plugin</artifactId>
	            	<version>${version.maven-clean-plugin}</version>
	            </plugin>
	            <plugin>
	       			<artifactId>maven-compiler-plugin</artifactId>
	            	<version>${version.maven-compiler-plugin}</version>
	            </plugin>
	            <plugin>
	       			<artifactId>maven-deploy-plugin</artifactId>
	            	<version>${version.maven-deploy-plugin}</version>
	            </plugin>
	            <plugin>
	       			<artifactId>maven-install-plugin</artifactId>
	            	<version>${version.maven-install-plugin}</version>
	            </plugin>
	            <plugin>
	       			<artifactId>maven-jar-plugin</artifactId>
	            	<version>${version.maven-jar-plugin}</version>
	            </plugin>
	            <plugin>
	       			<artifactId>maven-ejb-plugin</artifactId>
	            	<version>${version.maven-ejb-plugin}</version>
	            </plugin>
	            <plugin>
	       			<artifactId>maven-war-plugin</artifactId>
	            	<version>${version.maven-war-plugin}</version>
	            </plugin>
	            <plugin>
	       			<artifactId>maven-ear-plugin</artifactId>
	            	<version>${version.maven-ear-plugin}</version>
	            </plugin>
	            <plugin>
	       			<artifactId>maven-resources-plugin</artifactId>
	            	<version>${version.maven-resources-plugin}</version>
	            </plugin>
	            <plugin>
	       			<artifactId>maven-site-plugin</artifactId>
	            	<version>${version.maven-site-plugin}</version>
	            </plugin>
	            <plugin>
	       			<artifactId>maven-surefire-plugin</artifactId>
	            	<version>${version.maven-surefire-plugin}</version>
	            </plugin>
	            <plugin>
	       			<artifactId>maven-failsafe-plugin</artifactId>
	            	<version>${version.maven-failsafe-plugin}</version>
	            </plugin>
	            <plugin>
	       			<artifactId>maven-javadoc-plugin</artifactId>
	            	<version>${version.maven-javadoc-plugin}</version>
	            </plugin>
	            
	            <!-- More plugins -->
	            <plugin>
	                <groupId>org.codehouse.mojo</groupId>
	                <artifactId>build-helper-maven-plugin</artifactId>
	                <version>${version.build-helper-maven-plugin}</version>	                
	            </plugin>
	            <plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-eclipse-plugin</artifactId>
					<version>${version.maven-eclipse-plugin}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-source-plugin</artifactId>
					<version>${version.maven-source-plugin}</version>
				</plugin>
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>versions-maven-plugin</artifactId>
					<version>${version.version-maven-plugin}</version>
				</plugin>
				<plugin>
					<groupId>org.codehaus.cargo</groupId>
					<artifactId>cargo-maven2-plugin</artifactId>
					<version>${version.cargo-plugin}</version>
				</plugin>
				<plugin>
	                <groupId>org.jboss.as.plugins</groupId>
	                <artifactId>jboss-as-maven-plugin</artifactId>
	                <version>${version.jboss-as-maven-plugin}</version>
	            </plugin>
	        </plugins>	        
	    </pluginManagement>
	    
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>1.7</source>
					<target>1.7</target>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-eclipse-plugin</artifactId>
				<configuration>
					<!--
					<downloadSources>true</downloadSources>
					<downloadJavadocs>true</downloadJavadocs>
					<alwaysWriteProjectConfig>true</alwaysWriteProjectConfig>
					-->
					<eclipseProjectDir>.</eclipseProjectDir>
				</configuration>
			</plugin>
	
			<!-- Include source code and test files (including sources) in deployment -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<executions>
					<execution>
						<goals>
							<goal>jar</goal>
							<goal>test-jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<configuration>
					<skipIfEmpty>true</skipIfEmpty>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>test-jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<!-- Versions Plugin that can be used to manage maven versions in various ways -->
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>versions-maven-plugin</artifactId>
				<configuration>
					<generateBackupPoms>false</generateBackupPoms>
				</configuration>
			</plugin>
		</plugins>
	</build>
	
	<profiles>
		<profile>
			<id>release-sign-artifacts</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>1.1</version>
						<configuration>
							<defaultKeyring>false</defaultKeyring>
						</configuration>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		
		<profile>
			<id>release-attach-javadocs</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<executions>
							<execution>
								<id>attach-javadocs</id>
								<goals>
									<goal>jar</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		
		<profile>
			<id>release-stage-automatically</id>
			<activation>
				<property>
					<name>stageAutomatically</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.sonatype.plugins</groupId>
   		 				<artifactId>nexus-staging-maven-plugin</artifactId>
						<version>${version.nexus-staging-maven-plugin}</version>
						<extensions>true</extensions>
						<configuration>
							<serverId>sonatype-nexus-staging</serverId>
							<nexusUrl>https://oss.sonatype.org</nexusUrl>
							<!-- Automatically release and drop after close -->
							<autoReleaseAfterClose>true</autoReleaseAfterClose> <!-- not working with version 1.4.8, mvn -DstageAutomatically=true nexus-staging:release -->
							<autoDropAfterRelease>true</autoDropAfterRelease>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>