<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.github.dakusui</groupId>
    <artifactId>processstreamer</artifactId>
    <version>2.0.6</version>
    <description>Command line streamer library for Java 8</description>
    <packaging>jar</packaging>

    <name>processstreamer</name>
    <url>https://github.com/dakusui/processstreamer</url>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>http://www.opensource.org/licenses/mit-license.php</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git://github.com/dakusui/processstreamer.git</connection>
        <developerConnection>
            scm:git:git@github.com:dakusui/processstreamer.git
        </developerConnection>
        <url>https://github.com/dakusui/processstreamer</url>
        <tag>processstreamer-2.0.6</tag>
    </scm>

    <developers>
        <developer>
            <id>dakusui</id>
            <name>Hiroshi Ukai</name>
            <email>dakusui@gmail.com</email>
        </developer>
    </developers>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <env.GEM_PATH>${project.basedir}/.dependencies/gem/ruby</env.GEM_PATH>
        <jruby.version>9.4.8.0</jruby.version>
        <exec-maven-plugin.version>3.2.0</exec-maven-plugin.version>
        <maven-javadoc-plugin.version>3.10.1</maven-javadoc-plugin.version>
        <maven-site-plugin.version>4.0.0-M16</maven-site-plugin.version>
        <asciidoctor.maven.plugin.version>2.2.6</asciidoctor.maven.plugin.version>
        <asciidoctorj.version>2.5.13</asciidoctorj.version>
        <asciidoctorj.diagram.version>2.3.1</asciidoctorj.diagram.version>
        <asciidoclet.version>2.0.0</asciidoclet.version>
        <maven-gpg-plugin.version>3.2.6</maven-gpg-plugin.version>
        <maven-release-plugin.version>3.1.1</maven-release-plugin.version>
        <maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
        <maven-deploy-plugin.version>3.1.2</maven-deploy-plugin.version>
        <maven-source-plugin.version>3.3.1</maven-source-plugin.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>2.0.13</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>5.11.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>5.11.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.github.dakusui</groupId>
            <artifactId>valid8j</artifactId>
            <version>2.1.7</version>
        </dependency>
    </dependencies>

    <build>
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
                <includes>
                    <include>log4j.xml</include>
                </includes>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
                <configuration>
                    <source>21</source>
                    <target>21</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>${maven-release-plugin.version}</version>
                <configuration>
                    <arguments>-Dgpg.passphrase=${gpg.passphrase}</arguments>
                    <arguments>-P release-sign-artifacts</arguments>
                </configuration>
            </plugin>
            <plugin>
                <!-- Run with mvn org.pitest:pitest-maven:mutationCoverage -->
                <groupId>org.pitest</groupId>
                <artifactId>pitest-maven</artifactId>
                <version>1.2.0</version>
                <configuration>
                    <targetClasses>
                        <param>com.github.dakusui.processstreamer.*</param>
                    </targetClasses>
                    <targetTests>
                        <param>*Test</param>
                    </targetTests>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>${maven-deploy-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven-source-plugin.version}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.asciidoctor</groupId>
                <artifactId>asciidoctor-maven-plugin</artifactId>
                <version>${asciidoctor.maven.plugin.version}</version>
                <dependencies>
                    <!-- Comment this section to use the default jruby artifact provided by the plugin -->
                    <dependency>
                        <groupId>org.jruby</groupId>
                        <artifactId>jruby-complete</artifactId>
                        <version>${jruby.version}</version>
                    </dependency>
                    <!-- Comment this section to use the default AsciidoctorJ artifact provided by the plugin -->
                    <dependency>
                        <groupId>org.asciidoctor</groupId>
                        <artifactId>asciidoctorj</artifactId>
                        <version>${asciidoctorj.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.asciidoctor</groupId>
                        <artifactId>asciidoctorj-diagram</artifactId>
                        <version>${asciidoctorj.diagram.version}</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <sourceDirectory>src/site/asciidoc</sourceDirectory>
                    <requires>
                        <require>asciidoctor-diagram</require>
                    </requires>
                    <attributes>
                        <!-- Example below shows how to specify in this pom instead of System's PATH, the location of dot command of Graphviz, required by PlantUML libraries -->
                        <!-- Windows:
                            <graphvizdot>C:\Program Files (x86)\Graphviz2.38\bin\dot.exe</graphvizdot>
                        -->
                        <!-- *nix :
                            <graphvizdot>/usr/local/bin/dot</graphvizdot>
                        -->
                    </attributes>
                </configuration>
                <executions>
                    <execution>
                        <id>generate-html-doc</id>
                        <phase>site</phase>
                        <goals>
                            <goal>process-asciidoc</goal>
                        </goals>
                        <configuration>
                            <backend>html5</backend>
                            <outputDirectory>target/site</outputDirectory>
                            <attributes>
                                <imagesdir>.</imagesdir>
                                <toc>left</toc>
                                <icons>font</icons>
                                <sectanchors>true</sectanchors>
                                <idprefix />
                                <idseparator>-</idseparator>
                            </attributes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-javadoc-plugin.version}</version>
                <configuration>
                    <overview>src/main/javadoc/overview.adoc</overview>
                    <doclet>org.asciidoctor.asciidoclet.Asciidoclet</doclet>
                    <docletArtifact>
                        <groupId>org.asciidoctor</groupId>
                        <artifactId>asciidoclet</artifactId>
                        <version>${asciidoclet.version}</version>
                    </docletArtifact>
                    <additionalJOptions>
                        <additionalJOption>--add-exports=jdk.javadoc/jdk.javadoc.internal.api=asciidoclet
                        </additionalJOption>
                        <additionalJOption>--add-exports=jdk.javadoc/jdk.javadoc.internal.tool=asciidoclet
                        </additionalJOption>
                        <additionalJOption>--add-exports=jdk.compiler/com.sun.tools.javac.api=asciidoclet
                        </additionalJOption>
                        <additionalJOption>--add-exports=jdk.compiler/com.sun.tools.javac.parser=asciidoclet
                        </additionalJOption>
                        <additionalJOption>--add-exports=jdk.compiler/com.sun.tools.javac.tree=asciidoclet
                        </additionalJOption>
                        <additionalJOption>--add-exports=jdk.compiler/com.sun.tools.javac.model=asciidoclet
                        </additionalJOption>
                        <additionalJOption>--add-opens=jdk.compiler/com.sun.tools.javac.api=asciidoclet
                        </additionalJOption>
                        <additionalJOption>--add-opens=jdk.compiler/com.sun.tools.javac.parser=asciidoclet
                        </additionalJOption>
                        <additionalJOption>-J--add-opens=jdk.javadoc/jdk.javadoc.internal.api=ALL-UNNAMED
                        </additionalJOption>
                        <additionalJOption>-J--add-opens=jdk.javadoc/jdk.javadoc.internal.tool=ALL-UNNAMED
                        </additionalJOption>
                        <additionalJOption>-J--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
                        </additionalJOption>
                        <additionalJOption>-J--add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
                        </additionalJOption>
                        <additionalJOption>-J--add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
                        </additionalJOption>
                        <additionalJOption>-Xdoclint:all,-html,-accessibility</additionalJOption>
                    </additionalJOptions>
                    <additionalOptions>
                        --base-dir ${project.basedir}
                        --attribute "name=${project.name}"
                        --attribute "version=${project.version}"
                        --attribute "imagesoutdir=.asciidoctor/diagram"
                        --attribute "imagesdir=.asciidoctor/diagram"
                        --attribute "dot=/usr/bin/dot"
                        --require asciidoctor-diagram
                        --gem-path ${env.GEM_PATH}
                        --attribute data-uri
                    </additionalOptions>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>${exec-maven-plugin.version}</version>
                <executions>
                    <execution><!-- Remove diagram caches -->
                        <id>remove diag-*.png files</id>
                        <phase>clean</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <executable>bash</executable>
                            <arguments>
                                <argument>
                                    ${basedir}/src/build_tools/remove-adoc-diags.sh
                                </argument>
                            </arguments>
                        </configuration>
                    </execution>
                    <execution><!-- Remove diagram caches -->
                        <id>remove package-info.java files</id>
                        <phase>clean</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <executable>bash</executable>
                            <arguments>
                                <argument>
                                    ${basedir}/src/build_tools/remove-package-info-java.sh
                                </argument>
                            </arguments>
                        </configuration>
                    </execution>
                    <execution><!-- Run our version calculation script -->
                        <id>package-info.java generation</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <executable>bash</executable>
                            <arguments>
                                <argument>
                                    ${basedir}/src/build_tools/package-info-adoc_to_package-info-java.sh
                                </argument>
                            </arguments>
                        </configuration>
                    </execution>
                    <execution><!-- Run our version calculation script -->
                        <id>asciidoctor-diagram-installation</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <executable>bash</executable>
                            <arguments>
                                <argument>
                                    -eu
                                </argument>
                                <argument>
                                    ${basedir}/src/build_tools/install-asciidoctor-diagram.sh
                                </argument>
                            </arguments>
                        </configuration>
                    </execution>
                    <execution><!-- Run our version calculation script -->
                        <id>publish-gh-pages</id>
                        <phase>site-deploy</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <executable>bash</executable>
                            <arguments>
                                <argument>
                                    ${basedir}/src/build_tools/publish-gh-pages.sh
                                </argument>
                            </arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>${maven-site-plugin.version}</version>
                <dependencies>
                    <!-- Comment this section to use the default jruby artifact provided by the plugin -->
                    <dependency>
                        <groupId>org.jruby</groupId>
                        <artifactId>jruby-complete</artifactId>
                        <version>${jruby.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.asciidoctor</groupId>
                        <artifactId>asciidoctor-maven-plugin</artifactId>
                        <version>${asciidoctor.maven.plugin.version}</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <!-- disable generateReports if you don't want to include the built-in reports -->
                    <generateReports>true</generateReports>
                    <generateSitemap>true</generateSitemap>
                    <relativizeSiteLinks>false</relativizeSiteLinks>
                    <locales>en</locales>
                    <inputEncoding>UTF-8</inputEncoding>
                    <outputEncoding>UTF-8</outputEncoding>
                    <skipDeploy>false</skipDeploy>
                    <!-- asciidoc -->
                    <!-- optional site-wide AsciiDoc attributes -->
                    <!-- attributes>
                        <icons>font</icons>
                        <source-highlighter>coderay</source-highlighter>
                        <coderay-css>style</coderay-css>
                        <toclevels>2</toclevels>
                    </attributes>
                </asciidoc -->
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>${maven-gpg-plugin.version}</version>
            </plugin>
        </plugins>
    </build>

    <distributionManagement>
        <snapshotRepository>
            <id>sonatype-nexus-snapshots</id>
            <name>Sonatype Nexus snapshot repository</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>sonatype-nexus-staging</id>
            <name>Sonatype Nexus release repository</name>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/
            </url>
        </repository>
        <site>
            <id>${project.name}</id>
            <url>file:///${user.dir}/target/site-staging</url>
        </site>
    </distributionManagement>

    <profiles>
        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven-gpg-plugin.version}</version>
                        <configuration>
                            <passphrase>${gpg.passphrase}</passphrase>
                        </configuration>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
