Skip to content

Instantly share code, notes, and snippets.

@zcourts
Created November 28, 2012 22:09
Show Gist options
  • Save zcourts/4165022 to your computer and use it in GitHub Desktop.
Save zcourts/4165022 to your computer and use it in GitHub Desktop.
generic Scala RPM pom.xml file
<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>
<artifactId>project</artifactId>
<groupId>com.company</groupId>
<packaging>jar</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>Project</name>
<description>
Description
</description>
<!-- version control -->
<scm>
<connection>scm:git:https://github.com/zcourts/project</connection>
<developerConnection>scm:git:git@github.com:zcourts/project</developerConnection>
<url>https://github.com/zcourts/project</url>
</scm>
<properties>
<scala.version>2.9.1</scala.version>
<jackson.version>2.0.2</jackson.version>
</properties>
<dependencies>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala.version}</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>org.joda</groupId>
<artifactId>joda-convert</artifactId>
<version>1.2</version>
</dependency>
<!--logging-->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<!--testing-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
</dependency>
<dependency>
<groupId>info.crlog</groupId>
<artifactId>higgs</artifactId>
<version>0.0.2-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<!--scala plugins-->
<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<version>2.15.2</version>
<executions>
<execution>
<id>scala-compile-first</id>
<phase>process-resources</phase>
<goals>
<goal>add-source</goal>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>scala-test-compile</id>
<phase>process-test-resources</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
<!--scala plugins end-->
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<archive>
<manifest>
<mainClass>com.company.project.MainClass</mainClass>
<addClasspath>true</addClasspath>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.3</version>
<configuration>
<systemProperties>
<property>
<name>file.separator</name>
<value>/</value>
</property>
</systemProperties>
</configuration>
</plugin>
<!-- build an RPM from your project-->
<plugin>
<version>2.1-alpha-1</version>
<groupId>org.codehaus.mojo</groupId>
<artifactId>rpm-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>attached-rpm</goal>
</goals>
</execution>
</executions>
<configuration>
<targetOS>linux</targetOS>
<group>Services/Project</group>
<!--copyright required to avoid error message "error: License field must be present in package: (main package)"-->
<copyright>Company name - All rights reserved</copyright>
<defaultGroupname>${project.artifactId}</defaultGroupname>
<defaultUsername>${project.artifactId}</defaultUsername>
<mappings>
<mapping>
<filemode>755</filemode>
<directory>/usr/lib/${project.artifactId}</directory>
<artifact/>
<dependency/>
</mapping>
<mapping>
<configuration>true</configuration>
<directory>/etc/${project.artifactId}</directory>
<filemode>644</filemode>
<sources>
<source>
<location>src/main/resources</location>
<includes>
<include>*.*</include>
</includes>
</source>
<source>
<location>src/main/conf</location>
<includes>
<include>*.properties</include>
<include>*.xml</include>
<include>*.scala</include>
</includes>
</source>
</sources>
</mapping>
<mapping>
<directory>/etc/init.d</directory>
<filemode>755</filemode>
<directoryIncluded>false</directoryIncluded>
<sources>
<source>
<location>src/main/init.d</location>
<includes>
<include>${project.artifactId}</include>
</includes>
</source>
</sources>
</mapping>
</mappings>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<!--<repository>-->
<!--<id>zcourts</id>-->
<!--<name>repo.zcourts.com</name>-->
<!--<url>http://repo.crlog.info/repository/zcourts/</url>-->
<!--<releases>-->
<!--<enabled>true</enabled>-->
<!--</releases>-->
<!--<snapshots>-->
<!--<enabled>true</enabled>-->
<!--</snapshots>-->
<!--</repository>-->
<repository>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>central</id>
<name>releases</name>
<url>http://repo.typesafe.com/typesafe/releases</url>
</repository>
<!--<repository>-->
<!--<id>repo.codahale.com</id>-->
<!--<url>http://repo.codahale.com</url>-->
<!--</repository>-->
<!--<repository>-->
<!--<id>sonatype-oss-snapshot</id>-->
<!--<url>https://oss.sonatype.org/content/repositories/snapshots/</url>-->
<!--<snapshots>-->
<!--<enabled>true</enabled>-->
<!--<updatePolicy>daily</updatePolicy>-->
<!--</snapshots>-->
<!--</repository>-->
</repositories>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment