<?xml version="1.0" encoding="UTF-8"?>
<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>
  <parent>
    <groupId>com.devonfw.tools.ide.dev</groupId>
    <artifactId>devonfw-ide</artifactId>
    <version>dev-SNAPSHOT</version>
  </parent>
  <groupId>com.devonfw.tools.ide</groupId>
  <artifactId>devonfw-ide-scripts</artifactId>
  <packaging>pom</packaging>
  <version>${revision}${changelist}</version>
  <name>${project.artifactId}</name>
  <description>Scripts to setup and update the development environment.</description>

  <licenses>
    <license>
      <name>Apache Software License 2.0 and other 3rd party licenses</name>
      <url>https://github.com/devonfw/ide/blob/master/documentation/LICENSE.asciidoc</url>
      <distribution>repo</distribution>
      <comments>This software is licensed under ASL 2.0 as Open-Source product for free usage including commercial use. As it makes use of components of third-parties also the licenses of these components have to be accepted.</comments>
    </license>
  </licenses>

  <dependencies>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>devonfw-ide-configurator</artifactId>
      <version>${project.version}</version>
    </dependency>
  </dependencies>

  <build>
    <outputDirectory>${project.build.directory}/package</outputDirectory>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
        <excludes>
          <exclude>**/*.bak</exclude>
        </excludes>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>resources</id>
            <phase>process-resources</phase>
            <goals>
              <goal>resources</goal>
            </goals>
            <configuration>
              <nonFilteredFileExtensions>
                <nonFilteredFileExtension>reg</nonFilteredFileExtension>
              </nonFilteredFileExtensions>
              <includeEmptyDirs>true</includeEmptyDirs>
              <delimiters>
                <delimiter>$[*]</delimiter>
              </delimiters>
              <useDefaultDelimiters>false</useDefaultDelimiters>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-dependencies</id>
            <phase>package</phase>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <configuration>
              <includeScope>compile</includeScope>
              <outputDirectory>${project.build.outputDirectory}/scripts/lib</outputDirectory>
              <overWriteReleases>false</overWriteReleases>
              <overWriteSnapshots>false</overWriteSnapshots>
              <overWriteIfNewer>true</overWriteIfNewer>
            </configuration>
          </execution>
          <execution>
            <id>copy-doc</id>
            <phase>package</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>${project.groupId}</groupId>
                  <artifactId>devonfw-ide-doc</artifactId>
                  <version>${project.version}</version>
                  <type>pdf</type>
                  <overWrite>false</overWrite>
                  <outputDirectory>${project.build.outputDirectory}</outputDirectory>
                  <destFileName>devonfw-ide-doc.pdf</destFileName>
                </artifactItem>
              </artifactItems>
              <overWriteReleases>false</overWriteReleases>
              <overWriteSnapshots>false</overWriteSnapshots>
              <overWriteIfNewer>true</overWriteIfNewer>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <id>create-distribution</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <appendAssemblyId>false</appendAssemblyId>
              <descriptors>
                <descriptor>src/main/assembly/all.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>integration-test</id>
      <activation>
        <os>
          <family>!Windows</family>
        </os>
        <property>
          <name>!skipTests</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>integration-testing</id>
                <phase>integration-test</phase>
                <goals>
                  <goal>exec</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <executable>${project.basedir}/src/test/bash/all-tests</executable>
              <workingDirectory>${project.build.directory}</workingDirectory>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
