<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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
      <groupId>com.astamuse</groupId>
      <artifactId>asta4d</artifactId>
      <version>0.5.16</version>
  </parent>

  <groupId>com.astamuse</groupId>
  <artifactId>asta4d-sample</artifactId>
  <packaging>war</packaging>

  <name>com.astamuse.asta4d-sample</name>
  <description>sample of asta4d framework, shows how to use asta4d</description>

    <dependencies>
      <dependency>
        <groupId>com.astamuse</groupId>
        <artifactId>asta4d-spring</artifactId>
        <version>${project.version}</version>
      </dependency>
      
      <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-context</artifactId>
       <version>3.1.2.RELEASE</version>
      </dependency>

      <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-webmvc</artifactId>
       <version>3.1.2.RELEASE</version>
      </dependency>
      
      <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
        <scope>provided</scope>
      </dependency>
      
    </dependencies>

        <build>
          <plugins>
	        <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-archetype-plugin</artifactId>
              <version>2.2</version>
              <executions>
                <execution>
                  <id>archetype-run</id>
                  <phase>package</phase>
                  <goals>
                    <goal>create-from-project</goal>
                  </goals>
                </execution>
              </executions>
            </plugin>

            <plugin>
              <artifactId>maven-antrun-plugin</artifactId>
              <version>1.7</version>
              <executions>
                <execution>
                  <phase>package</phase>
                  <goals>
                    <goal>run</goal>
                  </goals>
                  <configuration>
                    <target>
                      <copy todir="../asta4d-archetype/src/test">
                        <fileset dir="target/generated-sources/archetype/src/test" includes="**/*" />
                      </copy>
                      <copy todir="../asta4d-archetype/src/main/resources/META-INF">
                        <fileset dir="target/generated-sources/archetype/src/main/resources/META-INF" includes="**/*" />
                      </copy>
                      <copy todir="../asta4d-archetype/src/main/resources/archetype-resources/src">
                        <fileset dir="target/generated-sources/archetype/src/main/resources/archetype-resources/src" includes="**/*" />
                      </copy>
                      <copy tofile="../asta4d-archetype/src/main/resources/archetype-resources/pom.xml" file="target/generated-sources/archetype/src/main/resources/archetype-resources/kickoff.pom.xml" />
                    </target>
                  </configuration>
                </execution>
              </executions>
            </plugin>
			
			<plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-resources-plugin</artifactId>
              <version>2.6</version>
              <executions>
                <execution>
                  <id>copy-resources</id>
                  <phase>compile</phase>
                  <goals>
                    <goal>copy-resources</goal>
                  </goals>
                  <configuration>
                    <encoding>utf-8</encoding>
                    <outputDirectory>${project.build.directory}/${project.artifactId}-${project.version}/WEB-INF/src</outputDirectory>
                    <resources>
                      <resource>
                        <directory>src/main/java</directory>
                      </resource>
                    </resources>
                  </configuration>
                </execution>
              </executions>
            </plugin>
          </plugins>
        </build>

    <profiles>
      <!-- With this profile, jetty will run during the "test" phase -->
      <profile>
        <id>jetty-run</id>
        <build>
          <plugins>
            <plugin>
              <groupId>org.mortbay.jetty</groupId>
              <artifactId>jetty-maven-plugin</artifactId>
              <version>8.1.2.v20120308</version>
              <configuration>
                    <webApp>
                      <contextPath>/</contextPath>
                    </webApp>
              </configuration>
              <executions>
                <execution>
                  <id>jetty-run</id>
                  <phase>test</phase>
                  <goals>
                    <goal>run</goal>
                  </goals>
                </execution>
              </executions>
            </plugin>
          </plugins>
        </build>
      </profile>
    </profiles>

</project>