<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>edu.wisc.my.apps</groupId>
  <artifactId>uw-frame</artifactId>
  <packaging>war</packaging>
  <version>2.6.3</version>
  <name>uw-frame-parent</name>
  <description>Frame for UW AngularJS applications</description>
  <url>https://github.com/UW-Madison-DoIT/uw-frame</url>

  <developers>
    <developer>
        <email>my-admin@lists.wisc.edu</email>
        <organization>UW-Madison</organization>
        <url>https://github.com/UW-Madison-DoIT/uw-frame</url>
        <name>My UW Dev Team</name>
    </developer>
  </developers>

  <licenses>
    <license>
      <name>The Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <scm>
    <connection>scm:git:git@github.com:UW-Madison-DoIT/uw-frame.git</connection>
    <developerConnection>scm:git:git@github.com:UW-Madison-DoIT/uw-frame.git</developerConnection>
    <url>https://github.com/UW-Madison-DoIT/uw-frame</url>
    <tag>uw-frame-maven-2.6.3</tag>
  </scm>

  <properties>
    <spring.version>4.1.5.RELEASE</spring.version>
    <maven.compiler.source>1.7</maven.compiler.source>
    <maven.compiler.target>1.7</maven.compiler.target>
    <webapp.target.directory>${project.build.directory}/${project.build.finalName}</webapp.target.directory>
  </properties>

  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>javax.servlet.jsp.jstl</groupId>
        <artifactId>jstl-api</artifactId>
        <version>1.2</version>
      </dependency>
      <dependency>
        <groupId>jstl</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
      </dependency>
      <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>jstl</groupId>
      <artifactId>jstl</artifactId>
    </dependency>
  </dependencies>

  <build>
    <finalName>frame</finalName>
    <resources>
      <resource>
        <directory>src/main/webapp</directory>
        <includes>
          <include>frame.jsp</include>
        </includes>
        <filtering>true</filtering>
      </resource>
    </resources>

    <plugins>
      <plugin>
          <groupId>pl.project13.maven</groupId>
          <artifactId>git-commit-id-plugin</artifactId>
          <version>2.1.13</version>
          <executions>
              <execution>
                  <phase>validate</phase>
                  <goals>
                      <goal>revision</goal>
                   </goals>
              </execution>
          </executions>
          <configuration>
              <dotGitDirectory>${project.basedir}/../.git</dotGitDirectory>
              <generateGitPropertiesFile>false</generateGitPropertiesFile>
              <skip>false</skip>
          </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <version>3.0.0</version>
        <configuration>
          <filesets>
            <fileset>
              <directory>src/main/webapp/bower_components</directory>
            </fileset>
          </filesets>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>2.7</version>
        <executions>
          <execution>
            <id>copy-resources</id>
            <!-- here the phase you need -->
            <phase>validate</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${basedir}/target/frame/staticFeeds</outputDirectory>
              <resources>
                <resource>
                  <directory>src/main/filtered-resources</directory>
                  <filtering>true</filtering>
                </resource>
              </resources>
            </configuration>
          </execution>
          <execution>
            <id>copy-components-over</id>
            <phase>validate</phase>
            <goals><goal>copy-resources</goal></goals>
            <configuration>
              <outputDirectory>${basedir}/target/frame/</outputDirectory>
              <resources>
                <resource>
                  <directory>../uw-frame-components</directory>
                  <filtering>false</filtering>
                </resource>
              </resources>
            </configuration>
          </execution>
          <execution>
            <id>move-google-analytics</id>
            <phase>process-sources</phase>
            <goals><goal>copy-resources</goal></goals>
            <configuration>
              <outputDirectory>${basedir}/target/frame/vendor</outputDirectory>
              <resources>
                <resource>
                  <directory>${basedir}/target/frame/bower_components/angulartics-google-analytics/dist/</directory>
                  <filtering>false</filtering>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>exec-maven-plugin</artifactId>
         <version>1.3.2</version>
         <executions>
           <execution>
           <phase>generate-sources</phase>
           <goals>
            <goal>exec</goal>
           </goals>
           </execution>
         </executions>
         <configuration>
           <executable>bower</executable>
           <arguments>
            <argument>install</argument>
           </arguments>
           <workingDirectory>target/frame</workingDirectory>
         </configuration>
      </plugin>
      <plugin>
        <groupId>org.lesscss</groupId>
        <artifactId>lesscss-maven-plugin</artifactId>
        <version>1.7.0.1.1</version>
        <configuration>
          <sourceDirectory>${webapp.target.directory}/css/themes/</sourceDirectory>
          <outputDirectory>${webapp.target.directory}/css/themes/</outputDirectory>
          <compress>true</compress>
          <includes>
            <include>uw-madison.less</include>
            <include>uw-system.less</include>
            <include>uw-river-falls.less</include>
            <include>uw-stevens-point.less</include>
            <include>uw-milwaukee.less</include>
            <include>uw-whitewater.less</include>
            <include>uw-stout.less</include>
            <include>uw-oskhosh.less</include>
            <include>uw-greenbay.less</include>
            <include>uw-lacrosse.less</include>
            <include>uw-superior.less</include>
            <include>uw-platteville.less</include>
            <include>uw-parkside.less</include>
            <include>uw-eau-claire.less</include>
            <include>uw-extension.less</include>
            <include>uw-colleges.less</include>
          </includes>
          <outputFileFormat>{fileName}.${project.version}.css</outputFileFormat>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-maven-plugin</artifactId>
        <version>9.3.0.M2</version>
        <configuration>
          <webApp>
            <baseResource implementation="org.eclipse.jetty.util.resource.ResourceCollection">
              <resourcesAsCSV>src/main/webapp,${webapp.target.directory},../uw-frame-components</resourcesAsCSV>
            </baseResource>
          </webApp>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.5.1</version>
        <configuration>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <useReleaseProfile>false</useReleaseProfile>
          <releaseProfiles>release</releaseProfiles>
          <goals>deploy</goals>
          <localCheckout>true</localCheckout>
          <tagNameFormat>uw-frame-maven-@{project.version}</tagNameFormat>
          <pushChanges>false</pushChanges>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>1.6.5</version>
        <extensions>false</extensions>
        <configuration>
          <serverId>ossrh</serverId>
          <nexusUrl>https://oss.sonatype.org/</nexusUrl>
          <autoReleaseAfterClose>true</autoReleaseAfterClose>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.5</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>2.2.1</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.9.1</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
