<?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>hu.blackbelt.osgi.liquibase</groupId>
    <artifactId>osgi-liquibase</artifactId>
    <version>1.0.0</version>
    <packaging>bundle</packaging>
    
    <name>OSGi liquibase</name>
    <description>OSGi version of Liquibase</description>
    
    <url>http://github.com/BlackBeltTechnology/osgi-liquibase</url>
    
    <issueManagement>
        <url>https://github.com/BlackBeltTechnology/osgi-liquibase/issues</url>
        <system>GitHub Issues</system>
    </issueManagement>
    
    <scm>
        <connection>scm:git:git://github.com/BlackBeltTechnology/osgi-liquibase.git</connection>
        <developerConnection>scm:git:ssh://${git.username}@github.com:BlackBeltTechnology/osgi-liquibase.git</developerConnection>
        <url>http://github.com/BlackBeltTechnology/osgi-liquibase</url>
    </scm>
    
    <developers>
        <developer>
            <id>borcsokj</id>
            <name>Börcsök József</name>
            <email>jozsef.borcsok@blackbelt.hu</email>
            <url>https://bitbucket.org/borcsokj</url>
            <organization>BlackBelt Technology</organization>
            <organizationUrl>http://www.blackbelt.hu</organizationUrl>
        </developer>
        
        <developer>
            <id>robson</id>
            <name>Csákány Róbert</name>
            <email>robert.csakany@blackbelt.hu</email>
            <url>https://github.com/robertcsakany</url>
            <organization>BlackBelt Technology</organization>
            <organizationUrl>http://www.blackbelt.hu</organizationUrl>
        </developer>
        
    </developers>
    
    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>https://opensource.org/licenses/Apache-2.0</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.7</maven.compiler.source>
        <maven.compiler.target>1.7</maven.compiler.target>
        <liquibase.version>3.4.1</liquibase.version>
    </properties>
    
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>3.5.0</version>
                <extensions>true</extensions>
                <executions>
                    <!-- This execution makes sure that the manifest is available
                     when the tests are executed -->
                    <execution>
                        <id>generate-manifest</id>
                        <goals>
                            <goal>manifest</goal>
                        </goals>
                        <configuration>
                            <exportScr>true</exportScr>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <instructions>
                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                        <Export-Package>hu.blackbelt.osgi.liquibase.*;version=${project.version},liquibase;version=${liquibase.version},liquibase.*;version=${liquibase.version}</Export-Package>
                        <Import-Package>
                            *;resolution:=optional
                        </Import-Package>
                        <Embed-Dependency>
                            groupId=org.liquibase;artifactId=liquibase-core;inline=!liquibase/servicelocator/ServiceLocator.class|liquibase/ext/logging/LiquibaseLogger.class,
                            groupId=org.yaml;artifactId=snakeyaml;inline=true,
                            groupId=org.apache.commons;artifactId=commons-lang3;inline=true
                        </Embed-Dependency>
                    </instructions>
                </configuration>
            </plugin>
            
            <!-- Needed if you use versionAsInProject() -->
            <plugin>
                <groupId>org.apache.servicemix.tooling</groupId>
                <artifactId>depends-maven-plugin</artifactId>
                <version>1.4.0</version>
                <executions>
                    <execution>
                        <id>generate-depends-file</id>
                        <goals>
                            <goal>generate-depends-file</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    
    <dependencies>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.1</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.2</version>
            <scope>provided</scope>
        </dependency>
        
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.core</artifactId>
            <version>6.0.0</version>
            <scope>provided</scope>
        </dependency>
        
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.service.component.annotations</artifactId>
            <version>1.3.0</version>
        </dependency>
        
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.service.metatype.annotations</artifactId>
            <version>1.3.0</version>
        </dependency>

        <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
            <version>1.13</version>
        </dependency>
        <dependency>
            <groupId>org.liquibase</groupId>
            <artifactId>liquibase-core</artifactId>
            <version>${liquibase.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.4</version>
        </dependency>
    </dependencies>
    
    <profiles>
        <profile>
            <id>release-github</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>de.jutzig</groupId>
                        <artifactId>github-release-plugin</artifactId>
                        <version>1.2.0</version>
                        <configuration>
                            <repositoryId>https://github.com/BlackBeltTechnology/osgi-liquibase.git</repositoryId>
                            <description>Branch: ${env.WERCKER_GIT_BRANCH} Wercker: ${env.WERCKER_RUN_URL}</description>
                            <releaseName>${project.version}</releaseName>
                            <prerelease>true</prerelease>
                            <tag>${project.version}</tag>
                            <fileSets>
                                <fileSet>
                                    <directory>target</directory>
                                    <includes>
                                        <include>*.jar</include>
                                    </includes>
                                </fileSet>
                            </fileSets>
                        </configuration>
                        <executions>
                            <execution>
                                <id>release-to-github</id>
                                <phase>install</phase>
                                <goals>
                                    <goal>release</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        
        <profile>
            <id>release-blackbelt</id>
            <distributionManagement>
                <snapshotRepository>
                    <id>blackbelt-nexus-distribution</id>
                    <url>https://nexus.blackbelt.cloud/repository/maven-judo-snapshot/</url>
                </snapshotRepository>
                <repository>
                    <id>blackbelt-nexus-distribution</id>
                    <url>https://nexus.blackbelt.cloud/repository/maven-judo-release/</url>
                </repository>
            </distributionManagement>
        </profile>
        
        
        <profile>
            <id>release-central</id>
            <build>
                <plugins>
                    <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>
                    
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.2.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-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <keyname>${gpg.keyname}</keyname>
                                    <passphraseServerId>${gpg.keyname}</passphraseServerId>
                                    <!-- This is necessary for gpg to not try to use the pinentry programs -->
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
            <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>
