Source

atlassian-jruby-example-plugin / pom.xml

Full commit
<?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>
    <groupId>com.atlassian.example</groupId>
    <artifactId>jrubyplugin</artifactId>
    <version>1.0-SNAPSHOT</version>

    <organization>
        <name>Example Company</name>
        <url>http://www.example.com/</url>
    </organization>

    <name>jrubyplugin</name>
    <description>This is the com.atlassian.example:jrubyplugin plugin for Atlassian Confluence.</description>
    <packaging>atlassian-plugin</packaging>

    <dependencies>

        <dependency>
            <groupId>org.jruby</groupId>
            <artifactId>jruby-complete</artifactId>
            <version>${jruby-complete.version}</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.templaterenderer</groupId>
            <artifactId>atlassian-template-renderer-api</artifactId>
            <version>1.3.1</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.util.concurrent</groupId>
            <artifactId>atlassian-util-concurrent</artifactId>
            <version>2.2.0</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.confluence</groupId>
            <artifactId>confluence</artifactId>
            <version>${confluence.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.confluence.plugin</groupId>
            <artifactId>func-test</artifactId>
            <version>2.3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.jwebunit</groupId>
            <artifactId>jwebunit-htmlunit-plugin</artifactId>
            <version>2.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.nekohtml</groupId>
            <artifactId>nekohtml</artifactId>
            <version>1.9.12</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.6</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-confluence-plugin</artifactId>
                <version>${amps.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <productVersion>${confluence.version}</productVersion>
                    <productDataVersion>${confluence.data.version}</productDataVersion>
                    <jvmArgs>-Xmx1536m -XX:MaxPermSize=512m -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled</jvmArgs>
                    <enableFastdev>false</enableFastdev>
                    <instructions>
                        <Import-Package>
                            javax.servlet;version="[2.3,3.0)",
                            org.jruby*;version="[${jruby-complete.version},2.0)"
                            !bsh,
                            !groovy.lang,
                            !com.kenai.jnr.x86asm,
                            *;resolution:=optional
                        </Import-Package>

                        <!--
                        Used as a last resort to allow Ruby scripts to load Java classes that are not referred to in the Java code.
                        Due to https://jira.codehaus.org/browse/JRUBY-6519 the more suitable OSGiScriptingContainer can't be used, hence this workaround.
                        -->
                        <DynamicImport-Package>
                            *
                        </DynamicImport-Package>
                    </instructions>
                    <compressResources>false</compressResources>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jruby.plugins</groupId>
                <artifactId>jruby-rake-plugin</artifactId>
                <version>${jruby-complete.version}</version>
                <executions>
                    <execution>
                        <!-- use ruby to generate an index file for the additional RubyGems added to the jruby-complete.jar -->
                        <id>generate-gem-specification-index</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>rake</goal>
                        </goals>
                        <configuration>
                            <args>
                                generate_gem_index
                                index_file=${gem.spec.index}
                                custom_gem_path=${gem.path}
                            </args>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>

        <resources>
            <!-- mvn process-resources -->
            <resource>
                <filtering>false</filtering>
                <directory>src/main/ruby</directory>
            </resource>
            <resource>
                <filtering>false</filtering>
                <directory>src/main/rubygems/gems</directory>
                <targetPath>rubygems</targetPath>
                <includes>
                    <include>*/lib/**/*</include>
                </includes>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
        </resources>
    </build>

    <properties>
        <confluence.version>4.1.1</confluence.version>
        <confluence.data.version>3.5</confluence.data.version>
        <amps.version>3.8</amps.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <plugins.version>2.7.0</plugins.version>
        <jruby-complete.version>1.6.7</jruby-complete.version>

        <!-- Add the names of the Rubygems you need to the required.gems property: -->
        <required.gems>sinatra jruby-rack</required.gems>
        <gem.path>${basedir}/src/main/rubygems</gem.path>
        <gem.spec.index>${basedir}/target/classes/META-INF/gemspec.index</gem.spec.index>
        <gem.options>--no-rdoc --no-ri --install-dir=${gem.path}</gem.options>
    </properties>

    <profiles>
        <profile>
            <id>rubygems</id>
            <activation>
                <activeByDefault>false</activeByDefault>
                <file>
                    <!-- Note: local properties are not interpolated! -->
                    <missing>src/main/rubygems/gems</missing>
                </file>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jruby.plugins</groupId>
                        <artifactId>jruby-rake-plugin</artifactId>
                        <version>${jruby-complete.version}</version>
                        <executions>
                            <execution>
                                <id>install-gems</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>install-gems</goal>
                                </goals>
                                <configuration>
                                    <gems>${gem.options} ${required.gems}</gems>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>idea</id>
            <dependencies>
                <dependency>
                    <groupId>com.atlassian.util.concurrent</groupId>
                    <artifactId>atlassian-util-concurrent</artifactId>
                    <version>2.2.0</version>
                    <scope>compile</scope>
                </dependency>
                <dependency>
                    <groupId>com.atlassian.confluence</groupId>
                    <artifactId>confluence</artifactId>
                    <version>${confluence.version}</version>
                    <scope>compile</scope>
                </dependency>
            </dependencies>
        </profile>
    </profiles>

</project>