<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>osgi</artifactId>
  <version>${revision}</version>

  <name>OSGi</name>
  <description>OSGi (Apache Felix) support for Lucee</description>
  <url>http://maven.lucee.org/osgi</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>

  <properties>
    <!-- the build.xml of the extension passes -Drevision with the version of the extension,
         this default is only used when this pom is built on its own -->
    <revision>1.0.0.0-SNAPSHOT</revision>
    <!-- needs a Lucee 9 that has lucee.runtime.osgi.BundleService (LDEV-6627) -->
    <lucee.version>9.0.0.1487-ALPHA</lucee.version>
  </properties>

  <build>
    <sourceDirectory>src</sourceDirectory>
    <testSourceDirectory>test</testSourceDirectory>
    <plugins>

      <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>21</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-surefire-plugin</artifactId>
        <version>3.2.5</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.11.0</version>
        <configuration>
          <source>21</source>
          <target>21</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>
          <include>META-INF/**</include>
        </includes>
      </resource>
    </resources>
  </build>

  <!-- the Lucee 9 alpha builds are only published on the Lucee Maven repository, not on Maven Central -->
  <repositories>
    <repository>
      <id>lucee-services</id>
      <url>https://mvn.lucee-services.com</url>
      <releases><enabled>true</enabled></releases>
      <snapshots><enabled>true</enabled></snapshots>
    </repository>
  </repositories>

  <dependencies>
    <dependency>
      <groupId>org.apache.felix</groupId>
      <artifactId>org.apache.felix.framework</artifactId>
      <version>7.0.5</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.lucee</groupId>
      <artifactId>lucee</artifactId>
      <version>${lucee.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <version>5.11.4</version>
      <scope>test</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-osgi</url>
    <connection>scm:git:git://github.com/lucee/extension-osgi.git</connection>
    <developerConnection>scm:git:git@github.com:lucee/extension-osgi.git</developerConnection>
    <tag>${project.version}</tag>
  </scm>

</project>
