<?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>de.ingogriebsch.maven</groupId>
    <artifactId>sync-packagejson-version-maven-plugin</artifactId>
    <version>1.3.0</version>
    <packaging>maven-plugin</packaging>

    <name>Sync package.json version Maven plugin</name>
    <description>Synchronizes the version of a package.json file with the version of the pom.xml.</description>
    <url>https://github.com/ingogriebsch/sync-packagejson-version-maven-plugin</url>
    <inceptionYear>2021</inceptionYear>
    <organization>
        <name>Ingo Griebsch</name>
        <url>https://ingogriebsch.de</url>
    </organization>
    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>ingogriebsch</id>
            <name>Ingo Griebsch</name>
            <email>ingo.griebsch@gmx.de</email>
            <url>https://ingogriebsch.de</url>
            <timezone>Europe/Berlin</timezone>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git://github.com/ingogriebsch/sync-packagejson-version-maven-plugin.git</connection>
        <developerConnection>scm:git:git://github.com/ingogriebsch/sync-packagejson-version-maven-plugin.git</developerConnection>
        <url>https://github.com/ingogriebsch/sync-packagejson-version-maven-plugin.git</url>
    </scm>
    <issueManagement>
        <url>https://github.com/ingogriebsch/sync-packagejson-version-maven-plugin/issues</url>
        <system>GitHub</system>
    </issueManagement>

    <properties>
        <doc.source.directory>${project.build.directory}/doc-sources</doc.source.directory>
        <doc.target.directory>${project.build.directory}/generated-docs</doc.target.directory>
        <jackson.version>2.13.3</jackson.version>
        <java.version>1.8</java.version>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>
        <maven.integration-test.debug>false</maven.integration-test.debug>
        <maven.version>3.3.9</maven.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <sonar.host.url>https://sonarcloud.io</sonar.host.url>
        <sonar.organization>ingogriebsch</sonar.organization>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.dataformat</groupId>
            <artifactId>jackson-dataformat-xml</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>31.0.1-jre</version>
        </dependency>
        <dependency>
            <groupId>commons-beanutils</groupId>
            <artifactId>commons-beanutils</artifactId>
            <version>1.9.4</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.11.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.12.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
            <version>${maven.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>${maven.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <version>3.6.4</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.shared</groupId>
            <artifactId>file-management</artifactId>
            <version>3.0.0</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.maven</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>3.22.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hibernate.validator</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>7.0.2.Final</version>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>5.8.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-junit-jupiter</artifactId>
            <version>4.3.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.22</version>
            <optional>true</optional>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.10.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>3.0.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-invoker-plugin</artifactId>
                    <version>3.2.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.2.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.3.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-plugin-plugin</artifactId>
                    <version>3.6.4</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.2.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.2.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.0.0-M5</version>
                </plugin>
                <plugin>
                    <groupId>org.asciidoctor</groupId>
                    <artifactId>asciidoctor-maven-plugin</artifactId>
                    <version>2.2.2</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>tidy-maven-plugin</artifactId>
                    <version>1.1.0</version>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>0.8.7</version>
                </plugin>
                <plugin>
                    <groupId>org.sonarsource.scanner.maven</groupId>
                    <artifactId>sonar-maven-plugin</artifactId>
                    <version>3.9.1.2184</version>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>1.6.8</version>
                </plugin>
                <plugin>
                    <groupId>net.revelc.code</groupId>
                    <artifactId>impsort-maven-plugin</artifactId>
                    <version>1.6.2</version>
                </plugin>
                <plugin>
                    <groupId>net.revelc.code.formatter</groupId>
                    <artifactId>formatter-maven-plugin</artifactId>
                    <version>2.17.1</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin><!-- https://code.revelc.net/formatter-maven-plugin -->
                <groupId>net.revelc.code.formatter</groupId>
                <artifactId>formatter-maven-plugin</artifactId>
                <configuration>
                    <configFile>/etc/ide/eclipse.java-formatter.xml</configFile>
                </configuration>
                <executions>
                    <execution>
                        <id>default-validate</id>
                        <goals>
                            <goal>validate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin><!-- https://www.jacoco.org/jacoco/trunk/doc/maven.html -->
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin><!-- https://maven.apache.org/plugin-tools/maven-plugin-plugin/ -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <configuration>
                    <goalPrefix>sync-packagejson-version</goalPrefix>
                </configuration>
                <executions>
                    <execution>
                        <id>generate-helpmojo</id>
                        <goals>
                            <goal>helpmojo</goal>
                        </goals>
                        <configuration>
                            <helpPackageName>de.ingogriebsch.maven.sync.packagejson.version.plugin.help</helpPackageName>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin><!-- https://code.revelc.net/impsort-maven-plugin -->
                <groupId>net.revelc.code</groupId>
                <artifactId>impsort-maven-plugin</artifactId>
                <configuration>
                    <staticGroups>java.,javax.,*</staticGroups>
                    <groups>java.,javax.,*</groups>
                </configuration>
                <executions>
                    <execution>
                        <id>default-check</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin><!-- https://maven.apache.org/plugins/maven-resources-plugin/ -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-doc-resources</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${doc.source.directory}</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>src/main/asciidoc</directory>
                                    <filtering>false</filtering>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>copy-javadoc-resources</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${doc.target.directory}/apidocs</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${project.build.directory}/apidocs</directory>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin><!-- https://asciidoctor.org/docs/asciidoctor-maven-plugin/ -->
                <groupId>org.asciidoctor</groupId>
                <artifactId>asciidoctor-maven-plugin</artifactId>
                <configuration>
                    <attributes>
                        <maven-version>${maven.version}</maven-version>
                        <java-version>${java.version}</java-version>
                        <project-version>${project.version}</project-version>
                        <project-description>${project.description}</project-description>
                    </attributes>
                    <logHandler>
                        <failIf>
                            <severity>WARN</severity>
                        </failIf>
                    </logHandler>
                    <outputDirectory>${doc.target.directory}</outputDirectory>
                    <sourceDirectory>${doc.source.directory}</sourceDirectory>
                </configuration>
                <executions>
                    <execution>
                        <id>generate-docs</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>process-asciidoc</goal>
                        </goals>
                        <configuration>
                            <backend>html5</backend>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin><!-- https://maven.apache.org/plugins/maven-javadoc-plugin/ -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default-jar</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <breakiterator>true</breakiterator>
                    <quiet>true</quiet>
                    <show>package</show>
                </configuration>
            </plugin>
            <plugin><!-- https://maven.apache.org/plugins/maven-source-plugin/ -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin><!-- http://www.mojohaus.org/tidy-maven-plugin/ -->
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>tidy-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default-check</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>integration-tests</id>
            <build>
                <plugins>
                    <plugin><!-- https://maven.apache.org/plugins/maven-invoker-plugin/ -->
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-invoker-plugin</artifactId>
                        <configuration>
                            <addTestClassPath>true</addTestClassPath>
                            <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
                            <debug>${maven.integration-test.debug}</debug>
                            <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
                            <pomIncludes>**/pom.xml</pomIncludes>
                            <postBuildHookScript>verify</postBuildHookScript>
                            <preBuildHookScript>prepare</preBuildHookScript>
                            <scriptVariables>
                                <version>${project.version}</version>
                                <repoDir>${project.build.directory}/local-repo</repoDir>
                            </scriptVariables>
                            <settingsFile>src/it/settings.xml</settingsFile>
                            <skipInstallation>${maven.test.skip}</skipInstallation>
                            <skipInvocation>${maven.test.skip}</skipInvocation>
                            <streamLogs>${maven.integration-test.debug}</streamLogs>
                            <useLocalRepository>true</useLocalRepository>
                        </configuration>
                        <executions>
                            <execution>
                                <id>integration-test</id>
                                <goals>
                                    <goal>install</goal>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>ossrh</id>
            <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>
                <plugins>
                    <plugin><!-- https://maven.apache.org/plugins/maven-gpg-plugin/ -->
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin><!-- https://github.com/sonatype/nexus-maven-plugins/tree/master/staging/maven-plugin -->
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <extensions>true</extensions>
                        <configuration>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <serverId>ossrh</serverId>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <!-- https://stackoverflow.com/questions/7905501/get-rid-of-pom-not-found-warning-for-org-eclipse-m2elifecycle-mapping -->
            <id>eclipse</id>
            <activation>
                <property>
                    <name>m2e.version</name>
                </property>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin><!-- https://www.eclipse.org/m2e/ -->
                            <groupId>org.eclipse.m2e</groupId>
                            <artifactId>lifecycle-mapping</artifactId>
                            <version>1.0.0</version>
                            <configuration>
                                <lifecycleMappingMetadata>
                                    <pluginExecutions>
                                        <pluginExecution>
                                            <pluginExecutionFilter>
                                                <groupId>org.apache.maven.plugins</groupId>
                                                <artifactId>maven-plugin-plugin</artifactId>
                                                <versionRange>[1.0.0,)</versionRange>
                                                <goals>
                                                    <goal>descriptor</goal>
                                                    <goal>helpmojo</goal>
                                                </goals>
                                            </pluginExecutionFilter>
                                            <action>
                                                <ignore />
                                            </action>
                                        </pluginExecution>
                                    </pluginExecutions>
                                </lifecycleMappingMetadata>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
    </profiles>
</project>
