<?xml version="1.0"?>
<!--
/*********************************************************************
* Copyright (c) 2024 Contributors to the Eclipse Foundation.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
**********************************************************************/
-->
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.eclipse.osgi-technology</groupId>
  <artifactId>org.eclipse.osgi-technology.pom.parent</artifactId>
  <version>0.0.1</version>
  <packaging>pom</packaging>

  <name>eclipse.osgi-technology project - parent pom</name>
  <description>This pom is the base/parent-pom for all other maven-projects of
    the eclipse.osgi-technology project</description>

  <properties>

    <project.build.outputTimestamp>1980-02-01T00:00:00Z</project.build.outputTimestamp>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <java.version>17</java.version>
    <java.release>17</java.release>

    <maven.compiler.source>${java.version}</maven.compiler.source>
    <maven.compiler.target>${java.version}</maven.compiler.target>
    
    <!-- maven plugin versions -->
    <maven.clean.plugin.version>3.5.0</maven.clean.plugin.version>
    <maven-scm-plugin-version>2.2.1</maven-scm-plugin-version>
    <maven-source-plugin-version>3.3.1</maven-source-plugin-version>
    <maven.resources.plugin.version>3.3.1</maven.resources.plugin.version>
    <maven.compiler.plugin.version>3.14.1</maven.compiler.plugin.version>
    <maven.surefire.plugin.version>3.5.4</maven.surefire.plugin.version>
    <maven.jar.plugin.version>3.4.2</maven.jar.plugin.version>
    <maven.install.plugin.version>3.1.4</maven.install.plugin.version>
    <maven.deploy.plugin.version>3.1.4</maven.deploy.plugin.version>
    <maven-gpg-plugin-version>3.2.8</maven-gpg-plugin-version>

    <!-- dash-->
    <dash.projectId>technology.osgi-technology</dash.projectId>
    <dash.repo>https://github.com/eclipse-osgi-technology/</dash.repo>

    <bnd.version>7.1.0</bnd.version>
    
    <maven.deploy.skip>true</maven.deploy.skip>
  </properties>

  <url>https://projects.eclipse.org/projects/technology.osgi-technology</url>
  <organization>
    <name>Eclipse Foundation - Project osgi-technology</name>
    <url>https://www.eclipse.org/</url>
  </organization>
  <developers>
    <developer>
      <id>timothyjward</id>
      <name>Tim Ward</name>
      <email>timothyjward@apache.org</email>
    </developer>
    <developer>
      <id>StefanBischof</id>
      <name>Stefan Bischof</name>
      <email>stbischof@bipolis.org</email>
    </developer>
  </developers>
  <licenses>
    <license>
      <name>EPL-2.0</name>
      <comments>Eclipse Public License, Version 2.0</comments>
      <url>https://opensource.org/licenses/EPL-2.0</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <scm>
    <url>https://github.com/eclipse-osgi-technology</url>
    <connection>scm:git:https://github.com/eclipse-osgi-technology</connection>
    <developerConnection>scm:git:git@github.com:eclipse-osgi-technology</developerConnection>
  </scm>

  <issueManagement>
    <system>GitHub Issues</system>
    <url>https://github.com/eclipse-osgi-technology/maven-pom/issues</url>
  </issueManagement>

  <distributionManagement>
    <snapshotRepository>
      <id>central</id>
      <url>https://central.sonatype.com/repository/maven-snapshots</url>
    </snapshotRepository>
  </distributionManagement>

  <repositories>
    <repository>
      <id>ossrh</id>
      <name>Sonatype Nexus Snapshots</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
    <repository>
      <id>central-snapshots</id>
      <name>Central Snapshot</name>
      <url>https://central.sonatype.com/repository/maven-snapshots/</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
    <repository>
      <id>apache-snapshots</id>
      <name>Apache Snapshots</name>
      <url>https://repository.apache.org/snapshots/</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>

  <build>
    <plugins>
      <!-- Deactivate the default maven-deloy-plugin globally -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>${maven.deploy.plugin.version}</version>
        <configuration>
          <skip>true</skip>
        </configuration>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>biz.aQute.bnd</groupId>
          <artifactId>bnd-maven-plugin</artifactId>
          <version>${bnd.version}</version>
          <executions>
            <execution>
              <id>bnd-process</id>
              <goals>
                <goal>bnd-process</goal>
              </goals>
              <configuration>
                <bnd>
                  <![CDATA[
                Bundle-SymbolicName: ${project.groupId}.${project.artifactId}
                Bundle-Copyright: Copyright (c) Contributors to the Eclipse Foundation.
                Git-Descriptor: ${system-allow-fail;git describe --dirty --always --abbrev=9}
                Git-SHA: ${system-allow-fail;git rev-list -1 --no-abbrev-commit HEAD}
                SPDX-License-Identifier: ${project.licenses[0].name}
                -noextraheaders: true
                -reproducible: true
                ]]>
                </bnd>
                <bndfile>bnd.bnd</bndfile>
              </configuration>
            </execution>
            <execution>
              <id>bnd-process-tests</id>
              <phase>process-test-classes</phase>
              <goals>
                <goal>bnd-process-tests</goal>
              </goals>
              <configuration>
                <bnd>
                  <![CDATA[
              Bundle-SymbolicName: ${project.groupId}.${project.artifactId}-tests
              Fragment-Host: ${project.groupId}.${project.artifactId}
              Git-Descriptor: ${system-allow-fail;git describe --dirty --always --abbrev=9}
              Git-SHA: ${system-allow-fail;git rev-list -1 --no-abbrev-commit HEAD}
              Test-Cases: ${classes;HIERARCHY_INDIRECTLY_ANNOTATED;org.junit.platform.commons.annotation.Testable;CONCRETE;NAMED;*.integration.*}
              -fixupmessages: *for this fragment/require bundle cannot be found on the classpath
              -noextraheaders: true
              -noimportjava: true
              ]]>
                </bnd>
                <bndfile>tests.bnd</bndfile>
                <artifactFragment>true</artifactFragment>
                <testCases>useTestCasesHeader</testCases>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>biz.aQute.bnd</groupId>
          <artifactId>bnd-resolver-maven-plugin</artifactId>
          <version>${bnd.version}</version>
          <executions>
            <!-- Integration Test Configuration -->
            <execution>
              <id>resolve-test</id>
              <phase>pre-integration-test</phase>
              <goals>
                <goal>resolve</goal>
              </goals>
              <configuration>
                <bndruns>
                  <include>*-test.bndrun</include>
                </bndruns>
                <bundles>
                  <bundle>
                    ${project.build.directory}/${project.build.finalName}-tests.jar</bundle>
                </bundles>
                <writeOnChanges>true</writeOnChanges>
                <failOnChanges>false</failOnChanges>
                <includeDependencyManagement>true</includeDependencyManagement>
                <reportOptional>false</reportOptional>
                <scopes>
                  <scope>compile</scope>
                  <scope>runtime</scope>
                  <scope>test</scope>
                </scopes>
              </configuration>
            </execution>
            <execution>
              <id>resolve</id>
              <goals>
                <goal>resolve</goal>
              </goals>
              <configuration>
                <writeOnChanges>true</writeOnChanges>
                <failOnChanges>false</failOnChanges>
                <includeDependencyManagement>true</includeDependencyManagement>
                <scopes>
                  <scope>compile</scope>
                  <scope>runtime</scope>
                </scopes>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>biz.aQute.bnd</groupId>
          <artifactId>bnd-testing-maven-plugin</artifactId>
          <version>${bnd.version}</version>
          <executions>
            <!-- OSGi integration tests execution -->
            <execution>
              <id>testing</id>
              <goals>
                <goal>testing</goal>
              </goals>
              <configuration>
                <bndruns>
                  <include>*-test.bndrun</include>
                </bndruns>
                <resolve>false</resolve>
                <failOnChanges>false</failOnChanges>
                <includeDependencyManagement>true</includeDependencyManagement>
                <scopes>
                  <scope>compile</scope>
                  <scope>runtime</scope>
                  <scope>test</scope>
                </scopes>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>biz.aQute.bnd</groupId>
          <artifactId>bnd-baseline-maven-plugin</artifactId>
          <version>${bnd.version}</version>
          <executions>
            <execution>
              <id>baseline</id>
              <goals>
                <goal>baseline</goal>
              </goals>
              <configuration>
                <failOnMissing>false</failOnMissing>
                <fullReport>true</fullReport>
                <includeDistributionManagement>false</includeDistributionManagement>
                <diffignores>
                  <diffignore>Bundle-Version</diffignore>
                </diffignores>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-clean-plugin</artifactId>
          <version>${maven.clean.plugin.version}</version>
        </plugin>
        <!-- default lifecycle, jar packaging: see
        https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>${maven.resources.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${maven.compiler.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${maven.surefire.plugin.version}</version>
          <configuration>
            <excludes>
              <exclude>**/integration/**</exclude>
            </excludes>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-install-plugin</artifactId>
          <version>${maven.install.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>${maven.jar.plugin.version}</version>
          <configuration>
            <archive>
              <manifestFile>
                ${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
            </archive>
            <skipIfEmpty>true</skipIfEmpty>
          </configuration>
          <executions>
            <execution>
              <id>test-jar</id>
              <phase>package</phase>
              <goals>
                <goal>test-jar</goal>
              </goals>
              <configuration>
                <archive>
                  <manifestFile>
                    ${project.build.testOutputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                </archive>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>flatten-maven-plugin</artifactId>
          <version>1.6.0</version>
          <configuration>
            <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.ec4j.maven</groupId>
          <artifactId>editorconfig-maven-plugin</artifactId>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>${maven-source-plugin-version}</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.7.0</version>
          <executions>
            <execution>
              <id>attach-javadocs</id>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>${maven-gpg-plugin-version}</version>
          <executions>
            <execution>
              <id>sign-artifacts</id>
              <phase>verify</phase>
              <goals>
                <goal>sign</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <!-- Prevent gpg from using pinentry programs -->
            <gpgArguments>
              <arg>--pinentry-mode</arg>
              <arg>loopback</arg>
            </gpgArguments>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>${maven.deploy.plugin.version}</version>
          <configuration>
            <skip>true</skip>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.sonatype.central</groupId>
          <artifactId>central-publishing-maven-plugin</artifactId>
          <version>0.9.0</version>
          <extensions>true</extensions>
          <configuration>
            <publishingServerId>central</publishingServerId>
            <autoPublish>true</autoPublish>
            <waitUntil>published</waitUntil>
            <centralSnapshotsUrl>
              https://central.sonatype.com/repository/maven-snapshots/</centralSnapshotsUrl>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.ec4j.maven</groupId>
          <artifactId>editorconfig-maven-plugin</artifactId>
          <version>0.1.3</version>
          <executions>
            <execution>
              <id>check</id>
              <phase>verify</phase>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <!-- See
            http://ec4j.github.io/editorconfig-maven-plugin/ for
            full configuration reference -->
            <excludes>
              <exclude>**/*.svg</exclude>
              <exclude>src/gen/**/*</exclude>
            </excludes>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-scm-plugin</artifactId>
          <version>${maven-scm-plugin-version}</version>
          <configuration>
            <skip>true</skip>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>

  </build>

  <profiles>
    <profile>
      <id>eclipse-licenses-check</id>
      <pluginRepositories>
        <pluginRepository>
          <id>dash-licenses-snapshots</id>
          <url>
            https://repo.eclipse.org/content/repositories/dash-licenses-releases/</url>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </pluginRepository>
      </pluginRepositories>
      <build>
        <plugins>
          <!--
          https://github.com/eclipse/dash-licenses/blob/master/README.md#maven-plugin-options -->
          <plugin>
            <groupId>org.eclipse.dash</groupId>
            <artifactId>license-tool-plugin</artifactId>
            <version>1.1.0</version>
            <executions>
              <execution>
                <id>license-check</id>
                <goals>
                  <goal>license-check</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-deploy-plugin</artifactId>
            <configuration>
              <skip>true</skip>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>javadoc-check</id>
      <properties>
        <javadoc.failed.on.error>true</javadoc.failed.on.error>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>deploy</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
