<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">
  <parent>
    <groupId>org.wildfly.prospero</groupId>
    <artifactId>prospero-dist</artifactId>
    <version>1.2.0.Final</version>
  </parent>

  <modelVersion>4.0.0</modelVersion>
  <artifactId>prospero-dist-common</artifactId>
  <packaging>jar</packaging>

  <properties>
      <prospero.script.path>packages/org.jboss.prospero/content/bin/</prospero.script.path>
  </properties>


  <dependencies>
    <dependency>
      <groupId>org.wildfly.prospero</groupId>
      <artifactId>prospero-cli</artifactId>
    </dependency>
    <dependency>
      <groupId>org.wildfly.galleon-plugins</groupId>
      <artifactId>wildfly-galleon-plugins</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.modules</groupId>
      <artifactId>jboss-modules</artifactId>
      <scope>provided</scope>
    </dependency>
  </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>false</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>generate-sources</id>
                        <phase>compile</phase>
                        <configuration>
                            <target>
                                <move file="${project.build.outputDirectory}/${prospero.script.path}/prospero.sh" tofile="${project.build.outputDirectory}/${prospero.script.path}/${prospero.dist.name}.sh" />
                                <move file="${project.build.outputDirectory}/${prospero.script.path}/prospero.bat" tofile="${project.build.outputDirectory}/${prospero.script.path}/${prospero.dist.name}.bat" />
                                <move file="${project.build.outputDirectory}/${prospero.script.path}/prospero.ps1" tofile="${project.build.outputDirectory}/${prospero.script.path}/${prospero.dist.name}.ps1" />
                                <move file="${project.build.outputDirectory}/${prospero.script.path}/prospero-logging.properties" tofile="${project.build.outputDirectory}/${prospero.script.path}/${prospero.dist.name}-logging.properties" />
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <id>assemble</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <descriptors>
                                <descriptor>assembly.xml</descriptor>
                            </descriptors>
                            <recompressZippedFiles>true</recompressZippedFiles>
                            <finalName>${project.build.finalName}</finalName>
                            <appendAssemblyId>false</appendAssemblyId>
                            <outputDirectory>${project.build.directory}</outputDirectory>
                            <workDirectory>${project.build.directory}/assembly/work</workDirectory>
                            <tarLongFileMode>posix</tarLongFileMode>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
