<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>com.github.mike10004</groupId>
    <artifactId>mysql-dist</artifactId>
    <version>5.6.28</version>
    <packaging>pom</packaging>
    <name>mysql-dist-freebsd10</name>
    <description>Portable MySQL Maven artifact for FreeBSD 10.0</description>
    <url>https://github.com/mike10004/mysql-dist-freebsd</url>
    <properties>
        <distro.basename>mysql-5.6.28-freebsd10.0-x86_64</distro.basename>
        <distro.url>https://cdn.mysql.com/Downloads/MySQL-5.6/${distro.basename}.tar.gz</distro.url>
        <distro.sha1>6d0ff35d2e937eb23fa208e7db403c4699979262</distro.sha1>
        <assembly.id>freebsd-amd64</assembly.id>
    </properties>
    <profiles>
        <profile>
            <id>small-practice-distro</id>
            <properties>
                <distro.basename>ziptest-1.0</distro.basename>
                <distro.url>http://localhost/~${user.name}/ziptest/${distro.basename}.tar.gz</distro.url>
                <distro.sha1>b0586f27d2f4bb93f6c232da446352e85c366293</distro.sha1>
                <assembly.id>practice-distro</assembly.id>
            </properties>
        </profile>
        
        <profile>
            <id>artifact-deployment</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-gpg-plugin</artifactId>
                    </plugin>            
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
    <inceptionYear>2016</inceptionYear>
    <licenses>
        <license>
            <name>GNU General Public License (GPL)</name>
            <url>http://www.gnu.org/licenses/gpl.txt</url>
        </license>
    </licenses>
    <scm>
        <connection>scm:git:https://github.com/mike10004/mysql-dist-freebsd.git</connection>
        <developerConnection>scm:git:git@github.com:mike10004/mysql-dist-freebsd.git</developerConnection>
        <url>https://github.com/mike10004/mysql-dist-freebsd/tags/4.0.0</url>
    </scm>
    <developers>
        <developer>
            <id>mchaberski</id>
            <name>Mike Chaberski</name>
            <email>mchaberski+dev@gmail.com</email>
            <timezone>America/New_York</timezone>
        </developer>
    </developers>
    <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>
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <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.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>1.6.5</version>
                    <extensions>true</extensions>
                    <configuration>
                        <serverId>ossrh</serverId>
                        <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                        <autoReleaseAfterClose>false</autoReleaseAfterClose>
                    </configuration>
                </plugin>                
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>sonar-maven-plugin</artifactId>
                    <version>2.2</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>com.googlecode.maven-download-plugin</groupId>
                <artifactId>download-maven-plugin</artifactId>
                <version>1.2.1</version>
                <executions>
                    <execution>
                        <id>download-mysql-distribution-tar</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>wget</goal>
                        </goals>
                        <configuration>
                            <url>${distro.url}</url>
                            <sha1>${distro.sha1}</sha1>
                        </configuration>
                    </execution>
                </executions>
            </plugin>            
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.4.0</version>
                <executions>
                    <execution>
                        <id>untar-mysql-distribution</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <executable>tar</executable>
                            <arguments>
                                <argument>xf</argument>
                                <argument>${project.build.directory}/${distro.basename}.tar.gz</argument>
                                <argument>-C</argument>
                                <argument>${project.build.directory}</argument>
                            </arguments>
                        </configuration>
                    </execution>
<!--                    <execution>
                        <id>zip-mysql-distribution</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <workingDirectory>${project.build.directory}</workingDirectory>
                            <executable>zip</executable>
                            <arguments>
                                <argument>-rq</argument>
                                <argument>${distro.basename}.zip</argument>
                                <argument>${distro.basename}</argument>
                            </arguments>
                        </configuration>
                    </execution>-->
                </executions>
            </plugin>    
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.5.3</version>
                <executions>
                    <execution>
                        <id>distro-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <descriptors>
                                <descriptor>src/assembly/release.xml</descriptor>
                            </descriptors>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
