<!--

    ==========================================================================================
    =                   JAHIA'S DUAL LICENSING - IMPORTANT INFORMATION                       =
    ==========================================================================================

                                    http://www.jahia.com

        Copyright (C) 2002-2019 Jahia Solutions Group SA. All rights reserved.

        THIS FILE IS AVAILABLE UNDER TWO DIFFERENT LICENSES:
        1/GPL OR 2/JSEL

        1/ GPL
        ==================================================================================

        IF YOU DECIDE TO CHOOSE THE GPL LICENSE, YOU MUST COMPLY WITH THE FOLLOWING TERMS:

        This program is free software: you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
        the Free Software Foundation, either version 3 of the License, or
        (at your option) any later version.

        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
        GNU General Public License for more details.

        You should have received a copy of the GNU General Public License
        along with this program. If not, see <http://www.gnu.org/licenses />.


        2/ JSEL - Commercial and Supported Versions of the program
        ===================================================================================

        IF YOU DECIDE TO CHOOSE THE JSEL LICENSE, YOU MUST COMPLY WITH THE FOLLOWING TERMS:

        Alternatively, commercial and supported versions of the program - also known as
        Enterprise Distributions - must be used in accordance with the terms and conditions
        contained in a separate written agreement between you and Jahia Solutions Group SA.

        If you are unsure which license is appropriate for your use,
        please contact the sales department at sales@jahia.com.

-->
<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">

    <parent>
        <groupId>org.jahia.configuration</groupId>
        <artifactId>jahia-configuration-root</artifactId>
        <version>6.8</version>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <artifactId>migrators</artifactId>
    <name>Jahia Migration Tool Library</name>
    <packaging>bundle</packaging>

    <dependencies>
        <dependency>
            <groupId>org.jahia.commons</groupId>
            <artifactId>jahia-commons</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>${commons-io.version}</version>
        </dependency>
        <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
            <version>${junit.version}</version>
          <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jasypt</groupId>
            <artifactId>jasypt</artifactId>
            <version>1.9.3</version>
            <classifier>lite</classifier>
            <scope>compile</scope>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>schemagen</id>
            <activation>
              <file>
                <missing>src/main/resources/OSGI-INF/migrators/migrators.xsd</missing>
              </file>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>jaxb2-maven-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>schemagen</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>schemagen</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <transformSchemas>
                                <transformSchema>
                                    <uri>http://www.jahia.com/migration/migrators</uri>
                                    <toPrefix>migrators</toPrefix>
                                    <toFile>${basedir}/src/main/resources/OSGI-INF/migrators/migrators.xsd</toFile>
                                </transformSchema>
                            </transformSchemas>
                            <includes>
                                <include>org/jahia/utils/migration/model/**/*.java</include>
                            </includes>
                            <excludes>
                                <include>org/jahia/utils/migration/model/**/*Service.java</include>
                            </excludes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>${maven.bundle.plugin.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Import-Package>
                            !sun.nio.ch,!sun.misc,*
                        </Import-Package>
                        <Export-Package>
                            org.jahia.utils.migration,
                            org.jahia.utils.migration.model
                        </Export-Package>
                        <Embed-Dependency>*; scope=compile; type=!pom; inline=true;artifactId=!jdom|biz.aQute.bndlib|slf4j-api|log4j|jahia-commons
                        </Embed-Dependency>
                        <Embed-Transitive>true</Embed-Transitive>
                        <_removeheaders>
                            Include-Resource,
                            Private-Package,
                            Embed-Dependency,
                            Embed-Transitive
                        </_removeheaders>
                    </instructions>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>
