<?xml version="1.0" encoding="UTF-8"?>
<project>     
    <modelVersion>4.0.0</modelVersion>    
    <groupId>com.hadoopz</groupId>
    <artifactId>AuthAPI</artifactId>
    <packaging>jar</packaging>
    <version>1.0.7</version>
    <name>AuthAPI</name>
    <url>http://www.hadoopz.com</url>
    <description>AuthAPI</description>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>    
    </properties>
    <parent> 
        <groupId>com.Project_Root</groupId> 
        <artifactId>Project_Root</artifactId> 
        <version>1.0.0</version>
    </parent>
    <dependencies>     
        
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>        
               
        <dependency>
            <groupId>com.hadoopz</groupId>
            <artifactId>YesHttp</artifactId>
        </dependency>
        
        <dependency>
            <groupId>com.hadoopz</groupId>
            <artifactId>ITools</artifactId>
            <scope>provided</scope>
        </dependency>
        
        <dependency>
            <groupId>com.hadoopz</groupId>
            <artifactId>IProtocol</artifactId>
            <scope>provided</scope>
        </dependency>
        
        <dependency>
            <groupId>net.sf.json-lib</groupId>
            <artifactId>json-lib</artifactId>
            <classifier>jdk15</classifier>
            <scope>provided</scope>
        </dependency>
 
        
    </dependencies>
    <issueManagement>
        <system>Github Issue</system>
        <url>https://github.com/bigdog001/openAuthN/issues</url>
    </issueManagement>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Bigdog</name>
            <email>294356967@qq.com</email>
        </developer>
    </developers>

    <scm>
        <connection>scm:git@github.com/bigdog001/openAuthN.git</connection>
        <developerConnection>scm:git@github.com/bigdog001/openAuthN.git</developerConnection>
        <url>git@github.com/bigdog001/openAuthN.git</url>
    </scm>
        

    <profiles>
        <profile>
            <id>release</id>
            <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>
        </profile>
    </profiles>
    <build>
        
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
                <excludes>
                    <exclude>log4j.properties</exclude>                    
                </excludes>
            </resource>
        </resources>
        
        <plugins>

            <plugin>
                <groupId>com.github.wvengen</groupId>
                <artifactId>proguard-maven-plugin</artifactId>
                <version>2.0.11</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>proguard</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <attach>true</attach>
                    <attachArtifactClassifier>pg</attachArtifactClassifier>
                    <!-- attach 的作用是在 install 与 deploy 时将生成的 pg 文件也安装与部署 -->
                    <options> <!-- 详细配置方式参考 ProGuard 官方文档 -->
                        <!--<option>-dontobfuscate</option>-->
                        <option>-ignorewarnings</option> <!--忽略所有告警-->
                        <option>-printmapping</option>
                        <option>-keeppackagenames</option>
                        <option>-dontshrink</option>   <!--不做 shrink -->
                        <option>-dontoptimize</option> <!--不做 optimize -->
                        <option>-dontskipnonpubliclibraryclasses</option>
                        <option>-dontskipnonpubliclibraryclassmembers</option>

                        
                        <!--平行包结构（重构包层次），所有混淆的类放在 pg 包下-->

                        <!-- 以下为 Keep，哪些内容保持不变，因为有一些内容混淆后（a,b,c）导致反射或按类名字符串相关的操作失效 -->

                        <option>-keep class **.package-info</option>
                        <!--保持包注解类-->

                        <option>-keepattributes Signature</option>
                        <!--JAXB NEED，具体原因不明，不加会导致 JAXB 出异常，如果不使用 JAXB 根据需要修改-->
                        <!-- Jaxb requires generics to be available to perform xml parsing and without this option ProGuard was not retaining that information after obfuscation. That was causing the exception above. -->

                        <option>-keepattributes SourceFile,LineNumberTable,*Annotation*</option>
                        <!--保持源码名与行号（异常时有明确的栈信息），注解（默认会过滤掉所有注解，会影响框架的注解）-->

                       
                        <!--保持枚举中的名子，确保枚举 valueOf 可以使用-->

                       
                        <!--保持 Bean 类，（由于很多框架会对 Bean 中的内容做反射处理，请根据自己的业务调整） -->

                        

                    </options>
                    <outjar>${project.build.finalName}-pg</outjar>
                    <libs>
                        <lib>${java.home}/lib/rt.jar</lib>
                    </libs>

                </configuration>
            </plugin>
            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.2</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>  

	  
            <!-- Gpg Signature -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.5</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>