view common/pom.xml @ 25:dd0992bd51aa

Add Maven Central upload, refactor lang-schema and json libs to thermostat-common library - merge common-json and common-lang-schema packages into thermostat- common. - add targets to generate Javadoc and source jars, and modify sources to remove some Javadoc warnings. - add targets to sign and deploy thermostat-common to Maven Central. Reviewed-by: sgehwolf, neugens Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2017-September/025214.html
author Simon Tooke <stooke@redhat.com>
date Fri, 29 Sep 2017 14:48:00 -0400
parents 0a4ed473faab
children 33cf0b946e3d
line wrap: on
line source

<?xml version="1.0" encoding="UTF-8"?>
<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.redhat.thermostat</groupId>
    <artifactId>thermostat-common</artifactId>
    <version>0.1.0</version>
    <packaging>bundle</packaging>

    <!-- required for uploading to Maven Central -->
    <name>Thermostat project - common library</name>
    <description>A shared library used by other components of Thermostat</description>
    <url>http://icedtea.classpath.org/thermostat</url>
    <licenses>
        <license>
            <name>GNU General Public License, version 2 (with "classpath exception")</name>
            <url>https://www.gnu.org/licenses/gpl-2.0.html</url>
        </license>
    </licenses>
    <developers>
        <developer>
            <name>Severin Gehwolf</name>
            <email>sgehwolf@redhat.com</email>
            <organization>Red Hat, Inc.</organization>
            <organizationUrl>http://www.redhat.com</organizationUrl>
        </developer>
        <developer>
            <name>Simon Tooke</name>
            <email>stooke@redhat.com</email>
            <organization>Red Hat, Inc.</organization>
            <organizationUrl>http://www.redhat.com</organizationUrl>
        </developer>
        <developer>
           <name>Mario Torre</name>
           <email>neugens@redhat.com</email>
           <organization>Red Hat, Inc.</organization>
           <organizationUrl>http://www.redhat.com</organizationUrl>
        </developer>
    </developers>
    <scm>
        <connection>scm:hg:http://icedtea.classpath.org/hg/thermostat-ng</connection>
        <developerConnection>scm:hg:ssh://icedtea.classpath.org/hg/thermostat-ng</developerConnection>
        <url>http://icedtea.classpath.org/thermostat</url>
    </scm>

    <properties>
        <thermostat.java.version>1.7</thermostat.java.version>

        <!-- OSGi version information -->
        <osgi.core.version>4.3.1</osgi.core.version>
        <osgi.compendium.version>4.3.1</osgi.compendium.version>
        <osgi.compendium.osgi-version>4.3.1.201210102024</osgi.compendium.osgi-version>
        <osgi.compendium.bundle.symbolic-name>osgi.cmpn</osgi.compendium.bundle.symbolic-name>
        <felix.framework.version>4.2.0</felix.framework.version>
        <felix.scr.version>1.8.2</felix.scr.version>
        <felix.scr.annotations.version>1.9.12</felix.scr.annotations.version>

        <!-- other packages -->
        <gson.version>2.6.2</gson.version>
        <junit.version>4.12</junit.version>
    </properties>

    <!-- define repos for staging -->
    <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>

    <!-- create a 'deploy' profile, and only sign when deploying (NOT when installing, as would happen if this was in the build section) -->
    <!-- to deploy properly, use mvn clean deploy -Pdeploy -->
    <profiles>
        <profile>
            <id>deploy</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.5</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <!--
                     3.6+ is JDK 9 compatible. See:
                     https://cwiki.apache.org/confluence/display/MAVEN/Java+9+-+Jigsaw
                 -->
                <version>3.6.1</version>
                <configuration>
                    <fork>true</fork>
                    <meminitial>128m</meminitial>
                    <maxmem>1024m</maxmem>
                    <source>${thermostat.java.version}</source>
                    <target>${thermostat.java.version}</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>1.4.0</version>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Bundle-SymbolicName>com.redhat.thermostat.common</Bundle-SymbolicName>
                        <Bundle-Vendor>Red Hat, Inc.</Bundle-Vendor>
                        <Export-Package>
                            com.redhat.thermostat.common.json,
                            com.redhat.thermostat.common.json.models,
                            com.redhat.thermostat.common.yaml,
                            com.redhat.thermostat.lang.schema,
                            com.redhat.thermostat.lang.schema.models,
                            com.redhat.thermostat.lang.schema.annotations
                        </Export-Package>
                        <Private-Package>
                            com.redhat.thermostat.lang.schema.internal,
                        </Private-Package>
                        <!-- Do not autogenerate uses clauses in Manifests -->
                        <_nouses>true</_nouses>
                    </instructions>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-scr-plugin</artifactId>
                <executions>
                    <execution>
                        <id>generate-scr-scrdescriptor</id>
                        <goals>
                            <goal>scr</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.9.1</version>
                <configuration>
                    <excludePackageNames>*.internal</excludePackageNames>
                </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.7</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.scr</artifactId>
            <version>${felix.scr.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.framework</artifactId>
            <version>${felix.framework.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.scr.annotations</artifactId>
            <version>${felix.scr.annotations.version}</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>${gson.version}</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

</project>