<!--

    Copyright 2020-2023 Erwin Müller <erwin.mueller@anrisoftware.com>

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<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>
        <artifactId>globalpom-groovy-parent</artifactId>
        <groupId>com.anrisoftware.globalpom</groupId>
        <version>4.7.0</version>
    </parent>

    <artifactId>globalpom-groovy-gmavenplus</artifactId>
    <packaging>pom</packaging>
    <name>Global POM :: Groovy GMavenPlus</name>
    <description>Adds Groovy support to compile Groovy sources and test sources using the GMavenPlus plugin.</description>
    <inceptionYear>2020</inceptionYear>
    <url>https://javadoc.anrisoftware.com/${project.groupId}/${project.artifactId}/${project.version}/</url>

    <properties>
        <sonar.groovy.binaries>target/classes</sonar.groovy.binaries>
    </properties>

    <scm>
        <connection>${globalpom.custom.scm.pub}</connection>
        <developerConnection>${globalpom.custom.scm.dev}</developerConnection>
        <url>${globalpom.custom.scm.url}</url>
        <tag>HEAD</tag>
    </scm>

    <distributionManagement>
        <site>
            <id>site-dav</id>
            <url>${site.dav.url}</url>
        </site>
        <repository>
            <id>public_releases</id>
            <url>https://maven.anrisoftware.com/repository/maven-releases/</url>
        </repository>
        <snapshotRepository>
            <id>public_snapshots</id>
            <url>https://maven.anrisoftware.com/repository/maven-snapshots/</url>
        </snapshotRepository>
    </distributionManagement>

    <build>
        <plugins>

            <plugin>
                <groupId>org.codehaus.gmavenplus</groupId>
                <artifactId>gmavenplus-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>addSources</goal>
                            <goal>addTestSources</goal>
                            <goal>generateStubs</goal>
                            <goal>compile</goal>
                            <goal>generateTestStubs</goal>
                            <goal>compileTests</goal>
                            <goal>removeStubs</goal>
                            <goal>removeTestStubs</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <!-- if including source jars, use the no-fork goals otherwise
                    both the Groovy sources and Java stub sources will get included in your jar -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <!-- source plugin \> = 2.1 is required to use the no-fork
                    goals -->
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                            <goal>test-jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

        </plugins>

    </build>

</project>
