<?xml version="1.0" encoding="UTF-8"?>
<project
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://maven.apache.org/POM/4.0.0"
    xsi:schemaLocation="
        http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd
">

  <parent>
    <groupId>org.opennms.netmgt.sample</groupId>
    <artifactId>sample-parent</artifactId>
    <version>1.13.5-PJSM-SNAPSHOT</version>
  </parent>

  <modelVersion>4.0.0</modelVersion>
  <artifactId>sampler-repo-webapp</artifactId>

  <name>Sample Collection and Storage :: Maven Repository Webapp</name>

  <packaging>war</packaging>
  
  <build>
    <finalName>smnnepo</finalName>
    <plugins>
      <!-- Call the clean plugin during initialize to make sure that any old repo tar.gz contents are deleted before building -->
      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <version>2.4.1</version>
        <executions>
          <execution>
            <id>clean-existing-repo</id>
            <phase>initialize</phase>
            <goals>
              <goal>clean</goal>
            </goals>
            <configuration>
              <excludeDefaultDirectories>true</excludeDefaultDirectories>
              <filesets>
                <fileset>
                  <directory>${project.build.directory}/${project.build.finalName}</directory>
                </fileset>
              </filesets>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>unpack</id>
            <phase>process-resources</phase>
            <goals><goal>unpack</goal></goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.opennms.netmgt.sample</groupId>
                  <artifactId>sampler-repo</artifactId>
                  <version>${project.version}</version>
                  <type>tar.gz</type>
                  <classifier>repo</classifier>
                  <overWrite>false</overWrite>
                  <outputDirectory>${project.build.directory}/${project.build.finalName}</outputDirectory>
                </artifactItem>
              </artifactItems>
              <overWriteReleases>false</overWriteReleases>
              <overWriteSnapshots>true</overWriteSnapshots>
              <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
      </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-clean-plugin</artifactId>
    								<versionRange>[2.4.1,)</versionRange>
    								<goals>
    									<goal>clean</goal>
    								</goals>
    							</pluginExecutionFilter>
    							<action>
    								<execute>
    									<runOnIncremental>false</runOnIncremental>
    									<runOnConfiguration>true</runOnConfiguration>
    								</execute>
    							</action>
    						</pluginExecution>
    					</pluginExecutions>
    				</lifecycleMappingMetadata>
    			</configuration>
    		</plugin>
    	</plugins>
    </pluginManagement>
  </build>
  <dependencies>
    <dependency>
      <groupId>org.opennms.netmgt.sample</groupId>
      <artifactId>sampler-repo</artifactId>
      <version>${project.version}</version>
      <type>tar.gz</type>
      <classifier>repo</classifier>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jcl-over-slf4j</artifactId>
      <scope>provided</scope>
    </dependency>
  </dependencies>
</project>
