<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>org.operaton.bpm</groupId>
    <artifactId>operaton-engine-rest-root</artifactId>
    <version>2.1.2</version>
  </parent>

  <artifactId>operaton-engine-rest</artifactId>
  <packaging>war</packaging>
  <name>Operaton - Engine - REST - Assembly</name>
  <description>${project.name}</description>

  <properties>
    <!-- generate a bom of dependencies for the license book.
    We include compile and provided scope dependencies;
    all the dependencies that we include in only one of the
    runtime-specific-WARs are in provided scope -->
    <skip-third-party-bom>false</skip-third-party-bom>
    <third-party-bom-scopes>compile|provided</third-party-bom-scopes>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.operaton.bpm</groupId>
      <artifactId>operaton-engine-rest-core</artifactId>
      <version>${project.version}</version>
    </dependency>

    <!-- dependencies only used for assemblies should be scope provided -->
    <dependency>
      <groupId>org.operaton.bpm</groupId>
      <artifactId>operaton-engine-rest-core</artifactId>
      <version>${project.version}</version>
      <classifier>sources</classifier>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.operaton.bpm</groupId>
      <artifactId>operaton-engine-rest-core</artifactId>
      <version>${project.version}</version>
      <classifier>tests</classifier>
      <scope>provided</scope>
    </dependency>

    <!-- Jakarta API -->

    <dependency>
      <groupId>jakarta.ws.rs</groupId>
      <artifactId>jakarta.ws.rs-api</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>jakarta.servlet</groupId>
      <artifactId>jakarta.servlet-api</artifactId>
      <scope>provided</scope>
    </dependency>

    <!-- Resteasy -->

    <dependency>
      <groupId>org.jboss.resteasy</groupId>
      <artifactId>resteasy-core</artifactId>
      <scope>provided</scope>
    </dependency>

  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <id>wildfly</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <archive>
                <manifestEntries>
                  <!-- module dependencies for deployment on wildfly  -->
                  <Dependencies>org.operaton.bpm.operaton-engine,org.operaton.bpm.dmn.operaton-engine-dmn,org.operaton.commons.operaton-commons-logging,org.operaton.spin.operaton-spin-core,org.operaton.bpm.juel.operaton-juel services,org.graalvm.js.js-all services</Dependencies>
                </manifestEntries>
              </archive>
              <descriptors>
                <descriptor>assembly-war-wildfly.xml</descriptor>
              </descriptors>
              <finalName>operaton-engine-rest-${project.version}</finalName>
              <attach>true</attach>
              <classifier>wildfly</classifier>
              <outputDirectory>target/</outputDirectory>
              <workDirectory>target/assembly/work</workDirectory>
            </configuration>
          </execution>

          <execution>
            <id>tomcat</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>assembly-war-tomcat.xml</descriptor>
              </descriptors>
              <finalName>operaton-engine-rest-${project.version}</finalName>
              <attach>true</attach>
              <classifier>tomcat</classifier>
              <outputDirectory>target/</outputDirectory>
              <workDirectory>target/assembly/work</workDirectory>
            </configuration>
          </execution>

          <execution>
            <id>classes</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>assembly-classes.xml</descriptor>
              </descriptors>
              <finalName>operaton-engine-rest-${project.version}</finalName>
              <attach>true</attach>
              <outputDirectory>target/</outputDirectory>
              <workDirectory>target/assembly/work</workDirectory>
            </configuration>
          </execution>

          <execution>
            <id>sources</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>assembly-sources.xml</descriptor>
              </descriptors>
              <finalName>operaton-engine-rest-${project.version}</finalName>
              <attach>true</attach>
              <outputDirectory>target/</outputDirectory>
              <workDirectory>target/assembly/work</workDirectory>
            </configuration>
          </execution>

          <execution>
            <id>tests</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>assembly-tests.xml</descriptor>
              </descriptors>
              <finalName>operaton-engine-rest-${project.version}</finalName>
              <attach>true</attach>
              <outputDirectory>target/</outputDirectory>
              <workDirectory>target/assembly/work</workDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>

    </plugins>
  </build>
</project>
