Skip to content

Instantly share code, notes, and snippets.

@dlokesh
Created October 19, 2013 15:41
Show Gist options
  • Save dlokesh/7057490 to your computer and use it in GitHub Desktop.
Save dlokesh/7057490 to your computer and use it in GitHub Desktop.
Using leiningen for java projects
<?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>
<name>hello</name>
<groupId>com.hello.service</groupId>
<artifactId>hello-service</artifactId>
<version>1.0.1-SNAPSHOT</version>
<build>
<finalName>${project.artifactId}-original</finalName>
<resources>
<resource>
<directory>src/main/webapp</directory>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.0</version>
<executions>
<execution>
<id>${project.name}-service-jar</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<finalName>${project.name}-service</finalName>
<shadedArtifactId>${project.name}-service</shadedArtifactId>
<shadedArtifactAttached>true</shadedArtifactAttached>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.hello.service.Main</mainClass>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.handlers</resource>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.schemas</resource>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.tooling</resource>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/cxf/bus-extensions.txt</resource>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>${hibernate.framework.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.3.0.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>${hibernate.framework.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-xc</artifactId>
<version>1.8.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-jaxrs</artifactId>
<version>1.8.0</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-api</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.framework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring.framework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring.framework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.framework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring.framework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.framework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.framework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.framework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.framework.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.1</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2</version>
</dependency>
<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.4.GA</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.0-801.jdbc4</version>
</dependency>
<dependency>
<groupId>com.googlecode.lambdaj</groupId>
<artifactId>lambdaj</artifactId>
<version>2.3.2</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-exec</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
</dependencies>
</project>
(defproject service "0.1.0-SNAPSHOT"
:description "Lein for java"
:dependencies [[org.clojure/clojure "1.5.1"]
[org.hibernate/hibernate-core "4.1.4.Final"]
[org.hibernate/hibernate-validator "4.3.0.Final"]
[org.hibernate/hibernate-entitymanager "4.1.4.Final"]
[org.codehaus.jackson/jackson-xc "1.8.0"]
[org.codehaus.jackson/jackson-jaxrs "1.8.0"]
[org.apache.cxf/cxf-api "2.7.3"]
[org.apache.cxf/cxf-rt-frontend-jaxrs "2.7.3"]
[org.apache.cxf/cxf-rt-transports-http "2.7.3"]
[org.apache.cxf/cxf-rt-transports-http-jetty "2.7.3"]
[org.springframework/spring-core "3.1.2.RELEASE"]
[org.springframework/spring-orm "3.1.2.RELEASE"]
[org.springframework/spring-tx "3.1.2.RELEASE"]
[org.springframework/spring-jdbc "3.1.2.RELEASE"]
[org.springframework/spring-aop "3.1.2.RELEASE"]
[org.springframework/spring-beans "3.1.2.RELEASE"]
[org.springframework/spring-webmvc "3.1.2.RELEASE"]
[org.springframework/spring-context-support "3.1.2.RELEASE"]
[org.slf4j/slf4j-log4j12 "1.7.1"]
[commons-collections/commons-collections "3.2"]
[javassist/javassist "3.4.GA"]
[commons-dbcp/commons-dbcp "1.3"]
[postgresql/postgresql "9.0-801.jdbc4"]
[com.googlecode.lambdaj/lambdaj "2.3.2"]
[org.apache.commons/commons-exec "1.1"]
[commons-io/commons-io "1.4"]
[commons-lang/commons-lang "2.6"]]
:java-source-paths ["src/main/java"]
:resource-paths ["src/main/resources" "src/main/webapp"]
:test-paths ["src/test/java"]
:uberjar-merge-with {"META-INF/spring.handlers" [slurp (fn [x y] (str x "\n" y "\n")) spit]
"META-INF/spring.schemas" [slurp (fn [x y] (str x "\n" y "\n")) spit]
"META-INF/spring.tooling" [slurp (fn [x y] (str x "\n" y "\n")) spit]
"META-INF/cxf/bus-extensions.txt" [slurp (fn [x y] (str x "\n" y "\n")) spit]}
:repositories [["sonatype-snapshots" "https://oss.sonatype.org/content/repositories/snapshots/"]
["lambdaj repository" "http://lambdaj.googlecode.com/svn/repo/releases"]
["JBoss Repository" "https://repository.jboss.org/nexus/content/groups/public-jboss"]]
:main com.hello.service.Main)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment