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

  <parent>
    <groupId>org.jibx.config</groupId>
    <artifactId>main-reactor</artifactId>
    <version>1.2.6-SNAPSHOT</version>
  </parent>

  <groupId>org.jibx</groupId>
  <artifactId>jibx-schema</artifactId>
  <packaging>bundle</packaging>

  <name>jibx-schema - JiBX schema</name>
  <description>JiBX schema code</description>

  <profiles>
    <profile> 
      <id>sonatype-oss-release</id>
      <build>
      <!-- ***CAREFUL*** This logic moves the source code to the current project, then
      does NOT compile it. This way, the api and source are in the repo. -->
	    <plugins>
	      <plugin>
	        <inherited>true</inherited>
	        <groupId>org.apache.maven.plugins</groupId>
	        <artifactId>maven-compiler-plugin</artifactId>
	        <configuration>
	          <excludes>
	            <exclude>**/**</exclude>	<!-- This will not compile any, but include the source in the dist -->
	          </excludes>
	        </configuration>
	      </plugin>
	      <plugin>
	        <artifactId>maven-resources-plugin</artifactId>
	        <version>2.4.3</version>
	        <executions>
          <execution>
            <id>copy-jibx-schema</id>
            <phase>validate</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${basedir}/src/main/java</outputDirectory>
              <resources>          
                <resource>
                  <directory>${coreSourceDir}</directory>
                  <filtering>false</filtering>
                  <includes>
                    <include>org/jibx/schema/**/*.java</include>
                  </includes>
                  <excludes>
                    <exclude>org/jibx/schema/codegen/**/*.java</exclude>
                    <exclude>org/jibx/schema/generator/**/*.java</exclude>
                  </excludes>
                </resource>
              </resources>              
            </configuration>            
          </execution>
	        </executions>
	      </plugin>
	    </plugins>
      </build>
    </profile>
  </profiles>
  
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <Export-Package>
                !org.jibx.schema.codegen.*,  <!-- In jibx-tools -->
                !org.jibx.schema.generator.*,  <!-- In jibx-tools -->
                org.jibx.schema.*;version=${project.version},
            </Export-Package>
	    <Include-Resource>@${jibxLibDir}/jibx-schema.jar;inline=**</Include-Resource>
	    <Class-Path>jibx-run.jar jibx-bind.jar xpp3.jar stax-api.jar wstx-asl.jar</Class-Path>
          </instructions>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>jibx-bind</artifactId>
      <version>1.2.6-SNAPSHOT</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>jibx-extras</artifactId>
      <version>1.2.6-SNAPSHOT</version>
    </dependency>
  </dependencies>

</project>
