<?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">
  <parent>
    <artifactId>jruby-artifacts</artifactId>
    <groupId>org.jruby</groupId>
    <version>1.7.12-d18</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>jruby-complete</artifactId>
  <name>JRuby Complete</name>
  <build>
    <resources>
      <resource>
        <targetPath>${jruby.complete.home}/lib</targetPath>
        <directory>${jruby.basedir}/lib</directory>
        <includes>
          <include>**/ruby/shared/bc*.jar</include>
        </includes>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <version>2.1</version>
        <executions>
          <execution>
            <id>pack jruby.artifact</id>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <relocations>
                <relocation>
                  <pattern>org.objectweb</pattern>
                  <shadedPattern>org.jruby.org.objectweb</shadedPattern>
                </relocation>
              </relocations>
              <transformers>
                <transformer>
                  <mainClass>org.jruby.Main</mainClass>
                </transformer>
              </transformers>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>unzip jruby-core.jar</id>
            <phase>package</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <workingDirectory>${basedir}/../..</workingDirectory>
              <arguments>
                <argument>-d</argument>
                <argument>${project.build.outputDirectory}</argument>
                <argument>-o</argument>
                <argument>${project.build.directory}/${project.build.finalName}.jar</argument>
              </arguments>
              <executable>unzip</executable>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>manifest</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <archive>
            <manifest>
              <mainClass>org.jruby.Main</mainClass>
            </manifest>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <id>update manifest</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <archive>
                <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
              </archive>
              <excludes>
                <exclue>Dummy.class</exclue>
              </excludes>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-invoker-plugin</artifactId>
        <executions>
          <execution>
            <id>integration-test</id>
            <goals>
              <goal>install</goal>
              <goal>run</goal>
            </goals>
            <configuration>
              <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>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>sonatype-oss-release</id>
      <build>
        <resources>
          <resource>
            <targetPath>/Users/enebo/work/release/maven/jruby-complete/target</targetPath>
            <directory>/Users/enebo/work/release/maven/jruby-complete/../../core/target</directory>
            <includes>
              <include>*-sources.jar</include>
              <include>*-javadoc.jar</include>
            </includes>
          </resource>
        </resources>
        <plugins>
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <version>2.1.2</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
                <configuration>
                  <skipSource>true</skipSource>
                </configuration>
              </execution>
            </executions>
            <configuration>
              <skipSource>true</skipSource>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <version>1.8</version>
            <executions>
              <execution>
                <id>attach-artifacts</id>
                <phase>package</phase>
                <goals>
                  <goal>attach-artifact</goal>
                </goals>
                <configuration>
                  <artifacts>
                    <artifact>
                      <file>/Users/enebo/work/release/maven/jruby-complete/target/jruby-core-1.7.12-sources.jar</file>
                      <classifier>sources</classifier>
                    </artifact>
                    <artifact>
                      <file>/Users/enebo/work/release/maven/jruby-complete/target/jruby-core-1.7.12-javadoc.jar</file>
                      <classifier>javadoc</classifier>
                    </artifact>
                  </artifacts>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <pluginRepositories>
    <pluginRepository>
      <id>rubygems-releases</id>
      <url>http://rubygems-proxy.torquebox.org/releases</url>
    </pluginRepository>
  </pluginRepositories>
  <properties>
    <jruby.basedir>${basedir}/../../</jruby.basedir>
    <main.basedir>${project.parent.parent.basedir}</main.basedir>
    <jruby.complete.home>${project.build.outputDirectory}/META-INF/jruby.home</jruby.complete.home>
  </properties>
</project>

