<?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.jbundle.base</groupId>
    <artifactId>jbundle-base-reactor</artifactId>
    <version>0.7.8</version>
  </parent>

  <artifactId>org.jbundle.base.remote</artifactId>
  <name>jbundle-base-remote - Remote server</name>
  <packaging>bundle</packaging>

  <properties>
    <jbundlePackageExport>
       ${project.artifactId}.*;version=${project.version},
       org.jbundle.server;version=${project.version},  <!-- org.jbundle.server.Server -->
    </jbundlePackageExport>	<!-- Bundle packages to export -->
    <jbundlePackageImport>
    	*;resolution:=optional,
	    org.jbundle.thin.base.remote;resolution:=optional, <!-- RMI Requires access to .ApplicationServer class -->
    </jbundlePackageImport>
  </properties>  

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <Bundle-ManifestVersion>2</Bundle-ManifestVersion>
            <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
            <Export-Package>${jbundlePackageExport}</Export-Package>
            <Import-Package>${jbundlePackageImport}</Import-Package>
            <Bundle-Activator>org.jbundle.base.remote.rmiserver.RemoteSessionActivator</Bundle-Activator>
          </instructions>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <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>
	        <artifactId>maven-resources-plugin</artifactId>
	        <executions>
          <execution>
            <id>copy-jibx-bind</id>
            <phase>validate</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${basedir}/src/main/java</outputDirectory>
              <resources>          
                <resource>
                  <directory>${baseMixedDir}/src/main/java</directory>
                  <filtering>false</filtering>
                  <includes>
                    <include>org/jbundle/base/remote/**/*.java</include>
                    <include>org/jbundle/server/*.java</include>
                  </includes>
                </resource>
              </resources>              
            </configuration>            
          </execution>
	        </executions>
	      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <excludes>
            <exclude>**</exclude>
          </excludes>
        </configuration>
      </plugin>
	    </plugins>
      </build>
    </profile>
  </profiles>
  
  <dependencies>
    <dependency>
      <groupId>org.jbundle.base</groupId>
      <artifactId>org.jbundle.base.mixed</artifactId>
      <version>0.7.8</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.core</artifactId>
      <scope>provided</scope> <!-- This better be provided -->
    </dependency>
  </dependencies>

</project>
