<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>org.clazzes.svc</groupId>
    <artifactId>svc-runner</artifactId>
    <version>1.3.7</version>
    <relativePath>..</relativePath>
  </parent>
  <artifactId>svc-runner-jetty</artifactId>
  <name>Service Runner Jetty Server</name>

  <dependencies>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>jakarta.servlet</groupId>
      <artifactId>jakarta.servlet-api</artifactId>
      <version>${jakarta.servlet-api.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-server</artifactId>
      <version>${jetty.version}</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-util</artifactId>
      <version>${jetty.version}</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-http</artifactId>
      <version>${jetty.version}</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-io</artifactId>
      <version>${jetty.version}</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-security</artifactId>
      <version>${jetty.version}</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-session</artifactId>
      <version>${jetty.version}</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty.ee10</groupId>
      <artifactId>jetty-ee10-servlet</artifactId>
      <version>${jetty.version}</version>
    </dependency>
  </dependencies>

  <profiles>
    <!-- Pseudo profile to ease copying of dependencies using
         -Ddeps.collect=true from within the subproject
    -->
    <profile>
      <id>svc-runner-test-dep</id>
      <activation>
        <property>
          <name>deps.collect</name>
          <value>!true</value>
        </property>
      </activation>
      <dependencies>
        <dependency>
          <groupId>org.clazzes.svc</groupId>
          <artifactId>svc-runner-core</artifactId>
          <version>${project.version}</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <id>servlet-api-collect</id>
      <activation>
        <property>
          <name>api.collect</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <!--
              profile to copy servlet-api de using

              mvn -Ddeps.collect=true -Dapi.collect=true dependency:copy-dependencies
            -->
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <configuration>
              <includeArtifactIds>
                jakarta.servlet-api
              </includeArtifactIds>
              <excludeTransitive>true</excludeTransitive>
              <includeScope>provided</includeScope>
              <outputDirectory>${project.build.directory}/servlet-api-dependency</outputDirectory>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <build>
    <plugins>
      <plugin>
        <!--
          Exclude main dependencies from svc-runner-core, this way we can collect our
          dependencies using

          mvn -Ddeps.collect=true dependency:copy-dependencies
        -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <configuration>
          <excludeArtifactIds>
            svc-api,
            slf4j-api,
            slf4j-simple,
            junit,
            svc-runner-core
          </excludeArtifactIds>
          <excludeTransitive>true</excludeTransitive>
          <excludeScope>provided</excludeScope>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>
