buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Hoogland <hoogl...@gmail.com>
Subject stand-alone jar
Date Sat, 13 Apr 2013 14:19:34 GMT
I;ve seen
http://stackoverflow.com/questions/1279419/buildr-package-dependencies-into-a-single-jar/1285293#1285293but
I'd prefer a buildr-only solution and it I can't find any good info
regarding inserting the Class-Path in the MANIFEST.MF

I have

DEPS =
[
  ARGS4J,
  JASYPT,
  WEB,
  ORIENTDB,
  '/path/to/local.jar'
]

repositories.remote << 'http://repo1.maven.org/maven2'

define 'My Project' do

  project.version = VERSION_NUMBER
  project.group = 'myGroup'
  compile.options.target = '1.7'

  desc 'Bountius Server'
  define 'deps' do
    package(:jar).merge(DEPS)
  end

  manifest['Main-Class'] = 'com.myProject.control.Start'

  desc 'iMyProject Server'
  define 'server' do
    compile.with DEPS
    package(:jar).merge(DEPS)
  end
end

The server jar created just throws the kitchen sink in, apparently
overwriting the META-ING/MANIFEST.MF with the final artifact MANIFEST.MF
rather than using my manifest settings.

I'm trying to do what my old ant build.xml does, namely:
1. compile my src code into classes
2. packages them into a jar
3. adds the dependency jars to this jar
4. includes "Main-Class" and "Class-Path" attributes to
META-INF/MANIFEST.MF, the latter properly formatted, e.g.:

Class-Path: args4j-2.0.18.jar gson-2.2.2.jar jasypt-1.9.0.jar orient-c
 ommons-1.3.0.jar orientdb-client-1.3.0.jar orientdb-core-1.3.0.jar or
 ientdb-enterprise-1.3.0.jar orientdb-server-1.3.0.jar prodigitum.util
 .jar commons-exec-1.1.jar commons-logging-1.1.1.jar guava-14.0.jar ht
 tpclient-4.2.1.jar httpcore-4.2.1.jar json-20080701.jar selenium-java
 -2.31.0.jar

The resulting jar can be run stand-alone.

I'm open to a better or equivalent way in buildr if someone could possibly
help

Cheers
hoogs

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message