<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>com.tencent.tsf</groupId>
    <artifactId>femas-springcloud-greenwich-plugin</artifactId>
    <version>2.0.1</version>
  </parent>
  <groupId>com.tencent.tsf</groupId>
  <artifactId>femas-springcloud-greenwich-loadbalance-plugin</artifactId>
  <version>2.0.1</version>
  <dependencies>
    <dependency>
      <groupId>com.tencent.tsf</groupId>
      <artifactId>femas-springcloud-plugin-common</artifactId>
      <exclusions>
        <exclusion>
          <groupId>com.netflix.ribbon</groupId>
          <artifactId>ribbon-eureka</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
  </dependencies>
  <build>
    <finalName>${project.artifactId}-${project.version}-${maven.build.timestamp}</finalName>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
          <encoding>UTF-8</encoding>
          <showWarnings>true</showWarnings>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.1.1</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <transformers>
                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
              </transformers>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <minimizeJar>true</minimizeJar>
          <shadedArtifactAttached>false</shadedArtifactAttached>
          <createDependencyReducedPom>false</createDependencyReducedPom>
          <filters>
            <filter>
              <artifact>*:*</artifact>
              <excludes>
                <exclude>META-INF/*.SF</exclude>
                <exclude>META-INF/*.DSA</exclude>
                <exclude>META-INF/*.RSA</exclude>
              </excludes>
            </filter>
          </filters>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <tasks>
                <mkdir dir="${project.basedir}/../../../femas-agent" />
                <mkdir dir="${project.basedir}/../../../femas-agent/plugins/spring-cloud-g" />
                <mkdir dir="${project.basedir}/../../../femas-agent/config/spring-cloud-g" />
                <copy file="${project.basedir}/src/main/resources/plugin.yaml" tofile="${project.basedir}/../../../femas-agent/config/spring-cloud-g/${project.artifactId}.yaml" overwrite="true" />
                <copy file="${project.build.directory}/${project.artifactId}-${project.version}-${maven.build.timestamp}.jar" tofile="${project.basedir}/../../../femas-agent/plugins/spring-cloud-g/${project.artifactId}-${project.version}-${maven.build.timestamp}.jar" overwrite="true" />
              </tasks>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
