<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         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>me.shib.plugin</groupId>
    <artifactId>text-file-writer-maven-plugin</artifactId>
    <packaging>maven-plugin</packaging>
    <version>1.0.0</version>
    <name>Text File Writer - Maven Plugin</name>
    <description>Maven plugin to write dynamic text content into files (including maven properties)</description>
    <url>https://github.com/${project.owner.id}/${project.artifactId}</url>

    <issueManagement>
        <url>https://github.com/${project.owner.id}/${project.artifactId}/issues</url>
        <system>GitHub Issues</system>
    </issueManagement>

    <scm>
        <url>https://github.com/${project.owner.id}/${project.artifactId}</url>
        <connection>scm:git:https://github.com/${project.owner.id}/${project.artifactId}.git</connection>
        <developerConnection>scm:git:git@github.com:${project.owner.id}/${project.artifactId}.git</developerConnection>
    </scm>

    <developers>
        <developer>
            <name>Shibly Meeran</name>
            <url>https://github.com/shibme</url>
            <id>shibme</id>
        </developer>
    </developers>

    <distributionManagement>
        <repository>
            <id>bintray-${project.owner.id}-maven</id>
            <name>${project.owner.id}-maven</name>
            <url>https://api.bintray.com/maven/${project.owner.id}/maven/${project.artifactId}/;publish=1;override=1
            </url>
        </repository>
    </distributionManagement>

    <licenses>
        <license>
            <name>GNU General Public License</name>
            <url>http://www.gnu.org/licenses/gpl.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.owner.id>shibme</project.owner.id>
        <maven.compiler.source>1.7</maven.compiler.source>
        <maven.compiler.target>1.7</maven.compiler.target>
    </properties>

    <build>
        <plugins>
            <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>me.shib.plugin</groupId>
                <artifactId>text-file-writer-maven-plugin</artifactId>
                <version>1.0.0</version>
                <executions>
                    <execution>
                        <phase>install</phase>
                        <goals>
                            <goal>text-file-writer</goal>
                        </goals>
                        <configuration>
                            <charset>UTF-8</charset>
                            <files>
                                <file>
                                    <destination>README.md</destination>
                                    <overwrite>true</overwrite>
                                    <lines>
                                        <line># ${project.name}</line>
                                        <line>[![Maven Central](https://maven-badges.herokuapp.com/maven-central/${project.groupId}/${project.artifactId}/badge.svg)](https://maven-badges.herokuapp.com/maven-central/${project.groupId}/${project.artifactId})</line>
                                        <line>[![Build Status](https://gitlab.com/${project.owner.id}/${project.artifactId}/badges/master/pipeline.svg)](https://gitlab.com/${project.owner.id}/${project.artifactId}/pipelines)</line>
                                        <line></line>
                                        <line>${project.description}</line>
                                        <line></line>
                                        <line>* This [`README.md`](README.md) file itself was generated with ${project.artifactId} plugin. Refer to this project's [`pom.xml`](pom.xml) to know how it is done.</line>
                                        <line>* Alternatively, you can also refer to the below sample:</line>
                                        <line>```</line>
                                        <line>&lt;plugin&gt;</line>
                                        <line>&lt;groupId&gt;${project.groupId}&lt;/groupId&gt;</line>
                                        <line>&lt;artifactId&gt;${project.artifactId}&lt;/artifactId&gt;</line>
                                        <line>&lt;version&gt;${project.version}&lt;/version&gt;</line>
                                        <line>&lt;executions&gt;</line>
                                        <line>&lt;execution&gt;</line>
                                        <line>&lt;phase&gt;install&lt;/phase&gt;</line>
                                        <line>&lt;goals&gt;&lt;goal&gt;text-file-writer&lt;/goal&gt;&lt;/goals&gt;
                                        </line>
                                        <line>&lt;configuration&gt;</line>
                                        <line>&lt;charset&gt;UTF-8&lt;/charset&gt;</line>
                                        <line>&lt;files&gt;</line>
                                        <line>&lt;file&gt;</line>
                                        <line>&lt;destination&gt;README.md&lt;/destination&gt;</line>
                                        <line>&lt;overwrite&gt;true&lt;/overwrite&gt;</line>
                                        <line>&lt;lines&gt;</line>
                                        <line>&lt;line&gt;# ${project.name}&lt;/line&gt;</line>
                                        <line>&lt;line&gt;${project.description}&lt;/line&gt;</line>
                                        <line>&lt;/lines&gt;</line>
                                        <line>&lt;/file&gt;</line>
                                        <line>&lt;/files&gt;</line>
                                        <line>&lt;/configuration&gt;</line>
                                        <line>&lt;/execution&gt;</line>
                                        <line>&lt;executions&gt;</line>
                                        <line>&lt;/configuration&gt;</line>
                                        <line>&lt;/plugin&gt;</line>
                                        <line>```</line>
                                    </lines>
                                </file>
                            </files>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <pluginRepositories>
        <pluginRepository>
            <id>${project.distributionManagement.repository.id}</id>
            <name>bintray</name>
            <url>https://dl.bintray.com/${project.owner.id}/maven</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

    <dependencies>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>3.5.3</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
            <version>3.5.3</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
</project>
