java - How to append a class-path entry to the Manifest? -
my gradle build creates manifest files including *.jar
files contained in lib/
. i'd add lib
directory classpath, lib/log4j.properties
grabbed @ runtime myapp
. how can append 'class-path'
below?
jar { manifest { attributes 'implementation-title': 'myapp', 'implementation-version': version, 'class-path': configurations.runtime.files.collect { it.name }.join(' lib/'), 'main-class': 'ca.company.product.myapp.application', 'built-by': system.getproperty('user.name'), 'built-jdk': system.getproperty('java.version') } }
i've looked in gradle doc, not dug yet gravy. i've overlooked questions on or gradle forum.
i found out variables can concatenated in regular java. following build.gradle
worked me:
jar { manifest { attributes 'implementation-title': 'myapp', 'implementation-version': version, 'class-path': configurations.runtime.files.collect { it.name }.join(' lib/') + ' lib/log4j.properties', 'main-class': 'ca.company.product.myapp.application', 'built-by': system.getproperty('user.name'), 'built-jdk': system.getproperty('java.version') }
Comments
Post a Comment