<?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.bidib.jbidib</groupId>
        <artifactId>jbidibc</artifactId>
        <version>2.0.40</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    
    <artifactId>jbidibc-exchange</artifactId>
    <packaging>jar</packaging>
    <name>jBiDiB :: jbidibc Exchange</name>
    <description>jBiDiB jbidibc Echange POM</description>
    <dependencies>
        <dependency>
            <groupId>org.bidib.jbidib</groupId>
            <artifactId>jbidibc-core</artifactId>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
			<groupId>org.xmlunit</groupId>
			<artifactId>xmlunit-assertj</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
        	
            <plugin>
				<groupId>${jaxb2-maven-plugin.groupId}</groupId>
				<artifactId>${jaxb2-maven-plugin.artifactId}</artifactId>
                <executions>
                    <execution>
                        <id>generate</id>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <bindingDirectory>src/main/xjb</bindingDirectory>
                            <bindingIncludes>
                                <include>bindings.xjb</include>
                            </bindingIncludes>

                            <extension>true</extension>
                            <args>
                                <arg>-Xcommons-lang</arg>
                                <arg>-Xfluent-api</arg>
                            </args>

                            <catalog>src/main/resources/catalog.cat</catalog>
                            <schemas>
                                <schema>
                                    <fileset>
                                        <directory>${project.basedir}/src/main/resources/xsd</directory>
                                        <includes>
                                            <include>*.xsd</include>
                                        </includes>
                                        <excludes>
                                            <exclude>*.xs</exclude>
                                        </excludes>
                                    </fileset>
                                </schema>                            
                            </schemas>
                            <episodes>
                                <episode>
                                    <groupId>org.bidib.jbidib</groupId>
                                    <artifactId>jbidibc-core</artifactId>
                                    <version>${jbidibc-version}</version>
                                </episode>
                            </episodes>
                            <strict>false</strict>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <configuration>
                    <includePom>true</includePom>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>add-source</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.build.directory}/generated-resources/xml/</source>
                                <source>${project.basedir}/src/main/xjb/</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>format-resources</id>
            <build>
                <plugins>
                    <!-- format XML files -->
                    <plugin>
                        <groupId>org.technicalsoftwareconfigurationmanagement.maven-plugin</groupId>
                        <artifactId>tscm-maven-plugin</artifactId>
                        <configuration>
                            <includes>
                                <include>**/*.xml</include>
                            </includes>
                            <excludes>
                                <exclude>**/main/xml/bidib/**</exclude>
                                <exclude>**/resources/bidib/**</exclude>
                                <exclude>**/resources/xsd/**</exclude>
                                <exclude>**/target/**</exclude>
                                <exclude>**/test-output/**</exclude>
                                <exclude>**/codestyle.xml</exclude>
                                <exclude>checkstyle-config.xml</exclude>
                                <exclude>**/OSGI-INF/**</exclude>
                                <exclude>**/.idea/**</exclude>
                            </excludes>
                        </configuration>
                        <executions>
                            <execution>
                                <phase>test</phase>
                                <goals>
                                    <goal>xmlFormatter</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
