<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.karaf.features</groupId>
    <version>1.0.0</version>

    <artifactId>subethamail</artifactId>
    <name>Subethamail karaf feature project</name>
    <packaging>pom</packaging>

    <properties>
        <karaf-version>4.2.5</karaf-version>
    </properties>

    <description>Karaf Apache Commons  features</description>
    <url>https://github.com/BlackBeltTechnology/karaf-features-${project.artifactId}</url>
    <issueManagement>
        <url>https://github.com/BlackBeltTechnology/karaf-features-${project.artifactId}/issues</url>
        <system>GitHub Issues</system>
    </issueManagement>
    
    <scm>
        <connection>scm:git:git://github.com/BlackBeltTechnology/karaf-features-${project.artifactId}.git</connection>
        <developerConnection>scm:git:ssh://${git.username}@github.com:BlackBeltTechnology/karaf-features-${project.artifactId}.git</developerConnection>
        <url>https://github.com/BlackBeltTechnology/karaf-features-${project.artifactId}</url>
    </scm>
    
    <developers>
        <developer>
            <id>robson</id>
            <name>Robert Csakany</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>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>


    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.karaf.tooling</groupId>
                    <artifactId>karaf-maven-plugin</artifactId>
                    <version>${karaf-version}</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>2.5.2</version>
                    <executions>
                        <execution>
                            <id>default-install</id>
                            <configuration>
                                <skip>${deployOnly}</skip>
                            </configuration>
                        </execution>
                        <execution>
                            <id>default-test</id>
                            <configuration>
                                <skip>${deployOnly}</skip>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.2</version>
                </plugin>
                

            </plugins>
        </pluginManagement>
    </build>
    
    <profiles>
        <profile>
            <activation>
                <property>
                    <name>github_release</name>
                    <value>!true</value>
                </property>
            </activation>
            <modules>
                <module>features</module>
                <module>kar</module>
            </modules>
        </profile>
        
        <profile>
            <id>release-github</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>de.jutzig</groupId>
                        <artifactId>github-release-plugin</artifactId>
                        <version>1.3.0</version>
                        <inherited>false</inherited>
                        <executions>
                            <execution>
                                <id>release-to-github</id>
                                <phase>deploy</phase>
                                <goals>
                                    <goal>release</goal>
                                </goals>
                                <configuration>
                                    <repositoryId>https://github.com/BlackBeltTechnology/karaf-features-${project.artifactId}.git</repositoryId>
                                    <description>Branch: ${env.WERCKER_GIT_BRANCH} Wercker: ${env.WERCKER_RUN_URL}</description>
                                    <releaseName>${project.version}</releaseName>
                                    <deleteRelease>true</deleteRelease>
                                    <tag>${project.version}</tag>
                                    <fileSets>
                                        <fileSet>
                                            <directory>features/target/feature/</directory>
                                            <includes>
                                                <include>feature.xml</include>
                                            </includes>
                                        </fileSet>
                                        <fileSet>
                                            <directory>kar/target</directory>
                                            <includes>
                                                <include>*.kar</include>
                                            </includes>
                                        </fileSet>
                                    </fileSets>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        
        <profile>
            <id>sign-artifacts</id>
            <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>
                                <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>
        </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-javadoc-plugin</artifactId>
                     <version>2.9.1</version>
                     <executions>
                     <execution>
                     <id>attach-javadocs</id>
                     <goals>
                     <goal>jar</goal>
                     </goals>
                     </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>

		<profile>
			<id>release-judong</id>
			<distributionManagement>
				<snapshotRepository>
					<id>judong-nexus-distribution</id>
					<url>${env.JUDONG_MAVEN_UPSTREAM_SNAPSHOT}</url>
				</snapshotRepository>
				<repository>
					<id>judong-nexus-distribution</id>
					<url>${env.JUDONG_MAVEN_UPSTREAM_RELEASE}</url>
				</repository>
			</distributionManagement>
		</profile>
        
        <profile>
            <id>release-dummy</id>
            <distributionManagement>
                <snapshotRepository>
                    <id>dummy-distribution</id>
                    <url>file:///tmp/maven-snapshot/</url>
                </snapshotRepository>
                <repository>
                    <id>dummy-distribution</id>
                    <url>file:///tmp/maven-release/</url>
                </repository>
            </distributionManagement>
        </profile>

    </profiles>

</project>
