<?xml version="1.0" encoding="utf-8"?>
<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>org.vaadin.addons</groupId>
	<artifactId>console</artifactId>
	<version>1.2.0</version>
	<packaging>jar</packaging>
	<name>Vaadin Console add-on</name>

	<build>
		<plugins>
			<plugin>
				<artifactId>maven-source-plugin</artifactId>
				<configuration>
					<attach>true</attach>
				</configuration>
				<executions>
					<execution>
						<phase>generate-sources</phase>
						<goals>
							<goal>jar</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.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>2.3.1</version>
				<configuration>
					<archive>
						<index>true</index>
						<manifest>
							<addClasspath>true</addClasspath>
							<!--
								Implementation-Title and Implementation-Version come from the
								POM by default
							-->
							<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
						</manifest>
						<manifestEntries>
							<!-- Package format version - do not change -->
							<Vaadin-Package-Version>1</Vaadin-Package-Version>

							<!-- Add-on specific fields to update -->
							<Vaadin-License-Title>Apache License 2.0</Vaadin-License-Title>

							<!--
								Implementation-Title and Implementation-Version come from the
								POM by default
							-->
							<Implementation-Vendor>Vaadin Ltd</Implementation-Vendor>
							<Implementation-Title>${pom.name}</Implementation-Title>
							<Implementation-Version>${pom.version}</Implementation-Version>

							<!-- Comma-separated list of widgetsets in the package -->
							<Vaadin-Widgetsets>org.vaadin.console.ConsoleWidgetset</Vaadin-Widgetsets>
						</manifestEntries>
					</archive>
				</configuration>
			</plugin>

			<!-- Compiles your custom GWT components with the GWT compiler -->
			<!--
				A hosted mode browser for client-side widget debugging can be run
				with the goal gwt:run after uncommenting the correct line below. A
				remote debugger can then be connected to port 8998. Note that e.g. a
				Jetty server should be running with the server side parts - use the
				goal jetty:run .
			-->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>gwt-maven-plugin</artifactId>
				<version>2.2.0</version>
				<configuration>
					<!-- if you don't specify any modules, the plugin will find them -->
					<webappDirectory>${project.build.directory}/${project.build.finalName}/VAADIN/widgetsets</webappDirectory>
					<!-- On Mac running Snow Leopard, add "-d32" -->
					<!--
						This causes error messages (but build works) in phase "package":
						two processes would use the same debug port
					-->
					<!--
						extraJvmArgs>-Xmx512M -Xss1024k -Xdebug
						-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8998</extraJvmArgs
					-->
					<extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
					<runTarget>xsite</runTarget>
					<hostedWebapp>${project.build.directory}/${project.build.finalName}</hostedWebapp>
					<noServer>true</noServer>
					<port>8080</port>
					<soyc>false</soyc>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>resources</goal>
							<goal>compile</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>

		<!--
			This is needed for the sources required by the GWT compiler to be
			included in the produced JARs
		-->
		<resources>
			<resource>
				<directory>src/main/java</directory>
			</resource>
			<resource>
				<directory>src/main/resources</directory>
			</resource>
		</resources>
	</build>
	
	<profiles>
		<profile>
			<id>updateWidgetset</id>
			<build>
				<plugins>
					<plugin>
						<groupId>com.vaadin</groupId>
						<artifactId>vaadin-maven-plugin</artifactId>
						<version>1.0.2</version>
						<executions>
							<execution>
								<configuration>
								</configuration>
								<goals>
									<goal>update-widgetset</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

	<dependencies>
		<dependency>
			<groupId>com.vaadin</groupId>
			<artifactId>vaadin</artifactId>
			<version>6.6.0</version>
		</dependency>
		<dependency>
			<groupId>org.vaadin.addons</groupId>
			<artifactId>widget-rpc</artifactId>
			<version>1.1.3</version>
		</dependency>
		<dependency>
			<groupId>com.google.gwt</groupId>
			<artifactId>gwt-user</artifactId>
			<version>2.2.0</version>
			<scope>provided</scope>
		</dependency>
	</dependencies>

	<repositories>
		<repository>
			<id>vaadin</id>
			<url>http://oss.sonatype.org/content/repositories/vaadin/</url>
			<releases>
				<enabled>true</enabled>
			</releases>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
		</repository>
		<repository>
			<id>vaadin-addons</id>
			<url>http://maven.vaadin.com/vaadin-addons</url>
			<releases>
				<enabled>true</enabled>
			</releases>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
		</repository>
	</repositories>

</project>
