<?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.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>9</version>
    </parent>

    <groupId>org.automon</groupId>
    <artifactId>automon_parent</artifactId>
    <version>2.0.0</version>
    <packaging>pom</packaging>
    <name>automon parent</name>

    <description>Automon combines the power of AOP (AspectJ) with any monitoring or logging tools you already use to
        declaratively monitor your Java code, the JDK, and dependent libraries.
    </description>
    <url>http://www.automon.org</url>

    <licenses>
        <license>
            <name>Automon License (Apache 2.0)</name>
            <url>https://github.com/stevensouza/automon/blob/master/LICENSE</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <url>https://github.com/stevensouza/automon</url>
        <connection>scm:git:git://github.com:stevensouza/automon.git</connection>
        <developerConnection>scm:git:git@github.com:stevensouza/automon.git</developerConnection>
        <tag>v2.0.0</tag>
    </scm>

    <developers>
        <developer>
            <id>stevensouza</id>
            <name>Steve Souza</name>
            <email>steve@stevesouza.com</email>
        </developer>
    </developers>

    <modules>
        <module>automon</module>
        <module>helloworld_unwoven</module>
        <module>helloworld_woven</module>
        <module>spring_woven</module>
        <module>helloworld_unwoven_jamon</module>
        <module>unwoven_jdk</module>
        <module>webapp_unwoven</module>
        <module>spring_aop</module>
    </modules>

    <properties>
        <automon.version>2.0.0-SNAPSHOT</automon.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <jdk.version>17</jdk.version>
        <maven.compiler.source>${jdk.version}</maven.compiler.source>
        <maven.compiler.target>${jdk.version}</maven.compiler.target>
        <maven.javadoc.plugin.version>3.8.0</maven.javadoc.plugin.version>
        <maven.source.plugin.version>3.3.1</maven.source.plugin.version>
        <maven.compiler.plugin.version>3.13.0</maven.compiler.plugin.version>
        <surefire.version>3.3.1</surefire.version>
        <aspectj-maven-plugin.version>1.14</aspectj-maven-plugin.version>
        <maven-shade-plugin.version>3.6.0</maven-shade-plugin.version>
        <metrics.version>4.2.26</metrics.version>
        <jamonapi.version>2.82</jamonapi.version>
        <log4j.version>2.23.1</log4j.version>
        <slf4j.version>2.0.13</slf4j.version>
        <assertj.version>3.26.3</assertj.version>
        <aspectj.version>1.9.22.1</aspectj.version>
        <mojo.execution.version>3.3.0</mojo.execution.version>
        <mockito.version>5.12.0</mockito.version>
        <junit.version>5.10.3</junit.version>
        <newrelic.version>8.13.0</newrelic.version>
        <spring.version>6.1.10</spring.version>
        <spring.aop.version>${aspectj.version}</spring.aop.version>
        <micrometer.version>1.13.2</micrometer.version>
        <hsqldb.version>2.7.3</hsqldb.version>
        <servlet.version>6.1.0</servlet.version>
        <jsp.version>4.0.0</jsp.version>
        <maven-gpg-plugin.version>3.2.4</maven-gpg-plugin.version>
        <maven-release-plugin.version>3.0.1</maven-release-plugin.version>
        <gpg.skip>true</gpg.skip>
    </properties>

    <build>
        <pluginManagement>

            <plugins>

                <!-- plugin used to compile aspectj using maven https://github.com/dev-aspectj/aspectj-maven-plugin?tab=readme-ov-file -->
                <plugin>
                    <groupId>dev.aspectj</groupId>
                    <artifactId>aspectj-maven-plugin</artifactId>
                    <version>${aspectj-maven-plugin.version}</version>
                    <dependencies>
                        <dependency>
                            <groupId>org.aspectj</groupId>
                            <artifactId>aspectjtools</artifactId>
                            <!-- AspectJ compiler version, in sync with runtime -->
                            <version>${aspectj.version}</version>
                        </dependency>
                    </dependencies>

                    <configuration>
                        <source>${jdk.version}</source>
                        <target>${jdk.version}</target>
                        <complianceLevel>${jdk.version}</complianceLevel>
                        <!-- generates META-INF/aop-ajc.xml file and puts it in jar.  Recommended for aspectj libraries. -->
                        <outxml>true</outxml>
                        <showWeaveInfo>true</showWeaveInfo>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>compile</goal>       <!-- use this goal to weave constructor your main classes -->
                                <goal>test-compile</goal> <!-- use this goal to weave constructor your test classes -->
                            </goals>
                        </execution>
                        <execution>
                            <id>aspectj-ajdoc</id>
                            <phase>package</phase>
                            <goals>
                                <goal>aspectj-report</goal>
                            </goals>
                            <configuration>
                                <verbose>false</verbose>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven.javadoc.plugin.version}</version>
                    <configuration>
                        <source>${jdk.version}</source> <!-- or your Java version -->
                        <additionalJOption>-Xdoclint:none</additionalJOption>
                        <detectJavaApiLink>false</detectJavaApiLink>
                    </configuration>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </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.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>${mojo.execution.version}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>exec</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <!-- generates class path with constructor dependencies as well as generated class -->
                        <classpathScope>runtime</classpathScope>
                    </configuration>
                </plugin>

                <!-- The Surefire Plugin is used during the test phase of the build lifecycle to execute the unit tests of an application. -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${surefire.version}</version>
                </plugin>

                <plugin>
                    <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-gpg-plugin -->
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${maven-gpg-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <skip>${gpg.skip}</skip>

                        <gpgArguments>
                            <arg>--pinentry-mode</arg>
                            <arg>loopback</arg>
                        </gpgArguments>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven.compiler.plugin.version}</version>
                    <configuration>
                        <source>${jdk.version}</source>
                        <target>${jdk.version}</target>
                        <compilerArgument>-parameters</compilerArgument>
                    </configuration>
                </plugin>

                <plugin>
                    <!-- The maven shade plugin bundles all jars into one big jar (uber jar) making deployment and execution easier.
                     The mainClass element is defined so you can execute the jar without specifying the class.  To run this jar
                     simply type: java -Dorg.automon="sysout" -jar target/spring_aop-1.0.2-SNAPSHOT.jar
                     or more generally  java -jar myuber.jar arg1,arg2
                    -->
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>${maven-shade-plugin.version}</version>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>shade</goal>
                            </goals>
                            <configuration>
                                <createDependencyReducedPom>false</createDependencyReducedPom>
                                <shadedArtifactAttached>true</shadedArtifactAttached>
                                <shadedClassifierName>shaded</shadedClassifierName>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>${maven-release-plugin.version}</version>
                    <configuration>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                        <useReleaseProfile>false</useReleaseProfile>
                        <releaseProfiles>release</releaseProfiles>
                        <goals>deploy</goals>
                        <arguments>-Dgpg.skip=false</arguments>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
            </plugin>
        </plugins>
    </build>


    <distributionManagement>
        <snapshotRepository>
            <id>sonatype-nexus-snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>sonatype-nexus-staging</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <dependencyManagement>
        <dependencies>

            <dependency>
                <groupId>org.aspectj</groupId>
                <artifactId>aspectjweaver</artifactId>
                <version>${spring.aop.version}</version>
                <scope>test</scope>
            </dependency>

            <!-- runtime dependencies -->
            <dependency>
                <groupId>org.aspectj</groupId>
                <artifactId>aspectjrt</artifactId>
                <version>${aspectj.version}</version>
                <scope>provided</scope>
            </dependency>

            <!-- test dependencies -->
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>${assertj.version}</version>
                <scope>test</scope>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.mockito/mockito-core -->
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.version}</version>
                <scope>test</scope>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-api</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-engine</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>com.jamonapi</groupId>
                <artifactId>jamon</artifactId>
                <version>${jamonapi.version}</version>
                <!--                <scope>provided</scope>-->
            </dependency>

            <dependency>
                <groupId>io.dropwizard.metrics</groupId>
                <artifactId>metrics-core</artifactId>
                <version>${metrics.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>io.dropwizard.metrics</groupId>
                <artifactId>metrics-annotation</artifactId>
                <version>${metrics.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>io.micrometer</groupId>
                <artifactId>micrometer-core</artifactId>
                <version>${micrometer.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>com.newrelic.agent.java</groupId>
                <artifactId>newrelic-api</artifactId>
                <version>${newrelic.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context</artifactId>
                <version>${spring.version}</version>
            </dependency>

            <dependency>
                <groupId>org.hsqldb</groupId>
                <artifactId>hsqldb</artifactId>
                <version>${hsqldb.version}</version>
            </dependency>

            <dependency>
                <groupId>jakarta.servlet</groupId>
                <artifactId>jakarta.servlet-api</artifactId>
                <version>${servlet.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>jakarta.servlet.jsp</groupId>
                <artifactId>jakarta.servlet.jsp-api</artifactId>
                <version>${jsp.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-core</artifactId>
                <version>${log4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-api</artifactId>
                <version>${log4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-slf4j2-impl</artifactId>
                <version>${log4j.version}</version>
            </dependency>
            <!--   Need only if you output log4j2 as json using JsonTemplateLayout-->
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-layout-template-json</artifactId>
                <version>${log4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-ext -->
            <!--      NDC capabilities-->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-ext</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

</project>
