<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>    	  
    <groupId>com.magnews</groupId>
    <artifactId>scripting-api</artifactId>    
    <version>23.02</version> 
    <packaging>jar</packaging>
    <name>MagNews App API</name>
    <url>http://www.magnews.com</url>
    <description>MagNews Platform Application development API</description>
    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>            
        </license>
    </licenses>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>        
        <libs.jcipi-annotations>1.0</libs.jcipi-annotations> 
        <libs.spotbugsannotations>3.1.0</libs.spotbugsannotations>
        <libs.spotbugsmaven>3.1.0-RC6</libs.spotbugsmaven> 
    </properties>
    <build>               
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.6</version>          
            </plugin>          
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.4</version>               
                <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>3.0.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>2.9</version>              
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.7.0</version>
                <configuration>
                    <source>1.8</source> <!-- DEVE RIMANERE 1.7 -->
                    <target>1.8</target> <!-- DEVE RIMANERE 1.7 -->
                </configuration>
            </plugin>

            <plugin>
                <groupId>magnews</groupId>
                <artifactId>index-site-plugin</artifactId>
                <version>${project.version}</version>
                <executions>
                    <execution>
                        <phase>site</phase>                        
                        <goals>
                            <goal>index</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <configuration>
                    <tasks>
                        <scp todir="${scp.user}:${scp.password}@${scp.host}:/${scpdirCopyTo}" trust="true" failonerror="true" verbose="true" >
                            <fileset dir="target">
                                <include name="*.jar" />
                            </fileset>
                        </scp>
                    </tasks>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>ant</groupId>
                        <artifactId>ant-jsch</artifactId>
                        <version>1.6.5</version>
                    </dependency>
                    <dependency>
                        <groupId>com.jcraft</groupId>
                        <artifactId>jsch</artifactId>
                        <version>0.1.42</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-maven-plugin</artifactId>
                <version>${libs.spotbugsmaven}</version>
                <configuration>
                    <effort>Max</effort>                    
                    <excludeFilterFile>excludeFindBugsFilter.xml</excludeFilterFile>                       
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>          
        <dependency>
            <groupId>net.jcip</groupId>
            <artifactId>jcip-annotations</artifactId>
            <version>${libs.jcipi-annotations}</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>com.github.spotbugs</groupId>
            <artifactId>spotbugs-annotations</artifactId>
            <version>${libs.spotbugsannotations}</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>com.google.code.findbugs</groupId>
                    <artifactId>jsr305</artifactId>
                </exclusion>
            </exclusions>
        </dependency>     
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.json</artifactId>
            <version>1.0</version>            
        </dependency>
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>javax.mail-api</artifactId>
            <version>1.5.5</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>1.4</version>            
            <scope>test</scope>
        </dependency>
        <dependency>
            <!-- ONLY FOR MOCK CONTEXT -->
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-core-asl</artifactId>
            <version>1.9.11</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <!-- ONLY FOR MOCK CONTEXT -->
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-mapper-asl</artifactId>
            <version>1.9.11</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>   
    <profiles>
        <profile>
            <id>default</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>            
            <distributionManagement>
                <repository>
                    <id>maven.sviluppo.dna</id>
                    <name>MagNews Dev Repository</name>
                    <url>https://maven.sviluppo.dna/content/repositories/releases/</url>
                    <releases>
                        <enabled>true</enabled>                
                    </releases>
                </repository> 
                <snapshotRepository>
                    <id>maven.sviluppo.dna</id>
                    <name>MagNews Dev Repository Snapshots</name>
                    <url>https://maven.sviluppo.dna/content/repositories/snapshots/</url>
                </snapshotRepository>
            </distributionManagement>
        </profile>
        <profile>
            <id>create-release-package</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>  
            <distributionManagement>
                <repository>
                    <id>maven.mag-news.it</id>
                    <name>MagNews Public Repository</name>
                    <url>https://maven.mag-news.it/content/repositories/releases/</url>
                </repository>
            </distributionManagement>                    
        </profile>
        <profile>
            <id>jdk9</id>
            <activation>
                <jdk>[9,)</jdk>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.0.0-M1</version>
                        <configuration>
                            <additionalparam>--add-modules java.se.ee</additionalparam>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>                
                <version>3.0.0-M1</version>                
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>javadoc</report>                            
                        </reports>
                    </reportSet>                    
                </reportSets>                            
            </plugin>
                       
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <detail>false</detail>                    
                </configuration>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>index</report>
                        </reports>
                    </reportSet>                        
                </reportSets>
            </plugin>
            
          
        </plugins>
    </reporting>    
</project>
