<?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>se.mdh</groupId>
    <artifactId>mdh-parent</artifactId>
    <version>50</version>
    <relativePath>../mdh-parent/pom.xml</relativePath>
  </parent>

  <groupId>se.mdh.nuspec</groupId>
  <artifactId>mdh-nuspec-modell</artifactId>
  <version>1.0.0</version>

  <name>${project.groupId}:${project.artifactId}</name>
  <description>Modeller för nuspec-filer.</description>

  <scm>
    <connection>scm:git:https://github.com/mdh-se/${project.artifactId}.git</connection>
    <developerConnection>scm:git:https://github.com/mdh-se/${project.artifactId}.git</developerConnection>
    <tag>mdh-nuspec-modell-1.0.0</tag>
    <url>https://github.com/mdh-se/${project.artifactId}</url>
  </scm>

  <dependencies>
    <dependency>
      <groupId>javax.validation</groupId>
      <artifactId>validation-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>javax.xml.bind</groupId>
      <artifactId>jaxb-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>3.12.0</version>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>com.github.spotbugs</groupId>
          <artifactId>spotbugs-maven-plugin</artifactId>
          <configuration>
            <excludeFilterFile>spotbugs-exclude.xml</excludeFilterFile>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <configuration>
            <!-- Exclude the generated sources -->
            <excludes>se/mdh/nuspec/modell/**/*.java</excludes>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-pmd-plugin</artifactId>
          <configuration>
            <!-- Exclude the generated sources -->
            <excludes>
              <exclude>se/mdh/nuspec/modell/**/*.java</exclude>
            </excludes>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-xjc-plugin</artifactId>
        <executions>
          <execution>
            <id>generate-sources</id>
            <goals>
              <goal>xsdtojava</goal>
            </goals>
          </execution>
        </executions>
        <dependencies>
          <!-- Generates JSR-303 Bean Validation Annotations -->
          <dependency>
            <groupId>com.github.krasa</groupId>
            <artifactId>krasa-jaxb-tools</artifactId>
            <version>1.5</version>
          </dependency>
          <!-- Insert toString method for DTOs -->
          <dependency>
            <groupId>org.apache.cxf.xjcplugins</groupId>
            <artifactId>cxf-xjc-ts</artifactId>
            <version>${mdh.cxf-xjc.version}</version>
          </dependency>
        </dependencies>
        <configuration>
          <xsdOptions>
            <xsdOption>
              <xsdDir>${project.basedir}/src/main/resources</xsdDir>
              <packagename>se.mdh.nuspec.modell</packagename>
              <bindingFile>${project.basedir}/src/main/resources/bindings.xml</bindingFile>
              <extension>true</extension>
              <extensionArgs>
                <!-- Använd rätt encoding -->
                <extensionArg>-encoding</extensionArg>
                <extensionArg>${project.build.sourceEncoding}</extensionArg>
                <!-- Ta inte med header som innehåller datum - lättare att diffa -->
                <extensionArg>-no-header</extensionArg>
                <!-- JSR-303 Bean Validation Annotations -->
                <extensionArg>-XJsr303Annotations</extensionArg>
                <!-- Insert toString() method -->
                <extensionArg>-Xts:style:org.apache.commons.lang3.builder.ToStringStyle.SHORT_PREFIX_STYLE</extensionArg>
              </extensionArgs>
            </xsdOption>
          </xsdOptions>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
