Source

quixote-repository / quixote-repository-standalone / pom.xml

<?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">

    <parent>
        <groupId>uk.ac.cam.ch.wwmm.quixote.repository</groupId>
        <artifactId>quixote-repository</artifactId>
        <version>0.1-SNAPSHOT</version>
    </parent>

    <modelVersion>4.0.0</modelVersion>

    <artifactId>quixote-repository-standalone</artifactId>
    <packaging>war</packaging>

    <name>Quixote Data Repository :: Standalone Webapp</name>

    <dependencies>

        <dependency>
            <groupId>uk.ac.cam.ch.wwmm.quixote.repository</groupId>
            <artifactId>quixote-repository-webapp</artifactId>
            <version>0.1-SNAPSHOT</version>
            <type>war</type>
        </dependency>

        <dependency>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>jetty</artifactId>
            <version>6.1.26</version>
        </dependency>

    </dependencies>

    <repositories>
        <repository>
            <id>ucc-repo</id>
            <url>https://maven.ch.cam.ac.uk/m2repo</url>
        </repository>
    </repositories>


    <build>
        <plugins>

            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>none</exclude>
                    </excludes>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>1.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <shadedArtifactAttached>false</shadedArtifactAttached>
                            <createDependencyReducedPom>true</createDependencyReducedPom>
                            <transformers>
                                <transformer
                                        implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                    <mainClass>EmbeddedJettyServer</mainClass>
                                </transformer>
                            </transformers>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- The main class needs to be in the root of the war in order to be runnable -->
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.7</version>
                <executions>
                    <execution>
                        <id>move-main-class</id>
                        <phase>compile</phase>
                        <configuration>
                            <tasks>
                                <move todir="${project.build.directory}/${project.artifactId}-${project.version}">
                                    <fileset dir="${project.build.directory}/classes/">
                                        <include name="EmbeddedJettyServer.class"/>
                                    </fileset>
                                </move>
                            </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <descriptors>
                        <descriptor>src/main/assembly/bin-dist.xml</descriptor>
                    </descriptors>
                    <appendAssemblyId>false</appendAssemblyId>
                    <attach>false</attach>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <phase>package</phase>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <configuration>
                    <usedDependencies>
                        <usedDependency>uk.ac.cam.ch.wwmm.quixote.repository:quixote-repository-webapp</usedDependency>
                        <usedDependency>org.mortbay.jetty:jetty</usedDependency>
                    </usedDependencies>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>