<!--
  ~ Licensed under the EUPL, Version 1.2 or - as soon they will be approved by
  ~ the European Commission - subsequent versions of the EUPL (the "Licence");
  ~ You may not use this work except in compliance with the Licence.
  ~ You may obtain a copy of the Licence at:
  ~
  ~   https://joinup.ec.europa.eu/software/page/eupl
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the Licence is distributed on an "AS IS" basis,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the Licence for the specific language governing permissions and
  ~ limitations under the Licence.
  -->

<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>
    <groupId>org.entur</groupId>
    <artifactId>netex-java-model</artifactId>
    <version>1.0.7</version>

    <name>netex-java-model</name>
    <description>Generates Java model from NeTEx xsds using jaxb.</description>
    <url>https://github.com/entur/netex-java-model</url>
    <licenses>
        <license>
            <name>EUPL-1.2 with modifications</name>
            <url>https://joinup.ec.europa.eu/software/page/eupl</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Erlend Nossum</name>
            <email>erlend.nossum@entur.org</email>
            <organization>Entur</organization>
            <organizationUrl>http://www.entur.org</organizationUrl>
        </developer>
    </developers>

    <properties>
        <assertj.core.version>3.4.1</assertj.core.version>
        <junit.version>4.12</junit.version>
        <jaxb.fluent.api.version>2.1.8</jaxb.fluent.api.version>
        <cxf.xjc.plugin.version>3.0.5</cxf.xjc.plugin.version>
        <xjc.guava.plugin.version>0.3.1</xjc.guava.plugin.version>
        <jaxb.java.time.adapters.version>1.1.3</jaxb.java.time.adapters.version>
        <slf4j.version>1.7.21</slf4j.version>
        <jaxb2-commons-lang.version>2.4</jaxb2-commons-lang.version>
        <commons-lang3.version>3.5</commons-lang3.version>
        <cxf-xjc.version>3.1.0</cxf-xjc.version>
    </properties>

    <scm>
        <connection>scm:git:ssh://git@github.com/entur/netex-java-model.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/entur/netex-java-model.git</developerConnection>
        <url>https://github.com/entur/netex-java-model/tree/master</url>
      <tag>netex-java-model-1.0.7</tag>
  </scm>

    <organization>
        <name>Entur AS</name>
        <url>http://www.entur.org/</url>
    </organization>


    <distributionManagement>
        <snapshotRepository>
            <id>Nexus</id>
            <url>https://nexus.rutebanken.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>${assertj.core.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.migesok</groupId>
            <artifactId>jaxb-java-time-adapters</artifactId>
            <version>${jaxb.java.time.adapters.version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jvnet.jaxb2_commons</groupId>
            <artifactId>jaxb2-commons-lang</artifactId>
            <version>${jaxb2-commons-lang.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>${commons-lang3.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf.xjc-utils</groupId>
            <artifactId>cxf-xjc-runtime</artifactId>
            <version>${cxf-xjc.version}</version>
        </dependency>
    </dependencies>

    <build>
		<resources>
			<resource>
				<directory>profile</directory>
			</resource>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
		</resources>
        <extensions>
            <!-- maven3 will need wagon-ssh extension in order to be able to release,
            Using external variant in order to retain keys, etc -->
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-ssh-external</artifactId>
                <version>2.10</version>
            </extension>
        </extensions>
        <plugins>
            <plugin>
                <artifactId>exec-maven-plugin</artifactId>
                <groupId>org.codehaus.mojo</groupId>
                <version>1.1-beta-1</version>
                <executions>
                    <execution>
                        <id>download-extract</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <executable>./bin/netex-download-extract.sh</executable>
                        </configuration>
                    </execution>
                    <execution>
                        <id>annotation-removal</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <executable>./bin/annotation-replacer.sh</executable>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-xjc-plugin</artifactId>
                <version>${cxf.xjc.plugin.version}</version>
                <configuration>
                    <extensions>
                        <extension>net.java.dev.jaxb2-commons:jaxb-fluent-api:${jaxb.fluent.api.version}</extension>
                        <extension>org.apache.cxf.xjcplugins:cxf-xjc-ts:${cxf-xjc.version}</extension>
                    </extensions>
                </configuration>
                <executions>
                    <execution>
                        <id>generate-sources</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>xsdtojava</goal>
                        </goals>
                        <configuration>
                            <xsdOptions>
                                <xsdOption>
                                    <xsd>
                                        ${basedir}/profile/NeTEx-XML-1.07/schema/xsd/NeTEx_publication.xsd
                                    </xsd>
                                    <extension>true</extension>
                                    <bindingFile>bindings.xjb</bindingFile>
                                    <extensionArgs>
                                        <extensionArg>-Xbug986</extensionArg>
                                        <extensionArg>-Xfluent-api</extensionArg>
                                        <extensionArg>-Xts:style:org.rutebanken.netex.OmitNullsToStringStyle.INSTANCE</extensionArg>
                                    </extensionArgs>
                                </xsdOption>
                            </xsdOptions>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.cxf.xjcplugins</groupId>
                        <artifactId>cxf-xjc-bug986</artifactId>
                        <version>${cxf.xjc.plugin.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.5.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF-8</encoding>
                    <compilerArgs>
                        <!--arg>-Werror</arg-->
                        <arg>-Xlint:all</arg>
                    </compilerArgs>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.plexus</groupId>
                        <artifactId>plexus-compiler-javac</artifactId>
                        <version>2.7</version>
                    </dependency>
                </dependencies>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
                <configuration>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <useReleaseProfile>false</useReleaseProfile>
                    <releaseProfiles>release,sign,!noPublicDeploy</releaseProfiles>
                    <goals>deploy</goals>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.scm</groupId>
                        <artifactId>maven-scm-provider-gitexe</artifactId>
                        <version>1.9.2</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>


    <profiles>
        <profile>
            <id>doclint-java8-disable</id>
            <activation>
                <jdk>[1.8,)</jdk>
            </activation>
            <properties>
                <javadoc.opts>-Xdoclint:none</javadoc.opts>
            </properties>
        </profile>

        <profile>
            <id>sign</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.0.1</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals><goal>jar</goal></goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>2.10.4</version>
                        <configuration>
                            <additionalparam>${javadoc.opts}</additionalparam>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.8</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <!-- Set this to true and the release will automatically proceed and sync to Central Repository will follow  -->
                            <autoReleaseAfterClose>false</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>release</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <distributionManagement>
                <!--snapshotRepository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
                </snapshotRepository-->
                <repository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                </repository>
            </distributionManagement>
        </profile>
    </profiles>


</project>
