<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>

  <artifactId>authcontextinfo10-jaxb</artifactId>
  <packaging>jar</packaging>

  <parent>
    <groupId>se.swedenconnect.schemas.cert</groupId>
    <artifactId>authcontextinfo-schemas-parent</artifactId>
    <version>2.0.1</version>
  </parent>

  <name>Sweden Connect Schemas :: SAML Authentication Context Info XML Schema 1.0 JAXB</name>
  <description>JAXB project for SAML Authentication Context Info XML Schema 1.0</description>
  <url>https://github.com/swedenconnect/schemas</url>

  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <scm>
    <connection>scm:git:https://github.com/swedenconnect/schemas.git</connection>
    <developerConnection>scm:git:https://github.com/swedenconnect/schemas.git</developerConnection>
    <url>https://github.com/swedenconnect/schemas/tree/master</url>
  </scm>

  <developers>
    <developer>
      <name>Martin Lindström</name>
      <email>martin@idsec.se</email>
      <organization>IDsec Solutions AB</organization>
      <organizationUrl>https://www.idsec.se</organizationUrl>
    </developer>
    
    <developer>
      <name>Stefan Santesson</name>
      <email>stefan@idsec.se</email>
      <organization>IDsec Solutions AB</organization>
      <organizationUrl>https://www.idsec.se</organizationUrl>
    </developer>
  </developers>

  <properties>
  </properties>

  <dependencies>
        
    <dependency>
      <groupId>se.swedenconnect.schemas</groupId>
      <artifactId>saml-jaxb</artifactId>
      <version>${project.version}</version>
    </dependency>  
            
  </dependencies>

  <build>

    <plugins>

      <plugin>
        <groupId>org.jvnet.jaxb2.maven2</groupId>
        <artifactId>maven-jaxb2-plugin</artifactId>
        <goals>
          <goal>generate</goal>
        </goals>
        <executions>
          <execution>
            <id>generate-api</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <schemaIncludes>
                <schemaInclude>CertAuthContextExtension-SAML-1.0.xsd</schemaInclude>
              </schemaIncludes>
              <bindingIncludes>aci.xjb</bindingIncludes>
              <catalog>${basedir}/src/main/resources/aci.cat</catalog>
            </configuration>
          </execution>
        </executions>
      </plugin>
      
      <!-- 
        XJC has a bug where it generates an ObjectFactory class for imported code. This will 
        clash since there is already such a class in place (from the dependency), so we delete 
        the generated packages.  
      -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <phase>process-sources</phase>
            <configuration>
              <target>
                <delete dir="${project.build.directory}/generated-sources/xjc/se/swedenconnect/schemas/saml_2_0" />
              </target>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>            
          </execution>
        </executions>
      </plugin>      

    </plugins>

  </build>

</project>
