
<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.adullact.iparapheur</groupId>
        <artifactId>iparapheur</artifactId>
        <version>4.7.30</version>
    </parent>
    <groupId>org.adullact.iparapheur</groupId>
    <artifactId>iparapheur-amp</artifactId>
    <description>Parapheur electronique</description>
    <packaging>war</packaging>
    <version>4.7.30-for-Alf3.4.c</version>
    <name>i-Parapheur AMP packaging</name>
    <url>http://maven.apache.org</url>
    <properties>
        <jetty.daemon>true</jetty.daemon>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    </properties>
    <repositories>
        <repository>
            <id>libriciel</id>
            <url>https://nexus.libriciel.fr/repository/maven-public/</url>
        </repository>
        <repository>
            <id>libriciel.snapshots</id>
            <url>https://nexus.libriciel.fr/repository/maven-snapshots/</url>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>alfresco</id>
            <url>https://artifacts.alfresco.com/nexus/content/repositories/public</url>
        </pluginRepository>
        <pluginRepository>
            <id>libriciel</id>
            <url>https://nexus.libriciel.fr/repository/maven-public/</url>
        </pluginRepository>
    </pluginRepositories>
    <dependencies>
        <dependency>
            <groupId>alfresco</groupId>
            <artifactId>alfresco-embedded-sdk</artifactId>
            <version>3.4.c</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <artifactId>antlr</artifactId>
                    <groupId>antlr</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>bcprov-jdk16</artifactId>
                    <groupId>org.bouncycastle</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>cglib-nodep</artifactId>
                    <groupId>cglib</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.adullact.iparapheur</groupId>
            <artifactId>iparapheur-core</artifactId>
            <version>4.7.30</version>
        </dependency>

        <dependency>
            <groupId>org.adullact.iparapheur</groupId>
            <artifactId>iparapheur-mobile-webscripts</artifactId>
            <version>4.7.30</version>
        </dependency>

        <dependency>
            <groupId>alfresco</groupId>
            <artifactId>alfresco</artifactId>
            <version>3.4.c</version>
            <type>war</type>
        </dependency>

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.13</version>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>1.7</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.shale</groupId>
            <artifactId>shale-test</artifactId>
            <version>1.0.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium.client-drivers</groupId>
            <artifactId>selenium-java-client-driver</artifactId>
            <version>1.0.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.canoo.webtest</groupId>
            <artifactId>webtest</artifactId>
            <version>3.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.htmlunit</groupId>
            <artifactId>htmlunit</artifactId>
            <version>2.6</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.codehaus.groovy.maven.runtime</groupId>
            <artifactId>gmaven-runtime-default</artifactId>
            <version>1.0-rc-3</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <!-- Configures compiler to use Java 1.5. Maven default is Java 1.3 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>

            <!-- Groovy compiler for WebTest test cases -->
            <plugin>
                <groupId>org.codehaus.groovy.maven</groupId>
                <artifactId>gmaven-plugin</artifactId>
                <version>1.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generateTestStubs</goal>
                            <goal>testCompile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!--
                Since Alfresco 3.2, cleaner plugin fails to delete some files,
                which are symlinks.
                maven-clean-plugin is able to delete symlikns since 2.3.
            -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>2.3</version>
            </plugin>

            <!-- Plugin use to produce a proper AMP file -->
            <plugin>
                <groupId>org.alfresco.maven.plugin</groupId>
                <artifactId>maven-amp-plugin</artifactId>
                <version>3.0.0-patched</version>
                <extensions>true</extensions>
                <configuration>
                    <mAmpResources>
                        <resource>
                            <directory>src/main/amp-resources</directory>
                            <filtering>true</filtering>
                        </resource>
                    </mAmpResources>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>unpack-amps</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>unpack-dependencies</goal>
                        </goals>
                        <configuration>
                            <includeTypes>amp</includeTypes>
                            <outputDirectory>target/parapheur.war</outputDirectory>
                            <excludes>META*</excludes>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.alfresco.maven.plugin</groupId>
                        <artifactId>maven-amp-plugin</artifactId>
                        <version>3.0.0-patched</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.1.1</version>
                <executions>
                    <execution>
                        <id>it</id>
                        <phase>package</phase>
                        <goals>
                            <goal>exploded</goal>
                        </goals>
                        <configuration>
                            <archiveClasses>true</archiveClasses>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <primaryArtifact>false</primaryArtifact>
                    <webappDirectory>target/parapheur.war</webappDirectory>
                    <archive>
                        <addMavenDescriptor>false</addMavenDescriptor>
                    </archive>
                    <warSourceExcludes>licenses/**</warSourceExcludes>
                    <packagingExcludes>
                        WEB-INF/lib/bcprov-jdk15-*,
                        WEB-INF/lib/bcmail-jdk15-*,
                        WEB-INF/lib/geronimo-servlet_2.4_spec-1.1.1.jar,
                        WEB-INF/lib/servlet-api-2.4.jar,
                        WEB-INF/lib/asm-3.1.jar,
                        WEB-INF/lib/cglib-2.2.jar,
                        WEB-INF/lib/freemarker-2.3.16-patched.jar
                    </packagingExcludes>
                    <webResources>
                        <resource>
                            <directory>target/classes</directory>
                            <targetPath>WEB-INF/classes</targetPath>
                            <includes>
                                <include>**</include>
                            </includes>
                        </resource>
                        <resource>
                            <directory>.</directory>
                            <targetPath>WEB-INF/classes/alfresco/module/parapheur</targetPath>
                            <includes>
                                <include>module.properties</include>
                            </includes>
                        </resource>
                    </webResources>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.alfresco.maven.plugin</groupId>
                        <artifactId>maven-amp-plugin</artifactId>
                        <version>3.0.0-patched</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.mortbay.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>7.0.0.RC5</version>
                <configuration>
                    <stopKey>STOP</stopKey>
                    <stopPort>9091</stopPort>
                </configuration>
                <executions>
                    <execution>
                        <id>start-jetty</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>run-exploded</goal>
                        </goals>
                        <configuration>
                            <webApp>target/parapheur.war</webApp>
                            <webAppConfig>
                                <contextPath>/parapheur</contextPath>
                            </webAppConfig>
                            <scanIntervalSeconds>0</scanIntervalSeconds>
                            <daemon>${jetty.daemon}</daemon>
                            <connectors>
                                <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
                                    <port>9090</port>
                                    <maxIdleTime>60000</maxIdleTime>
                                </connector>
                                <connector implementation="org.eclipse.jetty.server.ssl.SslSelectChannelConnector">
                                    <port>9191</port>
                                    <maxIdleTime>60000</maxIdleTime>
                                    <keystore>${basedir}/src/test/certs/jetty-server.jks</keystore>
                                    <password>password</password>
                                    <keyPassword>password</keyPassword>
                                    <truststore>${basedir}/src/test/certs/jetty-clients.jks</truststore>
                                    <trustPassword>password</trustPassword>
                                    <needClientAuth>true</needClientAuth>
                                </connector>
                            </connectors>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
<!--
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>selenium-maven-plugin</artifactId>
                <version>1.0</version>
                <configuration>
                    <port>4444</port>
                </configuration>
                <executions>
                    <execution>
                        <id>start-selenium</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>start-server</goal>
                        </goals>
                        <configuration>
                            <background>true</background>
                        </configuration>
                    </execution>
                    <execution>
                        <id>stop-selenium</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>stop-server</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
-->
            <!-- Unit tests configuration -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.4.1</version>
                <executions>
                    <execution>
                        <id>run-integration-test</id>
                        <phase>integration-test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <directory>src/main/config</directory>
                <filtering>false</filtering>
            </resource>
        </resources>
    </build>
</project>


