<?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>1.11.3-SNAPSHOT</version>
	</parent>

	<groupId>org.opennms.features.topology</groupId>
	<artifactId>netutils</artifactId>
	<packaging>${packaging.type}</packaging>
	<name>OpenNMS 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.5</source>
                  <target>1.5</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>${gwt.plugin.version}</version>
	                <configuration>
	                    <webappDirectory>${project.build.directory}/${project.build.finalName}/VAADIN/widgetsets</webappDirectory>
	                    <extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
	                </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>${gwt.version}</version>
	                    </dependency>
	                    <dependency>
	                        <groupId>com.google.gwt</groupId>
	                        <artifactId>gwt-user</artifactId>
	                        <version>${gwt.version}</version>
	                    </dependency>
	                </dependencies>
	            </plugin>
	            <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>
	
	        <!-- 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>
	

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

		<repository>
			<id>vaadin-addons</id>
			<url>http://maven.vaadin.com/vaadin-addons</url>
		</repository>		
	</repositories>

	<pluginRepositories>
		<pluginRepository>
			<id>codehaus-snapshots</id>
			<url>http://nexus.codehaus.org/snapshots</url>
			<snapshots>
			</snapshots>
			<releases>
				<enabled>false</enabled>
			</releases>
		</pluginRepository>
		<pluginRepository>
			<id>vaadin-snapshots</id>
			<url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
			<snapshots>
			</snapshots>
			<releases>
				<enabled>false</enabled>
			</releases>
		</pluginRepository>
	</pluginRepositories>

	<dependencies>
	<!-- NECESSARY DEPENDENCIES -->

	    <dependency>
	      <groupId>junit</groupId>
	      <artifactId>junit</artifactId>
	      <scope>test</scope>
	    </dependency>
		<dependency>
            <groupId>org.opennms.osgi.features.topology</groupId>
            <artifactId>vaadin</artifactId>
            <version>${project.version}</version>
            <type>pom</type>
        </dependency>
		<dependency>
			<groupId>com.google.gwt</groupId>
			<artifactId>gwt-user</artifactId>
			<version>${gwt.version}</version>
			<scope>${scope.type}</scope>
		</dependency>

		<dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
        </dependency>
        
		 <dependency>
			<groupId>javax.validation</groupId>
			<artifactId>validation-api</artifactId>
			<version>1.0.0.GA</version>
			<classifier>sources</classifier>
			<scope>${scope.type}</scope>
		</dependency>
		
		 <!-- TOPOLOGY API DEPENDENCIES -->
    	<dependency>
      		<groupId>org.opennms.features.topology</groupId>
      		<artifactId>api</artifactId>
      		<version>${project.version}</version>
      		<scope>${scope.type}</scope> 
    	</dependency>
	</dependencies>

</project>
