<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>
    <artifactId>alfresco-wcmqs-share</artifactId>
    <name>Alfresco WCMQS Share AMP</name>
    <packaging>amp</packaging>

    <parent>
        <artifactId>alfresco-wcmqs-parent</artifactId>
        <groupId>org.alfresco</groupId>
        <version>21.14</version>
    </parent>


    <build>
        <resources>

            <!-- need to filter the module.properties file only -->
            <resource>
                <directory>src/main/amp</directory>
                <targetPath>../${project.build.finalName}</targetPath>
                <filtering>true</filtering>
                <includes>
                    <include>module.properties</include>
                </includes>
            </resource>
            <resource>
                <directory>src/main/amp</directory>
                <targetPath>../${project.build.finalName}</targetPath>
                <filtering>false</filtering>
                <excludes>
                    <exclude>module.properties</exclude>
                </excludes>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <groupId>org.alfresco.maven.plugin</groupId>
                <artifactId>alfresco-maven-plugin</artifactId>
                <extensions>true</extensions>
            </plugin>

            <!-- ACE-3329 Create _en.properties message files  -->
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>duplicate-english-messages</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <target>
                        <copy todir="${project.build.directory}/${project.build.finalName}/config">
                            <fileset dir="${basedir}/src/main/amp/config" includes="alfresco/messages/**/*.properties,alfresco/site-webscripts/**/*.properties" />
                            <mapper type="regexp" from="^([^_]*).properties$" to="\1_en.properties" />
                        </copy>
                    </target>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
