<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>
  <groupId>org.lucee</groupId>
  <artifactId>com</artifactId>
  <version>${revision}</version>

  <properties>
    <jacob.version>1.21</jacob.version>
  </properties>

  <name>COM</name>
  <description>Windows COM/ActiveX support for Lucee (createComObject), based on Jacob</description>
  <url>http://maven.lucee.org/com</url>

  <licenses>
    <license>
      <name>The GNU Lesser General Public License, Version 2.1</name>
      <url>http://www.gnu.org/licenses/lgpl-2.1.txt</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>micstriit</id>
      <name>Michael Offner</name>
      <email>michael@lucee.org</email>
      <organization>Lucee Association Switzerland</organization>
      <organizationUrl>http://lucee.org</organizationUrl>
      <roles>
        <role>Project-Administrator</role>
        <role>Developer</role>
      </roles>
      <timezone>+1</timezone>
    </developer>
  </developers>

  <build>
    <sourceDirectory>src</sourceDirectory>
    <plugins>

      <!-- the native libraries of exactly the Jacob version of the dependency, published next to the jar on Maven Central -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>3.6.0</version>
        <executions>
          <execution>
            <id>copy-jacob-dlls</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.outputDirectory}/resources/jacob</outputDirectory>
              <artifactItems>
                <artifactItem>
                  <groupId>io.github.osobolev</groupId>
                  <artifactId>jacob</artifactId>
                  <version>${jacob.version}</version>
                  <type>dll</type>
                  <classifier>x64</classifier>
                  <destFileName>jacob-${jacob.version}-x64.dll</destFileName>
                </artifactItem>
                <artifactItem>
                  <groupId>io.github.osobolev</groupId>
                  <artifactId>jacob</artifactId>
                  <version>${jacob.version}</version>
                  <type>dll</type>
                  <classifier>x86</classifier>
                  <destFileName>jacob-${jacob.version}-x86.dll</destFileName>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>3.6.0</version>
        <executions>
          <execution>
            <id>copy-dependencies</id>
            <phase>package</phase>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/dependency</outputDirectory>
              <includeScope>compile</includeScope>
              <useRepositoryLayout>true</useRepositoryLayout>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>flatten-maven-plugin</artifactId>
        <version>1.6.0</version>
        <configuration>
          <updatePomFile>true</updatePomFile>
          <flattenMode>oss</flattenMode>
        </configuration>
        <executions>
          <execution>
            <id>flatten</id>
            <phase>process-resources</phase>
            <goals>
              <goal>flatten</goal>
            </goals>
          </execution>
          <execution>
            <id>flatten.clean</id>
            <phase>clean</phase>
            <goals>
              <goal>clean</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.3.0</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>3.6.3</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <source>17</source>
          <doclint>none</doclint>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>3.0.0</version>
        <configuration>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <useReleaseProfile>false</useReleaseProfile>
          <releaseProfiles>release</releaseProfiles>
          <goals>deploy</goals>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.11.0</version>
        <configuration>
          <source>17</source>
          <target>17</target>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.3.0</version>
        <configuration>
          <archive>
            <manifest>
              <addClasspath>true</addClasspath>
            </manifest>
          </archive>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.sonatype.central</groupId>
        <artifactId>central-publishing-maven-plugin</artifactId>
        <version>0.8.0</version>
        <extensions>true</extensions>
        <configuration>
          <publishingServerId>ossrh</publishingServerId>
          <autoPublish>true</autoPublish>
        </configuration>
      </plugin>

    </plugins>

    <resources>
      <resource>
        <directory>src</directory>
        <filtering>false</filtering>
        <includes>
          <include>resources/**</include>
        </includes>
      </resource>
    </resources>
  </build>

  <dependencies>
    <dependency>
      <groupId>io.github.osobolev</groupId>
      <artifactId>jacob</artifactId>
      <version>${jacob.version}</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.lucee</groupId>
      <artifactId>lucee</artifactId>
      <version>7.0.0.395</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>

  <profiles>
    <profile>
      <id>release-sign-artifacts</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.0.1</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <scm>
    <url>https://github.com/lucee/extension-com</url>
    <connection>scm:git:git://github.com/lucee/extension-com.git</connection>
    <developerConnection>scm:git:git@github.com:lucee/extension-com.git</developerConnection>
    <tag>${project.version}</tag>
  </scm>

</project>
