<?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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.github.sabomichal</groupId>
    <artifactId>immutable-xjc-plugin</artifactId>
    <version>2.0.4</version>
    <packaging>jar</packaging>

    <properties>
        <jaxb.version>4.0.5</jaxb.version>
        <java.version>11</java.version>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.release>${java.version}</maven.compiler.release>
        <maven.compiler.showDeprecation>true</maven.compiler.showDeprecation>
        <maven.compiler.showWarnings>true</maven.compiler.showWarnings>
        <maven.test.skip>true</maven.test.skip>

        <jakarta.xml.bind-api.version>4.0.2</jakarta.xml.bind-api.version>
        <jakarta.xml.ws-api.version>4.0.2</jakarta.xml.ws-api.version>
        <commons-lang3.version>3.17.0</commons-lang3.version>
        <junit-jupiter.version>5.11.3</junit-jupiter.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>${commons-lang3.version}</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jaxb</groupId>
            <artifactId>codemodel</artifactId>
            <version>${jaxb.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jaxb</groupId>
            <artifactId>jaxb-xjc</artifactId>
            <version>${jaxb.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
            <version>${jakarta.xml.bind-api.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${junit-jupiter.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.xml.ws</groupId>
            <artifactId>jakarta.xml.ws-api</artifactId>
            <version>${jakarta.xml.ws-api.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jaxb</groupId>
            <artifactId>jaxb-runtime</artifactId>
            <version>${jaxb.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.13.0</version>
                    <configuration>
                        <debug>true</debug>
                        <optimize>true</optimize>
                        <showDeprecation>true</showDeprecation>
                        <showWarnings>true</showWarnings>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.3.1</version>
                    <configuration>
                        <delimiters>
                            <delimiter>${*}</delimiter>
                        </delimiters>
                        <useDefaultDelimiters>false</useDefaultDelimiters>
                        <escapeWindowsPaths>true</escapeWindowsPaths>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.4.2</version>
                    <configuration>
                        <archive>
                            <index>true</index>
                            <addMavenDescriptor>false</addMavenDescriptor>
                            <compress>true</compress>
                            <manifestEntries>
                                <Build-Date>${buildNumber}</Build-Date>
                                <Maven-Version>${maven.version}</Maven-Version>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.3.1</version>
                    <configuration>
                        <archive>
                            <index>true</index>
                            <addMavenDescriptor>false</addMavenDescriptor>
                            <compress>true</compress>
                            <manifestEntries>
                                <Build-Date>${buildNumber}</Build-Date>
                                <Maven-Version>${maven.version}</Maven-Version>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.5.2</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>3.6.0</version>
                    <executions>
                        <execution>
                            <id>default-maven-version</id>
                            <phase>initialize</phase>
                            <goals>
                                <goal>maven-version</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>default-timestamp-property</id>
                            <phase>initialize</phase>
                            <goals>
                                <goal>timestamp-property</goal>
                            </goals>
                            <configuration>
                                <name>buildNumber</name>
                                <locale>en</locale>
                                <pattern>yyyy-MM-dd'T'HH:mm:ssZ</pattern>
                            </configuration>
                        </execution>
                        <execution>
                            <id>default-attach-artifact</id>
                            <inherited>false</inherited>
                            <phase>prepare-package</phase>
                            <goals>
                                <goal>attach-artifact</goal>
                            </goals>
                            <configuration>
                                <artifacts>
                                    <artifact>
                                        <file>${basedir}/LICENSE.txt</file>
                                        <classifier>license</classifier>
                                        <type>txt</type>
                                    </artifact>
                                </artifacts>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>3.0.1</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <arguments>-Dgpg.passphrase=${gpg.passphrase}</arguments>
                    <useReleaseProfile>true</useReleaseProfile>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.1.0</version>
                        <configuration>
                            <passphrase>${gpg.passphrase}</passphrase>
                        </configuration>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>selftest</id>
            <properties>
                <maven.test.skip>false</maven.test.skip>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.helger.maven</groupId>
                        <artifactId>jaxb40-maven-plugin</artifactId>
                        <version>0.16.1</version>
                        <dependencies>
                            <dependency>
                                <groupId>${project.groupId}</groupId>
                                <artifactId>${project.artifactId}</artifactId>
                                <version>${project.version}</version>
                                <optional>true</optional>
                            </dependency>
                        </dependencies>
                        <executions>
                            <execution>
                                <id>test-model-basic</id>
                                <phase>generate-test-sources</phase>
                                <goals>
                                    <goal>generate</goal>
                                </goals>
                                <configuration>
                                    <specVersion>4.0.2</specVersion>
                                    <schemaDirectory>src/test/xsd</schemaDirectory>
                                    <generatePackage>${project.groupId}.immutablexjc.test.basic</generatePackage>
                                    <generateDirectory>target/generated-test-sources/xjc</generateDirectory>
                                    <addTestCompileSourceRoot>true</addTestCompileSourceRoot>
                                    <forceRegenerate>true</forceRegenerate>
                                    <args>
                                        <arg>-Ximm</arg>
                                    </args>
                                </configuration>
                            </execution>
                            <execution>
                                <id>test-model-noinherit</id>
                                <phase>generate-test-sources</phase>
                                <goals>
                                    <goal>generate</goal>
                                </goals>
                                <configuration>
                                    <specVersion>4.0.2</specVersion>
                                    <schemaDirectory>src/test/xsd</schemaDirectory>
                                    <generatePackage>${project.groupId}.immutablexjc.test.noinheritbuilder</generatePackage>
                                    <generateDirectory>target/generated-test-sources/xjc</generateDirectory>
                                    <addTestCompileSourceRoot>true</addTestCompileSourceRoot>
									<forceRegenerate>true</forceRegenerate>
                                    <args>
                                        <arg>-Ximm</arg>
                                        <arg>-Ximm-builder</arg>
                                    </args>
                                </configuration>
                            </execution>
                            <execution>
                                <id>test-model-nofinalclasses</id>
                                <phase>generate-test-sources</phase>
                                <goals>
                                    <goal>generate</goal>
                                </goals>
                                <configuration>
                                    <specVersion>4.0.2</specVersion>
                                    <schemaDirectory>src/test/xsd</schemaDirectory>
                                    <generatePackage>${project.groupId}.immutablexjc.test.nofinalclasses</generatePackage>
                                    <generateDirectory>target/generated-test-sources/xjc</generateDirectory>
                                    <addTestCompileSourceRoot>true</addTestCompileSourceRoot>
                                    <forceRegenerate>true</forceRegenerate>
                                    <args>
                                        <arg>-Ximm</arg>
                                        <arg>-Ximm-nofinalclasses</arg>
                                    </args>
                                </configuration>
                            </execution>
                            <execution>
                                <id>test-model-inherit</id>
                                <phase>generate-test-sources</phase>
                                <goals>
                                    <goal>generate</goal>
                                </goals>
                                <configuration>
                                    <specVersion>4.0.2</specVersion>
                                    <schemaDirectory>src/test/xsd</schemaDirectory>
                                    <generatePackage>${project.groupId}.immutablexjc.test.inheritbuilder</generatePackage>
                                    <generateDirectory>target/generated-test-sources/xjc</generateDirectory>
                                    <addTestCompileSourceRoot>true</addTestCompileSourceRoot>
                                    <forceRegenerate>true</forceRegenerate>
                                    <args>
                                        <arg>-Ximm</arg>
                                        <arg>-Ximm-inheritbuilder</arg>
                                        <arg>-Ximm-cc</arg>
                                        <arg>-Ximm-simplebuildername</arg>
                                    </args>
                                </configuration>
                            </execution>
                            <execution>
                                <id>test-model-misc</id>
                                <phase>generate-test-sources</phase>
                                <goals>
                                    <goal>generate</goal>
                                </goals>
                                <configuration>
                                    <specVersion>4.0.2</specVersion>
                                    <schemaDirectory>src/test/xsd</schemaDirectory>
                                    <generatePackage>${project.groupId}.immutablexjc.test.misc</generatePackage>
                                    <generateDirectory>target/generated-test-sources/xjc</generateDirectory>
                                    <addTestCompileSourceRoot>true</addTestCompileSourceRoot>
                                    <forceRegenerate>true</forceRegenerate>
                                    <args>
                                        <arg>-Ximm</arg>
                                        <arg>-Ximm-builder</arg>
                                        <arg>-Ximm-cc</arg>
                                        <arg>-Ximm-ifnotnull</arg>
                                        <arg>-Ximm-nopubconstructor</arg>
                                        <arg>-Ximm-pubconstructormaxargs=2</arg>
                                        <arg>-Ximm-skipcollections</arg>
                                        <arg>-Ximm-constructordefaults</arg>
                                    </args>
                                </configuration>
                            </execution>
                            <execution>
                                <id>test-model-optionalgetter</id>
                                <phase>generate-test-sources</phase>
                                <goals>
                                    <goal>generate</goal>
                                </goals>
                                <configuration>
                                    <specVersion>4.0.2</specVersion>
                                    <schemaDirectory>src/test/xsd</schemaDirectory>
                                    <generatePackage>${project.groupId}.immutablexjc.test.optionalgetter</generatePackage>
                                    <generateDirectory>target/generated-test-sources/xjc</generateDirectory>
                                    <addTestCompileSourceRoot>true</addTestCompileSourceRoot>
                                    <forceRegenerate>true</forceRegenerate>
                                    <args>
                                        <arg>-Ximm</arg>
                                        <arg>-Ximm-builder</arg>
                                        <arg>-Ximm-cc</arg>
                                        <arg>-Ximm-optionalgetter</arg>
                                    </args>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.cxf</groupId>
                        <artifactId>cxf-codegen-plugin</artifactId>
                        <version>4.0.4</version>
                        <dependencies>
                            <dependency>
                                <groupId>${project.groupId}</groupId>
                                <artifactId>${project.artifactId}</artifactId>
                                <version>${project.version}</version>
                                <optional>true</optional>
                            </dependency>
                        </dependencies>
                        <executions>
                            <execution>
                                <phase>generate-test-sources</phase>
                                <goals>
                                    <goal>wsdl2java</goal>
                                </goals>
                                <configuration>
                                    <sourceRoot>${project.build.directory}/generated-test-sources/wsdl</sourceRoot>
                                    <wsdlOptions>
                                        <wsdlOption>
                                            <wsdl>${basedir}/src/test/wsdl/basic.wsdl</wsdl>
                                            <extraargs>
                                                <extraarg>-xjc-Ximm</extraarg>
                                                <extraarg>-xjc-Ximm-builder</extraarg>
                                                <extraarg>-xjc-Ximm-cc</extraarg>
                                            </extraargs>
                                        </wsdlOption>
                                        <wsdlOption>
                                            <wsdl>${basedir}/src/test/wsdl/complex.wsdl</wsdl>
                                            <extraargs>
                                                <extraarg>-xjc-Ximm</extraarg>
                                                <extraarg>-xjc-Ximm-builder</extraarg>
                                                <extraarg>-xjc-Ximm-cc</extraarg>
                                            </extraargs>
                                        </wsdlOption>
                                    </wsdlOptions>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <name>IMMUTABLE-XJC</name>
    <description>JAXB 2.0 Schema to Java compiler plugin for making schema derived classes immutable.</description>
    <url>https://github.com/sabomichal/immutable-xjc</url>
    <inceptionYear>2012</inceptionYear>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/sabomichal/immutable-xjc/issues</url>
    </issueManagement>

    <licenses>
        <license>
            <name>The MIT License (MIT)</name>
            <url>http://opensource.org/licenses/MIT</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>sabo</id>
            <name>Michal Sabo</name>
            <email>sabo.michal@gmail.com</email>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:https://github.com/sabomichal/immutable-xjc.git</connection>
        <developerConnection>scm:git:git@github.com:sabomichal/immutable-xjc.git</developerConnection>
        <url>https://github.com/sabomichal/immutable-xjc</url>
        <tag>v2.0.4</tag>
    </scm>

    <distributionManagement>
        <snapshotRepository>
            <id>sonatype-nexus-snapshots</id>
            <name>Sonatype Nexus snapshot repository</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>sonatype-nexus-staging</id>
            <name>Sonatype Nexus release repository</name>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>
</project>
