<?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>

	<parent>
		<relativePath>../../poms/compiled/</relativePath>
		<groupId>org.opennms.features.topology.build</groupId>
		<artifactId>compiled-bundle-settings</artifactId>
		<version>15.0.0</version>
	</parent>

	<groupId>org.opennms.features.topology</groupId>
	<artifactId>netutils</artifactId>
	<packaging>${packaging.type}</packaging>
	<name>OpenNMS Features Topology NetUtils</name>

	<properties>
		<packaging.type>bundle</packaging.type>
		<scope.type>provided</scope.type>
		<bundle.symbolicName>org.opennms.features.topology.netutils</bundle.symbolicName>
		<bundle.namespace>org.opennms.features.topology.netutils</bundle.namespace>
	</properties>

	<profiles>
		<profile>
			<id>gwt-compile</id>
			<properties>
				<packaging.type>war</packaging.type>
				<scope.type>compile</scope.type>
			</properties>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-compiler-plugin</artifactId>
						<configuration>
							<source>1.7</source>
							<target>1.7</target>
						</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>${gwtPluginVersion}</version>
						<configuration>
							<webappDirectory>${project.build.directory}/${project.build.finalName}/VAADIN/widgetsets</webappDirectory>
							<extraJvmArgs>-XX:MaxPermSize=256m -Xmx1g -Xss1024k</extraJvmArgs>
							<draftCompile>false</draftCompile>
							<compileReport>false</compileReport>
						</configuration>
						<executions>
							<execution>
								<goals>
									<goal>resources</goal>
									<goal>compile</goal>
								</goals>
							</execution>
						</executions>
						<dependencies>
							<dependency>
								<groupId>com.google.gwt</groupId>
								<artifactId>gwt-dev</artifactId>
								<version>${gwtVersion}</version>
							</dependency>
							<dependency>
								<groupId>com.google.gwt</groupId>
								<artifactId>gwt-user</artifactId>
								<version>${gwtVersion}</version>
							</dependency>
						</dependencies>
					</plugin>
					<plugin>
						<groupId>com.vaadin</groupId>
						<artifactId>vaadin-maven-plugin</artifactId>
						<version>${vaadin.plugin.version}</version>
						<configuration>
							<draftCompile>false</draftCompile>
							<compileReport>false</compileReport>
						</configuration>
						<executions>
							<execution>
								<configuration></configuration>
								<goals>
									<goal>update-widgetset</goal>
								</goals>
							</execution>
						</executions>
						<dependencies>
							<dependency>
								<groupId>com.google.gwt</groupId>
								<artifactId>gwt-dev</artifactId>
								<version>${gwtVersion}</version>
							</dependency>
							<dependency>
								<groupId>com.google.gwt</groupId>
								<artifactId>gwt-user</artifactId>
								<version>${gwtVersion}</version>
							</dependency>
						</dependencies>
					</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>
		</profile>

		<profile>
			<id>jetty-run</id>
			<properties>
				<packaging.type>war</packaging.type>
				<scope.type>compile</scope.type>
			</properties>
			<build>
				<plugins>
					<plugin>
						<groupId>org.mortbay.jetty</groupId>
						<artifactId>maven-jetty-plugin</artifactId>
						<version>6.1.24</version>
						<configuration>
							<stopPort>9966</stopPort>
							<stopKey>org.opennms.features.vaadin-topology-widget</stopKey>
							<!-- Redeploy every x seconds if changes are detected, 0 for no automatic 
								redeployment -->
							<scanIntervalSeconds>0</scanIntervalSeconds>
							<!-- make sure Jetty also finds the widgetset -->
							<webAppConfig>
								<contextPath>/webapp</contextPath>
								<baseResource implementation="org.mortbay.resource.ResourceCollection">
									<resourcesAsCSV>src/main/webapp,${project.build.directory}/${project.build.finalName}</resourcesAsCSV>
								</baseResource>
							</webAppConfig>
						</configuration>
					</plugin>
				</plugins>
			</build>

		</profile>
	</profiles>

	<build>
		<resources>
			<resource>
				<directory>src/main/java</directory>
			</resource>
			<resource>
				<directory>src/main/resources</directory>
			</resource>
		</resources>
		<plugins>
			<!-- KARAF PLUGIN -->
			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<extensions>true</extensions>
			</plugin>
		</plugins>
	</build>

	<dependencies>
		<!-- NECESSARY DEPENDENCIES -->
		<dependency>
			<groupId>org.opennms.osgi.features.topology</groupId>
			<artifactId>vaadin</artifactId>
			<type>pom</type>
		</dependency>
		<dependency>
			<groupId>org.opennms.features.topology</groupId>
			<artifactId>api</artifactId>
			<version>${project.version}</version>
			<scope>${scope.type}</scope>
		</dependency>

		<dependency>
			<groupId>org.eclipse.jetty.orbit</groupId>
			<artifactId>javax.servlet</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>javax.validation</groupId>
			<artifactId>validation-api</artifactId>
			<classifier>sources</classifier>
			<scope>${scope.type}</scope>
		</dependency>

		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.easymock</groupId>
			<artifactId>easymock</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

</project>
