<?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>
    <groupId>net.oneandone.maven.poms</groupId>
    <artifactId>lazy-foss-parent</artifactId>
    <version>1.3.0</version>
    <relativePath />
  </parent>

  <name>Hello World Servlet</name>
  <description>Servlet to print hello world. And diagnostic information</description>
  <groupId>net.oneandone</groupId>
  <artifactId>hellowar</artifactId>
  <version>1.0.5</version>
  <packaging>war</packaging>

  <scm>
    <connection>scm:git:ssh://git@github.com/mlhartme/hellowar.git</connection>
    <developerConnection>scm:git:ssh://git@github.com/mlhartme/hellowar.git</developerConnection>
    <url>https://github.com/mlhartme/hellowar</url>
    <tag>hellowar-1.0.5</tag>
  </scm>

  <developers>
    <developer>
      <id>mhm</id>
      <name>Michael Hartmeier</name>
      <roles>
        <role>lead</role>
      </roles>
    </developer>
  </developers>

  <dependencies>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>2.5</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin><!-- TODO print appliction version -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>1.3</version>
        <executions>
          <execution>
            <phase>generate-resources</phase>
            <configuration>
              <tasks>
                <mkdir dir="${basedir}/target/classes/META-INF" />
                <echo file="${basedir}/target/classes/META-INF/pominfo.properties">
                  groupId = ${project.groupId}
                  artifactId = ${project.artifactId}
                  version = ${project.version}
                  name = ${project.name}
                  url = ${project.url}
                </echo>
              </tasks>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.cargo</groupId>
        <artifactId>cargo-maven2-plugin</artifactId>
        <version>1.7.1</version>
        <configuration>
          <container>
            <containerId>tomcat9x</containerId>
            <artifactInstaller>
              <groupId>org.apache.tomcat</groupId>
              <artifactId>tomcat</artifactId>
              <version>9.0.14</version>
            </artifactInstaller>
          </container>
          <configuration>
            <type>standalone</type>
            <home>${project.build.directory}/tomcat</home>
            <properties>
              <cargo.servlet.port>8080</cargo.servlet.port>
              <cargo.logging>medium</cargo.logging>
              <!-- TODO: requires Java 9+ (which is not an official prerequiste (yet)) -->
              <cargo.start.jvmargs>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,quiet=n,address=8000 --illegal-access=deny</cargo.start.jvmargs>
            </properties>
          </configuration>
          <deployables>
            <deployable>
              <groupId>${project.groupId}</groupId>
              <artifactId>${project.artifactId}</artifactId>
              <type>war</type>
              <properties>
                <context>/</context>
              </properties>
            </deployable>
          </deployables>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
