<?xml version="1.0" encoding="UTF-8"?>
<!-- ~ JBoss, Home of Professional Open Source. ~ Copyright 2010, Red Hat, 
	Inc., and individual contributors ~ as indicated by the @author tags. See 
	the copyright.txt file in the ~ distribution for a full listing of individual 
	contributors. ~ ~ This is free software; you can redistribute it and/or modify 
	it ~ under the terms of the GNU Lesser General Public License as ~ published 
	by the Free Software Foundation; either version 2.1 of ~ the License, or 
	(at your option) any later version. ~ ~ This software is distributed in the 
	hope that it will be useful, ~ but WITHOUT ANY WARRANTY; without even the 
	implied warranty of ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
	See the GNU ~ Lesser General Public License for more details. ~ ~ You should 
	have received a copy of the GNU Lesser General Public ~ License along with 
	this software; if not, write to the Free ~ Software Foundation, Inc., 51 
	Franklin St, Fifth Floor, Boston, MA ~ 02110-1301 USA, or see the FSF site: 
	http://www.fsf.org. -->
<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>org.picketlink</groupId>
	<artifactId>picketlink-console</artifactId>
	<version>1.0.0.Final</version>
	<packaging>war</packaging>

	<name>PicketLink: JBoss AS7 Management Console</name>
	<description>PicketLink: Management Console for the JBoss Application Server v7</description>

	<url>
        https://github.com/picketlink/picketlink-console
    </url>
	
	<scm>
		<connection>scm:git:${picketlink.console.scm.connection}</connection>
		<developerConnection>scm:git:${picketlink.console.scm.connection}</developerConnection>
		<url>${picketlink.console.scm.url}</url>
	</scm>
	
	<organization>
		<name>JBoss, a division of Red Hat</name>
		<url>http://www.jboss.org</url>
	</organization>

	<developers>
		<developer>
			<name>Pedro Silva</name>
			<roles>
				<role>Project Lead</role>
			</roles>
		</developer>
	</developers>

	<licenses>
		<license>
			<name>lgpl</name>
			<url>http://repository.jboss.org/licenses/lgpl-2.1.txt</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<properties>
		<picketlink.console.scm.url>https://github.com/picketlink/picketlink-console</picketlink.console.scm.url>
		<picketlink.console.scm.connection>git@github.com:picketlink/picketlink-console.git</picketlink.console.scm.connection>
		
		<gwt.maven>2.3.0</gwt.maven>
		<gwt.bindAddress>127.0.0.1</gwt.bindAddress>
		<bom.version>1.3.1.Final</bom.version>
	</properties>

	<!-- Dependencies -->
	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>org.jboss.as</groupId>
				<artifactId>jboss-as-console-bom</artifactId>
				<type>pom</type>
				<version>${bom.version}</version>
				<scope>import</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<dependencies>

		<dependency>
			<groupId>org.jboss.as</groupId>
			<artifactId>jboss-as-console</artifactId>
			<version>${bom.version}</version>
			<classifier>export</classifier>
		</dependency>

		<dependency>
			<groupId>org.jboss.as</groupId>
			<artifactId>jboss-as-console</artifactId>
			<version>${bom.version}</version>
			<classifier>sources</classifier>
		</dependency>

		<dependency>
			<groupId>org.jboss.ballroom</groupId>
			<artifactId>widgets</artifactId>
		</dependency>

		<dependency>
			<groupId>org.jboss.as</groupId>
			<artifactId>console-spi</artifactId>
		</dependency>

		<dependency>
			<groupId>org.jboss.as</groupId>
			<artifactId>console-spi</artifactId>
			<classifier>sources</classifier>
		</dependency>

		<!-- GWT -->
		<dependency>
			<groupId>com.google.gwt</groupId>
			<artifactId>gwt-servlet</artifactId>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>com.google.gwt</groupId>
			<artifactId>gwt-dev</artifactId>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>com.google.code</groupId>
			<artifactId>gwt-visualization</artifactId>
		</dependency>

		<dependency>
			<groupId>com.google.gwt</groupId>
			<artifactId>gwt-user</artifactId>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>javax.validation</groupId>
			<artifactId>validation-api</artifactId>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>javax.validation</groupId>
			<artifactId>validation-api</artifactId>
			<classifier>sources</classifier>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>com.google.code.gwt-log</groupId>
			<artifactId>gwt-log</artifactId>
		</dependency>

		<dependency>
			<groupId>com.gwtplatform</groupId>
			<artifactId>gwtp-mvp-client</artifactId>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>com.google.inject</groupId>
			<artifactId>guice</artifactId>
		</dependency>

		<dependency>
			<groupId>com.google.inject.extensions</groupId>
			<artifactId>guice-assistedinject</artifactId>
		</dependency>

		<dependency>
			<groupId>com.google.gwt.inject</groupId>
			<artifactId>gin</artifactId>
		</dependency>

		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<!-- Plugins -->
	<build>
		<finalName>picketlink-console-${project.version}</finalName>
		<outputDirectory>war/WEB-INF/classes</outputDirectory>
		<resources>
			<resource>
				<directory>src/main/java</directory>
			</resource>
		</resources>

		<plugins>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<version>1.7</version>
				<executions>
					<execution>
						<id>add-sources</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>add-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>${basedir}/target/imported-sources</source>
							</sources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<version>2.4</version>
				<executions>
					<execution>
						<id>unpack</id>
						<phase>initialize</phase>
						<goals>
							<goal>unpack-dependencies</goal>
						</goals>
						<configuration>
							<includeClassifiers>export</includeClassifiers>
							<includeTypes>jar</includeTypes>
							<outputDirectory>${basedir}/target/imported-sources</outputDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.zanata</groupId>
				<artifactId>zanata-maven-plugin</artifactId>
				<version>1.5.0</version>
				<configuration>
					<projectType>properties</projectType>
					<includes>src/main/java/org/jboss/as/console/client/core/UIConstants.properties,src/main/java/org/jboss/as/console/client/core/UIMessages.properties</includes>
					<projectVersion>master</projectVersion>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>gwt-maven-plugin</artifactId>
				<version>${gwt.maven}</version>
				<configuration>
					<inplace>true</inplace>
					<logLevel>TRACE</logLevel>
					<runTarget>App.html</runTarget>
					<module>org.picketlink.as.console.PicketLinkConsole</module>
					<warSourceDirectory>war</warSourceDirectory>
					<extraJvmArgs>-Xmx1024m -DDEBUG -XX:MaxPermSize=256M</extraJvmArgs>
					<servicePattern>**/*Service.java</servicePattern>
					<style>OBF</style>
					<hostedWebapp>war</hostedWebapp>
					<localWorkers>2</localWorkers>
					<compileReport>false</compileReport>
					<force>false</force>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>clean</goal>
							<goal>resources</goal>
							<goal>compile</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<version>2.2.1</version>
				<configuration>
					<descriptors>
						<descriptor>scripts/export.xml</descriptor>
					</descriptors>
				</configuration>
				<executions>
					<execution>
						<id>make-assembly</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>1.6</source>
					<target>1.6</target>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.bsc.maven</groupId>
				<artifactId>maven-processor-plugin</artifactId>
				<version>2.0.6-redhat</version>
				<executions>
					<execution>
						<id>process</id>
						<goals>
							<goal>process</goal>
						</goals>
						<phase>generate-sources</phase>
						<configuration>
							<outputDiagnostics>false</outputDiagnostics>
							<processors>
								<processor>org.jboss.as.console.spi.ExtensionProcessor</processor>
								<processor>org.jboss.as.console.spi.ExtensionBindingProcessor</processor>
								<processor>org.jboss.as.console.spi.BeanFactoryProcessor</processor>
								<processor>org.jboss.as.console.spi.SubsystemProcessor</processor>
							</processors>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-war-plugin</artifactId>
				<version>2.2</version>
				<configuration>
					<warSourceDirectory>war</warSourceDirectory>
					<webappDirectory>war</webappDirectory>
					<packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-clean-plugin</artifactId>
				<version>2.2</version>
				<configuration>
					<skip>true</skip>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-antrun-plugin</artifactId>
				<version>1.2</version>
				<executions>
					<execution>
						<id>clean.war</id>
						<phase>clean</phase>
						<configuration>
							<tasks>
								<!-- The gwt-maven-plugin use the war source folder as it's build 
									directory. We need to cleanup after we'd run the plugin and remove all GWT 
									related artifacts that are required to run the hosted mode. -->
								<delete dir="war/WEB-INF/classes" />
								<delete dir="war/WEB-INF/lib" />
								<delete dir="war/WEB-INF/deploy" />
								<!--delete file="war/WEB-INF/jboss-web.xml"/> <delete file="war/WEB-INF/web.xml"/ -->
								<delete dir="war/app" />
								<delete dir="war/dmr_gwt" />
								<delete dir="war/org.jboss.as.console.App.JUnit" />
								<delete dir="target" />

							</tasks>
						</configuration>
						<goals>
							<goal>run</goal>
						</goals>
					</execution>
					<execution>
						<id>fake.war</id>
						<phase>verify</phase>
						<configuration>
							<tasks>
								<echo>Replace the war file with a fake.war</echo>
								<copy file="build.number" todir="fake_war" overwrite="true" />
								<zip destfile="./target/fake.war" basedir="fake_war" />
								<copy file="./target/fake.war" tofile="./target/as7-console.war"
									overwrite="true" verbose="true" />
							</tasks>
						</configuration>
						<goals>
							<goal>run</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
		<pluginManagement>
			<plugins>
				<!--This plugin's configuration is used to store Eclipse m2e settings 
					only. It has no influence on the Maven build itself. -->
				<plugin>
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>
											org.apache.maven.plugins
										</groupId>
										<artifactId>
											maven-dependency-plugin
										</artifactId>
										<versionRange>
											[2.4,)
										</versionRange>
										<goals>
											<goal>
												unpack-dependencies
											</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore></ignore>
									</action>
								</pluginExecution>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>org.bsc.maven</groupId>
										<artifactId>
											maven-processor-plugin
										</artifactId>
										<versionRange>
											[2.0.6-redhat,)
										</versionRange>
										<goals>
											<goal>process</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore></ignore>
									</action>
								</pluginExecution>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>
											org.codehaus.mojo
										</groupId>
										<artifactId>
											gwt-maven-plugin
										</artifactId>
										<versionRange>
											[2.3.0,)
										</versionRange>
										<goals>
											<goal>resources</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore></ignore>
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<profiles>
		<profile>
			<id>dev</id>
			<activation>
				<property>
					<name>dev</name>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>gwt-maven-plugin</artifactId>
						<version>${gwt.maven}</version>
						<configuration>
							<inplace>true</inplace>
							<logLevel>TRACE</logLevel>
							<runTarget>App.html</runTarget>
							<module>org.picketlink.as.console.Development</module>
							<warSourceDirectory>war</warSourceDirectory>
							<extraJvmArgs>-Xmx1024m -DDEBUG -XX:MaxPermSize=256M</extraJvmArgs>
							<servicePattern>**/*Service.java</servicePattern>
							<style>OBF</style>
							<hostedWebapp>war</hostedWebapp>
							<localWorkers>2</localWorkers>
							<compileReport>false</compileReport>
							<force>false</force>
						</configuration>
						<executions>
							<execution>
								<goals>
									<goal>clean</goal>
									<goal>resources</goal>
									<goal>compile</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<artifactId>maven-war-plugin</artifactId>
						<version>2.2</version>
						<configuration>
							<warSourceDirectory>war</warSourceDirectory>
							<webappDirectory>war</webappDirectory>
							<packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

	<distributionManagement>
		<repository>
			<id>jboss-releases-repository</id>
			<name>JBoss Releases Repository</name>
			<url>https://repository.jboss.org/nexus/service/local/staging/deploy/maven2/</url>
		</repository>
		<snapshotRepository>
			<id>jboss-snapshots-repository</id>
			<name>JBoss Snapshots Repository</name>
			<url>https://repository.jboss.org/nexus/content/repositories/snapshots/</url>
		</snapshotRepository>
	</distributionManagement>

	<repositories>
		<repository>
			<id>jboss-public-repository-group</id>
			<name>JBoss Public Maven Repository Group</name>
			<url>http://repository.jboss.org/nexus/content/groups/public/</url>
			<layout>default</layout>
			<releases>
				<enabled>true</enabled>
				<updatePolicy>never</updatePolicy>
			</releases>
			<snapshots>
				<enabled>true</enabled>
				<updatePolicy>never</updatePolicy>
			</snapshots>
		</repository>
		<repository>
			<id>repository.jboss.org</id>
			<name>JBoss Repository</name>
			<layout>default</layout>
			<url>http://repository.jboss.org/maven2/</url>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
		</repository>
		<repository>
			<id>snapshots.jboss.org</id>
			<name>JBoss Snapshots Repository</name>
			<layout>default</layout>
			<url>http://snapshots.jboss.org/maven2/</url>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
			<releases>
				<enabled>false</enabled>
			</releases>
		</repository>
	</repositories>
	
	<pluginRepositories>
		<pluginRepository>
			<id>jboss-public-repository-group</id>
			<name>JBoss Public Maven Repository Group</name>
			<url>https://repository.jboss.org/nexus/content/groups/public/</url>
			<layout>default</layout>
			<releases>
				<updatePolicy>never</updatePolicy>
			</releases>
			<snapshots>
				<updatePolicy>never</updatePolicy>
			</snapshots>
		</pluginRepository>
		<pluginRepository>
			<id>gwtplatform.plugin</id>
			<name>Gwtplatform custom plugin repository</name>
			<url>http://maven.gwt-platform.googlecode.com/hg/</url>
			<layout>default</layout>
		</pluginRepository>
	</pluginRepositories>
</project>