<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>com.sap.cloud.servicesdk.xbem</groupId>
  <artifactId>emjapi-release</artifactId>
  <version>4.0.0</version>
  <packaging>pom</packaging>

  <modules>
    <module>emjapi-distribution</module>
  </modules>

  <!-- Project related information -->
  <name>emjapi: Release settings</name>
  <description>Release settings for emjapi (Java API for SAP Event Mesh)</description>
  <url>http://www.sap.com</url>
  <scm>
    <connection />
    <url />
    <developerConnection />
  </scm>
  <developers>
    <developer>
      <name>SAP SE</name>
      <organization>SAP SE</organization>
      <organizationUrl>http://www.sap.com</organizationUrl>
      <email />
    </developer>
  </developers>
  <licenses>
    <license>
      <name>SAP DEVELOPER LICENSE AGREEMENT</name>
      <url>https://tools.hana.ondemand.com/developer-license-3_1.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <!-- Project related build/dependency properties and settings -->
  <properties>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>
    <maven.compiler.encoding>UTF-8</maven.compiler.encoding>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <!-- Build settings -->
    <maven.deploy.skip>false</maven.deploy.skip>
    <maven.javadoc.skip>false</maven.javadoc.skip>
    <dist.assembly.skip>false</dist.assembly.skip>
    <deploy.snapshot.repository.url>http://no/default/available</deploy.snapshot.repository.url>
    <deploy.release.repository.url>http://no/default/available</deploy.release.repository.url>
  </properties>

  <distributionManagement>
    <repository>
      <id>deploy.release</id>
      <url>${deploy.release.repository.url}</url>
    </repository>
    <snapshotRepository>
      <id>deploy.snapshot</id>
      <url>${deploy.snapshot.repository.url}</url>
    </snapshotRepository>
  </distributionManagement>

  <build>
    <finalName>emjapi-distribution</finalName>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.4</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <phase>package</phase>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <forceCreation>true</forceCreation>
          <includePom>true</includePom>
          <excludes>
            <exclude>com/**/*</exclude>
            <exclude>com</exclude>
          </excludes>
          <archive>
            <manifestEntries>
              <Bundle-ManifestVersion>2</Bundle-ManifestVersion>
              <Bundle-Name>${project.artifactId}</Bundle-Name>
              <Bundle-SymbolicName>${project.artifactId}.source</Bundle-SymbolicName>
              <Bundle-Vendor>${project.organization.name}</Bundle-Vendor>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.4.0</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.8.2</version>
          <configuration>
            <skip>${maven.deploy.skip}</skip>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <profile>
      <id>dev</id>
      <properties>
        <maven.javadoc.skip>true</maven.javadoc.skip>
      </properties>
    </profile>
	<profile>
        <id>release.build</id>
        <activation>
            <property>
                <name>ldi.releaseBuild</name>
            </property>
        </activation>
        <properties>
            <maven.test.skip>true</maven.test.skip>
        </properties>
    </profile>
  </profiles>
</project>
