<?xml version="1.0" encoding="UTF-8"?>

<!--
    Licensed under the European Space Agency Public License, Version 2.0
    You may not use this file except in compliance with the License.

    Except as expressly set forth in this License, the Software is provided to
    You on an "as is" basis and without warranties of any kind, including without
    limitation merchantability, fitness for a particular purpose, absence of
    defects or errors, accuracy or non-infringement of intellectual property rights.
 
    See the License for the specific language governing permissions and limitations under the License.
-->

<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
  
    <parent>
        <groupId>int.esa.ccsds.mo</groupId>
        <artifactId>parent</artifactId>
        <version>14.2</version>
        <relativePath>../../parent/pom.xml</relativePath>
    </parent>
  
    <artifactId>api-generator-maven-plugin</artifactId>
    <version>14.2</version>
    <packaging>maven-plugin</packaging>
  
    <name>ESA MO API Generator - Maven Plugin</name>
    <description>Maven Plugin to generate APIs for MO services</description>
  
    <organization>
        <name>ESA</name>
        <url>http://www.esa.int</url>
    </organization>
  
    <licenses>
        <license>
            <name>The European Space Agency Public License, Version 2.0</name>
            <url>https://raw.githubusercontent.com/esa/mo-services-java/master/LICENCE.md</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git@github.com:esa/mo-services-java.git</connection>
        <developerConnection>scm:git:git@github.com:esa/mo-services-java.git</developerConnection>
        <url>https://github.com/esa/mo-services-java</url>
    </scm>
  
    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/esa/mo-services-java/issues</url>
    </issueManagement>
  
    <developers>
        <developer>
            <id>SamCooper</id>
            <name>Sam Cooper</name>
            <email>sam@brightascension.com</email>
            <url>https://github.com/SamCooper</url>
        </developer>
    </developers>

    <properties>
        <assembly.mainClass>esa.mo.tools.stubgen.StubGenerator</assembly.mainClass>
    </properties>

    <dependencies>
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-impl</artifactId>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-core</artifactId>
        </dependency>
        <dependency>
            <groupId>xml-apis</groupId>
            <artifactId>xml-apis</artifactId>
            <version>1.3.04</version>
        </dependency>
        <!--
            Temporary, for running the two generators side by side through the same build:
            NewJavaGenerator reaches the new library through the interface this plugin
            expects. At v15.0 the library replaces the old generator outright and the
            adapter goes with the interface. See api-generator-lib/DESIGN.md section 3.
        -->
        <dependency>
            <groupId>int.esa.ccsds.mo</groupId>
            <artifactId>api-generator-lib</artifactId>
        </dependency>
        <dependency>
            <groupId>int.esa.ccsds.mo</groupId>
            <artifactId>generator-interfaces</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <version>3.6.0</version>
        </dependency>
    </dependencies>
  
    <build>
        <resources>
            <!-- Restored: the parent declares it, and overriding <resources> here dropped
                 it, so nothing under src/main/resources was ever packaged. -->
            <resource>
                <directory>${basedir}/src/main/resources</directory>
            </resource>
            <resource>
                <directory>${basedir}/..</directory>
                <includes>
                    <include>LICENCE.md</include>
                </includes>
            </resource>
        </resources>
    
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <version>3.6.0</version>
            </plugin>
        </plugins>
    </build>
  
    <profiles>
        <profile>
            <id>assemble</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-assembly-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
    
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin> 
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId> 
                        <executions> 
                            <execution> 
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <configuration>
                                    <excludePackageNames>esa</excludePackageNames>
                                </configuration>
                            </execution> 
                        </executions> 
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
