<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.buschmais.jqassistant.core</groupId>
        <artifactId>parent</artifactId>
        <version>2.9.0</version>
    </parent>

    <artifactId>schemata</artifactId>
    <name>jQAssistant Core Schemata</name>

    <dependencies>
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.annotation</groupId>
            <artifactId>javax.annotation-api</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <id>package-schema</id>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <phase>package</phase>
                        <configuration>
                            <attach>true</attach>
                            <descriptors>
                                <descriptor>${project.basedir}/src/main/assembly/schema.xml</descriptor>
                            </descriptors>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jvnet.jaxb2.maven2</groupId>
                <artifactId>maven-jaxb2-plugin</artifactId>
                <version>${maven.jaxb2-plugin.version}</version>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <schemas>
                                <schema>
                                    <fileset>
                                        <directory>${project.basedir}/src/main/resources/META-INF/schema</directory>
                                        <includes>
                                            <include>jqassistant-plugin-v2.4.xsd</include>
                                            <include>jqassistant-report-v2.9.xsd</include>
                                            <include>jqassistant-rule-v2.9.xsd</include>
                                            <include>jqassistant-baseline-v2.4.xsd</include>
                                        </includes>
                                    </fileset>
                                </schema>
                            </schemas>
                            <!-- Provide namespace in each generated class to avoid problems loading this information from package-info.java on Java 11 and newer -->
                            <packageLevelAnnotations>false</packageLevelAnnotations>
                            <args>
                                <arg>-mark-generated</arg>
                                <arg>-Xdefault-value</arg>
                            </args>
                            <plugins>
                                <plugin>
                                    <groupId>org.jvnet.jaxb2_commons</groupId>
                                    <artifactId>jaxb2-default-value</artifactId>
                                    <version>1.1</version>
                                </plugin>
                            </plugins>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>
</project>
