<?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>
    <parent>
        <groupId>org.jboss</groupId>
        <artifactId>jboss-parent</artifactId>
        <version>46</version>
    </parent>
    <groupId>io.fabric8</groupId>
    <artifactId>maven-model-helper</artifactId>
    <version>37</version>
    <properties>
        <maven.compiler.parameters>true</maven.compiler.parameters>
        <maven.javadoc.failOnError>false</maven.javadoc.failOnError>
        <version.formatter.plugin>2.23.0</version.formatter.plugin>
        <version.impsort.plugin>1.9.0</version.impsort.plugin>
        <version.surefire.plugin>3.1.0</version.surefire.plugin>
        <format.skip>false</format.skip>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-model</artifactId>
            <version>3.9.8</version>
        </dependency>
        <!-- Required for MavenJDOMWriter -->
        <dependency>
            <groupId>org.jdom</groupId>
            <artifactId>jdom2</artifactId>
            <version>2.0.6.1</version>
        </dependency>
        <!-- Test dependencies -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>5.10.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>3.24.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.xmlunit</groupId>
            <artifactId>xmlunit-assertj</artifactId>
            <version>2.10.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.approvaltests</groupId>
            <artifactId>approvaltests</artifactId>
            <version>24.2.0</version>
            <scope>test</scope>
        </dependency>
        <!-- needed during tests when running on Java9+ -->
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-core</artifactId>
            <version>4.0.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-impl</artifactId>
            <version>4.0.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.activation</groupId>
            <artifactId>activation</artifactId>
            <version>1.1.1</version>
            <scope>test</scope>
        </dependency>

    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>net.revelc.code.formatter</groupId>
                <artifactId>formatter-maven-plugin</artifactId>
                <version>${version.formatter.plugin}</version>
                <configuration>
                    <configFile>eclipse-format.xml</configFile>
                    <lineEnding>LF</lineEnding>
                    <skip>${format.skip}</skip>
                    <skipXmlFormatting>true</skipXmlFormatting>
                </configuration>
            </plugin>
            <plugin>
                <groupId>net.revelc.code</groupId>
                <artifactId>impsort-maven-plugin</artifactId>
                <version>${version.impsort.plugin}</version>
                <configuration>
                    <groups>java.,javax.,jakarta.,org.,com.</groups>
                    <staticGroups>*</staticGroups>
                    <skip>${format.skip}</skip>
                    <removeUnused>true</removeUnused>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <shadedArtifactAttached>true</shadedArtifactAttached>
                            <shadedClassifierName>uber</shadedClassifierName>
                            <transformers>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                    <mainClass>io.fabric8.maven.cmd.Main</mainClass>
                                </transformer>
                            </transformers>
                            <filters>
                                <filter>
                                    <artifact>*:*</artifact>
                                    <excludes>
                                        <exclude>META-INF/LICENSE</exclude>
                                        <exclude>META-INF/NOTICE</exclude>
                                        <exclude>META-INF/MANIFEST.MF</exclude>
                                        <exclude>META-INF/*.SF</exclude>
                                        <exclude>META-INF/*.DSA</exclude>
                                        <exclude>META-INF/*.RSA</exclude>
                                    </excludes>
                                </filter>
                            </filters>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <releaseProfiles>gpg-sign,jboss-release,release</releaseProfiles>
                    <tagNameFormat>v@{project.version}</tagNameFormat>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.7.0</version>
                <extensions>true</extensions>
                <configuration>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <serverId>ossrh</serverId>
                    <stagingProgressTimeoutMinutes>60</stagingProgressTimeoutMinutes>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <scm>
        <connection>scm:git:git://github.com/fabric8io/maven-model-helper.git</connection>
        <developerConnection>scm:git:git@github.com:fabric8io/maven-model-helper.git</developerConnection>
        <url>https://github.com/fabric8io/maven-model-helper</url>
        <tag>v37</tag>
    </scm>
    <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>
    <profiles>
        <profile>
            <id>format</id>
            <activation>
                <!-- This profile is effectively activated by default -->
                <property>
                    <name>!no-format</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>net.revelc.code.formatter</groupId>
                        <artifactId>formatter-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>format-sources</id>
                                <phase>process-sources</phase>
                                <goals>
                                    <goal>format</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>net.revelc.code</groupId>
                        <artifactId>impsort-maven-plugin</artifactId>
                        <configuration>
                            <removeUnused>true</removeUnused>
                        </configuration>
                        <executions>
                            <execution>
                                <id>sort-imports</id>
                                <phase>process-sources</phase>
                                <goals>
                                    <goal>sort</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>validate</id>
            <activation>
                <property>
                    <name>no-format</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>net.revelc.code.formatter</groupId>
                        <artifactId>formatter-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>process-sources</phase>
                                <goals>
                                    <goal>validate</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>net.revelc.code</groupId>
                        <artifactId>impsort-maven-plugin</artifactId>
                        <configuration>
                            <removeUnused>true</removeUnused>
                        </configuration>
                        <executions>
                            <execution>
                                <id>check-imports</id>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
