<?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.automon</groupId>
        <artifactId>automon_parent</artifactId>
        <version>2.0.0</version>
    </parent>
    <artifactId>spring_aop</artifactId>
    <packaging>jar</packaging>

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

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
            </plugin>
            <plugin>
                <!-- if this doesn't run try to go to the parent directory and run 'mvn clean install' first -->
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <configuration>
                    <!-- generates class path with all dependencies as well as generated class -->
                    <classpathScope>compile</classpathScope>
                    <mainClass>org.automon.spring_aop.SpringMain</mainClass>
                    <systemProperties>
                        <property>
                            <!-- note assuming the proper jars are in the classpath you could use jamon, metrics, nullimp, sysout -->
                            <key>org.automon</key>
                            <value>sysout</value>
                        </property>
                    </systemProperties>
                </configuration>
            </plugin>
            <plugin>
                <!-- The shade plugin bundles all jars into one big 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
                -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <executions>
                    <execution>
                        <configuration>
                            <artifactSet>
                                <excludes>
                                    <!-- Exclude Hazelcast -->
                                    <exclude>com.hazelcast:*</exclude>
                                    <exclude>io.micrometer:*</exclude>
                                    <exclude>com.jamonapi:*</exclude>
                                    <!-- Exclude Log4j template -->
                                    <exclude>org.apache.logging.log4j:log4j-layout-template-json</exclude>
                                </excludes>
                            </artifactSet>
                            <transformers>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                                    <resource>META-INF/spring.handlers</resource>
                                </transformer>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                                    <resource>META-INF/spring.schemas</resource>
                                </transformer>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                    <mainClass>org.automon.spring_aop.SpringMain</mainClass>
                                </transformer>
                            </transformers>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>

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

        <!-- for spring aop -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </dependency>

        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjrt</artifactId>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjweaver</artifactId>
            <scope>compile</scope>
        </dependency>
    </dependencies>
    <name>spring_aop</name>

</project>