<?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>org.lastnpe.eea</groupId>
    <artifactId>eea-root</artifactId>
    <version>2.3.0</version>
  </parent>

  <artifactId>eea-parent</artifactId>

  <packaging>pom</packaging>

  <name>EEA :: Reactor</name>
  <description>JARs of *.eea for the JDK and common Java libraries</description>

  <modules>
    <module>eea-all</module>
    <module>gson</module>
    <module>guava</module>
    <module>java</module>
    <module>javamail</module>
    <module>jetty</module>
    <module>junit5</module>
    <module>mockito</module>
    <module>osgi-core</module>
    <module>slf4j-api</module>
    <module>servlet-api</module>
    <module>spring</module>
    <module>xstream</module>
  </modules>

  <build>
    <!-- NB: Similar configuration also in examples/maven/jdt-ecj-settings/pom.xml -->
    <resources>
      <resource>
        <filtering>false</filtering>
        <directory>${project.basedir}</directory>
        <includes>
          <include>**/*</include>
          <include>eea-*.*</include>
        </includes>
        <excludes>
          <exclude>.*</exclude>
          <exclude>pom.xml</exclude>
          <exclude>target/</exclude>
          <exclude>.settings/</exclude>
        </excludes>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>3.0.1</version>
        <!-- Disable src/test/resources, not needed for creating EEA JARs -->
        <executions>
          <execution>
            <id>default-testResources</id>
            <phase>none</phase>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.0.2</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.19.1</version>
        <!-- Disable Surefire, not needed for creating EEA JARs -->
        <executions>
          <execution>
            <id>default-test</id>
            <phase>none</phase>
          </execution>
        </executions>
      </plugin>
      <!-- Intentionally no maven-source-plugin & maven-javadoc-plugin; as not needed for EEA here! -->
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>not-m2e</id>
      <activation>
        <property>
          <name>!m2e.version</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
            <!-- Disable Java compilation, not needed for creating EEA JARs.
                 This mainly just leads to shorter mvn build logs.. ;-) and
                 may help a little bit in build perf. when there will be many.

                 NB: This is a !m2e profile because in-IDE we CANNOT do this;
                 because that would cause M2E to create a non-Java Eclipse project
                 and then workspace dependency resolution to EEA wouldn't work anymore!
             -->
            <executions>
              <execution>
                <id>default-compile</id>
                <phase>none</phase>
              </execution>
              <execution>
                <id>default-testCompile</id>
                <phase>none</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>m2e</id>
      <activation>
        <property>
          <name>m2e.version</name>
        </property>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-compiler-plugin</artifactId>
              <configuration>
                <release>${eea.java.version}</release>
              </configuration>
            </plugin>
            <plugin>
              <groupId>org.codehaus.mojo</groupId>
              <artifactId>versions-maven-plugin</artifactId>
              <version>2.8.1</version>
            </plugin>
            <plugin>
              <artifactId>maven-deploy-plugin</artifactId>
              <version>2.8.2</version>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
  </profiles>
</project>
