<?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>com.keyware.sonar</groupId>
        <artifactId>sonar-keyware-plugins</artifactId>
        <version>1.0-SNAPSHOT</version>
    </parent>

    <name>Java 信息安全性设计准则</name>
    <artifactId>sonar-keyware-plugins-java</artifactId>
    <packaging>sonar-plugin</packaging>
    <version>1.0-SNAPSHOT</version>
    <description>用于检查Java源代码的安全性设计准则的Sonarqube插件</description>

    <licenses>
        <license>
            <name>Keyware Private Terms</name>
            <distribution>user must manually download and install the dependency.</distribution>
        </license>
    </licenses>

    <organization>
        <name>北京关键科技股份有限公司</name>
        <url>http://www.keyware.cn</url>
    </organization>

    <developers>
        <developer><id>guoxin</id><name>GuoXin</name><organization>Keyware</organization></developer>
        <developer><id>renfengjiang</id><name>RenFengJiang</name><organization>Keyware</organization></developer>
        <developer><id>renfengshan</id><name>RenFengShan</name><organization>Keyware</organization></developer>
        <developer><id>wuhaoyang</id><name>WuHaoYang</name><organization>Keyware</organization></developer>
        <developer><id>zhangchenbao</id><name>ZhangChenBao</name><organization>Keyware</organization></developer>
    </developers>

    <properties>
        <jacoco.version>0.8.10</jacoco.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    <url>http://www.keyware.cn</url>
    <scm>
        <connection>scm:git:http://www.keyware.cn</connection>
        <developerConnection>scm:git:http://www.keyware.cn</developerConnection>
        <url>http://www.keyware.cn</url>
        <tag>-</tag>
    </scm>
    <dependencies>
        <dependency>
            <groupId>org.sonarsource.java</groupId>
            <artifactId>sonar-java-plugin</artifactId>
            <version>7.30.1.34514</version>
            <type>sonar-plugin</type>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>org.sonarsource.api.plugin</groupId>
            <artifactId>sonar-plugin-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.sonarsource.analyzer-commons</groupId>
            <artifactId>sonar-analyzer-commons</artifactId>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- unit tests -->
        <dependency>
            <groupId>org.sonarsource.api.plugin</groupId>
            <artifactId>sonar-plugin-api-test-fixtures</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.sonarsource.sonarqube</groupId>
            <artifactId>sonar-plugin-api-impl</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.sonarsource.java</groupId>
            <artifactId>test-classpath-reader</artifactId>
            <version>7.30.1.34514</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.sonarsource.java</groupId>
            <artifactId>java-checks-testkit</artifactId>
            <version>7.30.1.34514</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-migrationsupport</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId>
                <artifactId>sonar-packaging-maven-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <pluginKey>keywareJavaPlugin</pluginKey>
                    <pluginName>Java 安全性设计准则</pluginName>
                    <pluginClass>com.keyware.sonar.java.JavaSecurityDesignRulesPlugin</pluginClass>
                    <sonarLintSupported>true</sonarLintSupported>
                    <skipDependenciesPackaging>true</skipDependenciesPackaging>
                    <pluginApiMinVersion>9.14.0.375</pluginApiMinVersion>
                    <requirePlugins>java:${project.version}</requirePlugins>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <configuration>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>11</source>
                    <target>11</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco.version}</version>
                <executions>
                    <execution>
                        <id>prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- only required to run UT - these are UT dependencies -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy</id>
                        <phase>test-compile</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.slf4j</groupId>
                                    <artifactId>slf4j-api</artifactId>
                                    <version>1.7.30</version>
                                    <type>jar</type>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.commons</groupId>
                                    <artifactId>commons-collections4</artifactId>
                                    <version>4.0</version>
                                    <type>jar</type>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>javax</groupId>
                                    <artifactId>javaee-api</artifactId>
                                    <version>6.0</version>
                                    <type>jar</type>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.springframework</groupId>
                                    <artifactId>spring-webmvc</artifactId>
                                    <version>4.3.3.RELEASE</version>
                                    <type>jar</type>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.springframework</groupId>
                                    <artifactId>spring-web</artifactId>
                                    <version>4.3.3.RELEASE</version>
                                    <type>jar</type>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.springframework</groupId>
                                    <artifactId>spring-context</artifactId>
                                    <version>4.3.3.RELEASE</version>
                                    <type>jar</type>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>junit</groupId>
                                    <artifactId>junit</artifactId>
                                    <version>4.13.2</version>
                                    <type>jar</type>
                                </artifactItem>
                            </artifactItems>
                            <outputDirectory>${project.build.directory}/test-jars</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <configuration>
                    <header>${project.basedir}/src/main/resources/license-header.txt</header>
                    <!--排除文件-->
                    <excludes>
                        <exclude>**/*.properties</exclude>
                        <exclude>*.sh</exclude>
                        <exclude>*.yml</exclude>
                        <exclude>.editorconfig</exclude>
                        <exclude>.gitignore</exclude>
                        <exclude>**/*.md</exclude>
                        <exclude>**/*.xml</exclude>
                    </excludes>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>