Maven 1.x UberJar Plugin

Don't include dependencies marked with a given property

Details

  • Type: Wish Wish
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Description

My project uses libaries for testing (jUnit, MockObjects) that aren't needed when deployed. It would be nice if the uberjar goal could not include dependencies that were marked with a property (like testTime).

Activity

Hide
Ronald Holshausen added a comment -

You can use uberjar.bundle=false to exclude a dependancy.
Eg: <properties><uberjar.bundle>false</uberjar.bundle></properties>

Show
Ronald Holshausen added a comment - You can use uberjar.bundle=false to exclude a dependancy. Eg: <properties><uberjar.bundle>false</uberjar.bundle></properties>
Hide
Ronald Holshausen added a comment -

The classworlds.conf velocity template from version 1.2 of the plugin
does not exclude marked dependancies.

Changing it to:
main is $ubermain from app

[app]
#foreach ( $dep in $pom.dependencies )#if (!$dep.getProperty('uberjar.bundle') || $dep.getProperty('uberjar.bundle') == 'true')
load ${classworlds.lib}/$dep.artifact
#end#end
load ${classworlds.lib}/${self}.jar

solves this

Show
Ronald Holshausen added a comment - The classworlds.conf velocity template from version 1.2 of the plugin does not exclude marked dependancies. Changing it to: main is $ubermain from app [app] #foreach ( $dep in $pom.dependencies )#if (!$dep.getProperty('uberjar.bundle') || $dep.getProperty('uberjar.bundle') == 'true') load ${classworlds.lib}/$dep.artifact #end#end load ${classworlds.lib}/${self}.jar solves this

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: