<?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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>io.ejs</groupId>
    <artifactId>ringojs</artifactId>
    <version>0.12.0</version>

    <packaging>jar</packaging>

    <name>RingoJS</name>

    <description>
        A JavaScript runtime and shell based on Rhino providing a CommonJS module library and web
        application framework. This project is maintained by ejs.io in order to place Ringo in the
        Central Maven repository.
    </description>

    <url>http://ringojs.org/</url>

    <prerequisites>
        <maven>3.0.4</maven>
    </prerequisites>

    <scm>
        <connection>scm:git:git@github.com:Transcordia/ringojs.git</connection>
        <developerConnection>scm:git:git@github.com:Transcordia/ringojs.git</developerConnection>
        <url>git@github.com:Transcordia/ringojs.git</url>
      <tag>HEAD</tag>
  </scm>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>hns</id>
            <name>Hannes Wallnöfer</name>
            <url>http://github.com/ringo/ringojs/commits/master?author=hns</url>
            <roles>
                <role>Project Manager</role>
            </roles>
        </developer>
        <developer>
            <id>earl</id>
            <name>Andreas Bolka</name>
            <url>http://github.com/ringo/ringojs/commits/master?author=earl</url>
        </developer>
        <developer>
            <id>robi42</id>
            <name>Robert Thurnher</name>
            <url>http://github.com/ringo/ringojs/commits/master?author=robi42</url>
        </developer>
        <developer>
            <id>oberhamsi</id>
            <name>Simon Oberhammer</name>
            <url>http://github.com/ringo/ringojs/commits/master?author=oberhamsi</url>
        </developer>
        <developer>
            <id>tschaub</id>
            <name>Tim Schaub</name>
            <url>http://github.com/ringo/ringojs/commits/master?author=tschaub</url>
        </developer>
        <developer>
            <id>botic</id>
            <name>Philipp Naderer</name>
            <url>http://github.com/ringo/ringojs/commits/master?author=botic</url>
        </developer>
        <developer>
            <id>grob</id>
            <name>Robert Gaggl</name>
            <url>http://github.com/ringo/ringojs/commits/master?author=grob</url>
        </developer>
        <developer>
            <id>rrmckinley</id>
            <name>rrmckinley</name>
            <url>http://github.com/ringo/ringojs/commits/master?author=rrmckinley</url>
        </developer>
        <developer>
            <id>chl</id>
            <name>Christian Langreiter</name>
            <url>http://github.com/ringo/ringojs/commits/master?author=chl</url>
        </developer>
        <developer>
            <id>matthias</id>
            <name>Matthias Platzer</name>
            <url>http://github.com/ringo/ringojs/commits/master?author=matthias</url>
        </developer>
        <developer>
            <id>gmosx</id>
            <name>George Moschovitis</name>
            <url>http://github.com/ringo/ringojs/commits/master?author=gmosx</url>
        </developer>
        <developer>
            <id>garryyao</id>
            <name>Garry Yao</name>
            <url>http://github.com/ringo/ringojs/commits/master?author=garryyao</url>
        </developer>
        <developer>
            <id>pnewhook</id>
            <name>Peter Newhook</name>
            <url>http://github.com/ringo/ringojs/commits/master?author=pnewhook</url>
        </developer>
        <developer>
            <id>mrdon</id>
            <name>Don Brown</name>
            <url>http://github.com/ringo/ringojs/commits/master?author=mrdon</url>
        </developer>
        <developer>
            <id>oravecz</id>
            <name>Jim Cook</name>
            <url>http://github.com/ringo/ringojs/commits/master?author=oravecz</url>
        </developer>
        <developer>
            <id>olegp</id>
            <name>Oleg Podsechin</name>
            <url>http://github.com/ringo/ringojs/commits/master?author=olegp</url>
        </developer>
        <developer>
            <id>maks</id>
            <name>Maksim Lin</name>
            <url>http://github.com/ringo/ringojs/commits/master?author=maks</url>
        </developer>
        <developer>
            <id>stt</id>
            <name>Samuli Tuomola</name>
            <url>http://github.com/ringo/ringojs/commits/master?author=stt</url>
        </developer>
    </developers>

    <issueManagement>
        <system>github</system>
        <url>http://github.com/ringo/ringojs/issues</url>
    </issueManagement>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <jetty-version>9.3.8.v20160314</jetty-version>
        <slf4j-version>1.7.21</slf4j-version>
        <log4j-version>1.2.17</log4j-version>
        <rhino-version>1.7.7.1</rhino-version>
        <junit-version>4.12</junit-version>
        <jnr-posix-version>1.1.9</jnr-posix-version>
        <constantine-version>0.7</constantine-version>
        <jffi-version>1.0.10</jffi-version>
        <jaffl-version>0.5.12</jaffl-version>
        <jline-version>2.12.1</jline-version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.mozilla</groupId>
            <artifactId>rhino</artifactId>
            <version>${rhino-version}</version>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j-version}</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit-version}</version>
            <!-- Ringo was developed without Maven in mind. Normally this would be test
                 scope, but Ringo interleaves the Java test files with the Java source
                 files. Either way, we don't want JUnit libs in the distribution.
            -->
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>${slf4j-version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>${log4j-version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-continuation</artifactId>
            <version>${jetty-version}</version>
            <scope>provided</scope>
        </dependency>

        <!-- These Jetty libraries are needed for httpserver.js -->

        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-server</artifactId>
            <version>${jetty-version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-servlet</artifactId>
            <version>${jetty-version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-servlets</artifactId>
            <version>${jetty-version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.eclipse.jetty.websocket</groupId>
            <artifactId>websocket-server</artifactId>
            <version>${jetty-version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-xml</artifactId>
            <version>${jetty-version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>jline</groupId>
            <artifactId>jline</artifactId>
            <version>${jline-version}</version>
            <scope>provided</scope>
        </dependency>

    </dependencies>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <build>
        <sourceDirectory>src</sourceDirectory>
        <testSourceDirectory>src/org/ringojs/test</testSourceDirectory>

        <plugins>

            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <id>copy-resources</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${basedir}/target/classes/modules</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>modules</directory>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.0.2</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addClasspath>false</addClasspath>
                            <mainClass>org.ringojs.tools.launcher.Main</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.6.0</version>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                    <optimize>true</optimize>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.8</version>
                <executions>
                    <execution>
                        <phase>test</phase>
                        <configuration>
                            <target unless="maven.test.skip">
                                <java classname="org.ringojs.tools.launcher.Main" fork="true" failonerror="yes">
                                    <arg value="test/all.js" />
                                    <classpath refid="maven.test.classpath" />
                                </java>
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>external.atlassian.jgitflow</groupId>
                <artifactId>jgitflow-maven-plugin</artifactId>
                <version>1.0-m5.1</version>
                <configuration>

                </configuration>
            </plugin>
        </plugins>

    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.4</version>
                <configuration>
                    <source>1.5</source>
                </configuration>
            </plugin>
        </plugins>
    </reporting>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.0.1</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>2.10.1</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.7</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>

                </plugins>
            </build>
        </profile>
    </profiles>
</project>
