<?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>
    <artifactId>pmd-dist</artifactId>
    <name>PMD Distribution Packages</name>
    <packaging>pom</packaging>

    <parent>
        <groupId>net.sourceforge.pmd</groupId>
        <artifactId>pmd</artifactId>
        <version>5.4.4-SNAPSHOT</version>
    </parent>

    <properties>
        <config.basedir>${basedir}/../pmd-core</config.basedir>
    </properties>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <appendAssemblyId>false</appendAssemblyId>
                    <attach>false</attach>
                    <archiverConfig>
                        <defaultDirectoryMode>493</defaultDirectoryMode> <!-- 0755 -->
                    </archiverConfig>
                </configuration>
                <executions>
                    <execution>
                        <id>build-bin-dist</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <finalName>pmd-bin-${project.version}</finalName>
                            <descriptors>
                                <descriptor>src/main/assembly/bin.xml</descriptor>
                            </descriptors>
                        </configuration>
                    </execution>
                    <execution>
                        <id>build-src-dist</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <finalName>pmd-src-${project.version}</finalName>
                            <descriptors>
                                <descriptor>src/main/assembly/src.xml</descriptor>
                            </descriptors>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>net.sourceforge.pmd</groupId>
            <artifactId>pmd-core</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.pmd</groupId>
            <artifactId>pmd-cpp</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.pmd</groupId>
            <artifactId>pmd-cs</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.pmd</groupId>
            <artifactId>pmd-fortran</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.pmd</groupId>
            <artifactId>pmd-go</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.pmd</groupId>
            <artifactId>pmd-java</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.pmd</groupId>
            <artifactId>pmd-javascript</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.pmd</groupId>
            <artifactId>pmd-jsp</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.pmd</groupId>
            <artifactId>pmd-matlab</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.pmd</groupId>
            <artifactId>pmd-objectivec</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.pmd</groupId>
            <artifactId>pmd-php</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.pmd</groupId>
            <artifactId>pmd-plsql</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.pmd</groupId>
            <artifactId>pmd-python</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.pmd</groupId>
            <artifactId>pmd-ruby</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.pmd</groupId>
            <artifactId>pmd-swift</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.pmd</groupId>
            <artifactId>pmd-vm</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.pmd</groupId>
            <artifactId>pmd-xml</artifactId>
            <version>${project.version}</version>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>jdk8-modules</id>
            <activation>
                <jdk>1.8</jdk>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>net.sourceforge.pmd</groupId>
                    <artifactId>pmd-ui</artifactId>
                    <version>${project.version}</version>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>jdk9-disabled</id>
            <activation>
                <jdk>!1.9</jdk>
            </activation>
            <dependencies>
                <!--
                    https://issues.scala-lang.org/browse/SI-9103
                    https://sourceforge.net/p/pmd/bugs/1314/
                 -->
                <dependency>
                    <groupId>net.sourceforge.pmd</groupId>
                    <artifactId>pmd-scala</artifactId>
                    <version>${project.version}</version>
                </dependency>
            </dependencies>
        </profile>
    </profiles>
</project>
