<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.jruby</groupId>
    <artifactId>jruby-artifacts</artifactId>
    <version>1.7.16.1</version>
  </parent>
  <artifactId>jruby-complete</artifactId>
  <packaging>bundle</packaging>
  <name>JRuby Complete</name>
  <properties>
    <jruby.home>${basedir}/../../</jruby.home>
    <tesla.dump.readOnly>true</tesla.dump.readOnly>
    <main.basedir>${project.parent.parent.basedir}</main.basedir>
    <tesla.dump.pom>pom.xml</tesla.dump.pom>
    <jruby.complete.home>${project.build.outputDirectory}/META-INF/jruby.home</jruby.complete.home>
    <tesla.version>0.1.1</tesla.version>
  </properties>
  <dependencies>
    <dependency>
      <groupId>org.jruby</groupId>
      <artifactId>jruby-core</artifactId>
      <version>${project.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.jruby</groupId>
      <artifactId>jruby-stdlib</artifactId>
      <version>${project.version}</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>
  <pluginRepositories>
    <pluginRepository>
      <id>rubygems-releases</id>
      <url>http://rubygems-proxy.torquebox.org/releases</url>
    </pluginRepository>
  </pluginRepositories>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <extensions>true</extensions>
        <configuration>
          <archive>
            <manifest>
              <mainClass>org.jruby.Main</mainClass>
            </manifest>
          </archive>
          <instructions>
            <Export-Package>org.jruby.*;version=${project.version}</Export-Package>
            <Import-Package>!org.jruby.*, *;resolution:=optional</Import-Package>
            <DynamicImport-Package>javax.*</DynamicImport-Package>
            <Embed-Dependency>*;type=jar;scope=provided;inline=true</Embed-Dependency>
            <Embed-Transitive>true</Embed-Transitive>
            <Private-Package>*,.</Private-Package>
            <Bundle-Name>JRuby ${project.version}</Bundle-Name>
            <Bundle-Description>JRuby ${project.version} OSGi bundle</Bundle-Description>
            <Bundle-SymbolicName>org.jruby.jruby</Bundle-SymbolicName>
          </instructions>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-invoker-plugin</artifactId>
        <executions>
          <execution>
            <id>integration-test</id>
            <goals>
              <goal>install</goal>
              <goal>run</goal>
            </goals>
            <configuration>
              <properties>
                <project.version>${project.version}</project.version>
              </properties>
              <settingsFile>${basedir}/src/it/settings.xml</settingsFile>
              <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <projectsDirectory>src/it</projectsDirectory>
          <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
          <preBuildHookScript>setup.bsh</preBuildHookScript>
          <postBuildHookScript>verify.bsh</postBuildHookScript>
          <goals>
            <goal>install</goal>
          </goals>
        </configuration>
      </plugin>
      <plugin>
        <groupId>io.tesla.polyglot</groupId>
        <artifactId>tesla-polyglot-maven-plugin</artifactId>
        <version>${tesla.version}</version>
        <executions>
          <execution>
            <id>setup other osgi frameworks</id>
            <phase>pre-integration-test</phase>
            <goals>
              <goal>execute</goal>
            </goals>
            <configuration>
              <taskId>setup other osgi frameworks</taskId>
              <nativePom>pom.rb</nativePom>
            </configuration>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>io.tesla.polyglot</groupId>
            <artifactId>tesla-polyglot-ruby</artifactId>
            <version>${tesla.version}</version>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>sonatype-oss-release</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <configuration>
              <skipSource>true</skipSource>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-artifacts</id>
                <phase>package</phase>
                <goals>
                  <goal>attach-artifact</goal>
                </goals>
                <configuration>
                  <artifacts>
                    <artifact>
                      <file>${project.build.directory}/jruby-core-${project.version}-sources.jar</file>
                      <classifier>sources</classifier>
                    </artifact>
                    <artifact>
                      <file>${project.build.directory}/jruby-core-${project.version}-javadoc.jar</file>
                      <classifier>javadoc</classifier>
                    </artifact>
                  </artifacts>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>io.tesla.polyglot</groupId>
            <artifactId>tesla-polyglot-maven-plugin</artifactId>
            <version>${tesla.version}</version>
            <executions>
              <execution>
                <id>sources_and_javadoc</id>
                <phase>prepare-package</phase>
                <goals>
                  <goal>execute</goal>
                </goals>
                <configuration>
                  <taskId>sources_and_javadoc</taskId>
                  <nativePom>pom.rb</nativePom>
                </configuration>
              </execution>
            </executions>
            <dependencies>
              <dependency>
                <groupId>io.tesla.polyglot</groupId>
                <artifactId>tesla-polyglot-ruby</artifactId>
                <version>${tesla.version}</version>
              </dependency>
            </dependencies>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>jdk8</id>
      <activation>
        <jdk>1.8</jdk>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-invoker-plugin</artifactId>
            <configuration>
              <pomExcludes>
                <pomExclude>osgi_many_bundles_with_embedded_gems_felix-3.2/pom.xml</pomExclude>
              </pomExcludes>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
