<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>
    <packaging>pom</packaging>
    <modules>
        <module>java-protobuf-no-gc-rt</module>
        <module>java-protobuf-no-gc-gen</module>
        <module>sample-java-protobuf-no-gc</module>
    </modules>
    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:https://github.com/ebfhub/java-protobuf-no-gc.git</connection>
        <url>https://github.com/ebfhub/java-protobuf-no-gc</url>
    </scm>
    <artifactId>java-protobuf-no-gc</artifactId>
    <groupId>com.github.ebfhub</groupId>
    <version>1.1.7.7</version>

    <properties>
        <java-protobuf-version>1.1.7.7</java-protobuf-version>
        <slf4jVersion>1.6.5</slf4jVersion>
        <lombok.version>1.14.8</lombok.version>
        <protobuf.input.directory>${project.basedir}/src/main/proto</protobuf.input.directory>
        <protobuf.output.directory>${project.build.directory}/generated-sources</protobuf.output.directory>
        <!-- library versions -->
        <build-helper-maven-plugin.version>1.9.1</build-helper-maven-plugin.version>
        <maven-antrun-plugin.version>1.8</maven-antrun-plugin.version>
        <maven-dependency-plugin.version>2.10</maven-dependency-plugin.version>
        <maven-shade-plugin.version>2.4.2</maven-shade-plugin.version>
        <os-maven-plugin.version>1.4.1.Final</os-maven-plugin.version>
        <protobuf.version>3.7.1</protobuf.version>
        <grpc.version>1.29.0</grpc.version>
        <salesforce.version>1.0.1</salesforce.version>
        <trove.version>3.0.3</trove.version>
    </properties>

    <distributionManagement>
        <site>
            <id>api.wiki</id>
            <url>https://github.com/ebfhub/java-protobuf-no-gc</url>
        </site>
        <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>

    <name>Java Protobuf encoder/decoder without GC</name>
    <description>
        Generate Java Protobuf encoder/decoder that does not invoke GC.
    </description>
    <url>https://github.com/ebfhub/java-protobuf-no-gc</url>

    <developers>
        <developer>
            <id>ebfhub</id>
            <name>EBF Hub</name>
            <email>ebfhub@gmail.com</email>
            <organizationUrl>https://github.com/ebfhub</organizationUrl>
        </developer>
    </developers>

    <profiles>
        <!-- Activate using the release property: mvn clean install -Prelease -->
        <profile>
            <id>release</id>
            <activation>
                <property>
                    <name>release</name>
                </property>
            </activation>

            <build>
                <plugins>
                    <!-- To release to Maven central -->
                    <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>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                    <!-- To generate javadoc -->
                    <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-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.1.0</version>
                        <configuration>
                            <source>8</source>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- To sign the artifacts -->
                    <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>
                </plugins>

            </build>
        </profile>
    </profiles>
</project>
