jQAssistant command line stopped working after switching to 1.3.0 - gradle

I'm used to configure the gradle build to use jQAssistent with (basically) this snippet in build.gradle:
project.ext["jqaversion"] = "1.3.0"
project.ext["jqacoreversion"] = "1.3"
configurations {
jqaRuntime
}
dependencies {
// jQA 1.2
// jqaRuntime("com.buschmais.jqassistant:commandline:${project.jqaversion}")
// jQA 1.3
jqaRuntime("com.buschmais.jqassistant:jqassistant-commandline:${project.jqaversion}")
jqaRuntime("com.buschmais.jqassistant.plugin:java:${project.jqacoreversion}")
jqaRuntime("com.buschmais.jqassistant.plugin:junit:${project.jqacoreversion}")
}
task removeJQAReport(type: Delete) {
delete 'jqassistant/report'
delete 'jqassistant/store'
}
task(jqascan, dependsOn: 'removeJQAReport', type: JavaExec) {
main = 'com.buschmais.jqassistant.commandline.Main'
classpath = configurations.jqaRuntime
args 'scan'
args '-p'
args 'jqassistant/jqassistant.properties'
args '-f'
args 'java:classpath::build/classes/main'
args 'java:classpath::build/classes/test'
}
task(jqaanalyze, type: JavaExec) {
main = 'com.buschmais.jqassistant.commandline.Main'
classpath = configurations.jqaRuntime
args 'analyze'
args '-r'
args 'jqassistant/jqassistant-rules'
}
task(jqa, dependsOn: ['jqascan', 'jqaanalyze']) {
jqaanalyze.mustRunAfter jqascan
}
task(jqs, type: JavaExec) {
main = 'com.buschmais.jqassistant.commandline.Main'
classpath = configurations.jqaRuntime
args 'server'
standardInput = System.in
}
This works fine until jQA 1.2.0. After updating to 1.3.0, I'm getting this exception:
2017-09-26 14:42:33.793 [main] INFO PluginConfigurationReaderImpl - Loaded jQAssistant plugins [Common, Core Analysis, JUnit, Java, XML].
2017-09-26 14:42:33.826 [main] INFO StoreFactory - Connecting to store at 'file:/C:/Users/jn/projects/jqa-with-gradle/jqassistant/store'
Exception in thread "main" java.lang.NoSuchFieldError: BOOLEAN
at org.neo4j.shell.ShellSettings.<clinit>(ShellSettings.java:42)
at sun.misc.Unsafe.ensureClassInitialized(Native Method)
at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:43)
at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:142)
at java.lang.reflect.Field.acquireFieldAccessor(Field.java:1088)
at java.lang.reflect.Field.getFieldAccessor(Field.java:1069)
at java.lang.reflect.Field.get(Field.java:393)
at org.neo4j.kernel.configuration.AnnotatedFieldHarvester.findStatic(AnnotatedFieldHarvester.java:47)
at org.neo4j.kernel.configuration.AnnotationBasedConfigurationMigrator.<init>(AnnotationBasedConfigurationMigrator.java:39)
at org.neo4j.kernel.configuration.Config.<init>(Config.java:106)
at org.neo4j.kernel.configuration.Config.<init>(Config.java:96)
at org.neo4j.kernel.impl.factory.PlatformModule.<init>(PlatformModule.java:127)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.createPlatform(GraphDatabaseFacadeFactory.java:232)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.initFacade(GraphDatabaseFacadeFactory.java:146)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:130)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newDatabase(GraphDatabaseFactory.java:101)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.lambda$createDatabaseCreator$0(GraphDatabaseFactory.java:89)
at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:183)
at com.buschmais.xo.neo4j.embedded.api.FileDatastoreFactory.createGraphDatabaseService(FileDatastoreFactory.java:31)
at com.buschmais.xo.neo4j.embedded.api.FileDatastoreFactory.createGraphDatabaseService(FileDatastoreFactory.java:16)
at com.buschmais.xo.neo4j.embedded.api.EmbeddedNeo4jXOProvider.createDatastore(EmbeddedNeo4jXOProvider.java:24)
at com.buschmais.xo.impl.XOManagerFactoryImpl.<init>(XOManagerFactoryImpl.java:48)
m.buschmais.xo.impl.bootstrap.XOBootstrapServiceImpl.createXOManagerFactory(XOBootstrapServiceImpl.java:39)
at com.buschmais.xo.api.bootstrap.XO.createXOManagerFactory(XO.java:43)
at com.buschmais.jqassistant.core.store.impl.AbstractGraphStore.start(AbstractGraphStore.java:49)
at com.buschmais.jqassistant.commandline.task.AbstractTask.run(AbstractTask.java:67)
at com.buschmais.jqassistant.commandline.Main.executeTask(Main.java:253)
at com.buschmais.jqassistant.commandline.Main.interpretCommandLine(Main.java:205)
at com.buschmais.jqassistant.commandline.Main.run(Main.java:91)
at com.buschmais.jqassistant.commandline.Main.main(Main.java:62)
:jqascan FAILED
You may find a complete example at https://github.com/kontext-e/jqa-gradle
Maven projects work fine, a command line jQA version is not available to download for 1.3 (only 1.2 is there).
Any ideas? Do I have to specify the Neo4j Version explicitely for 1.3?

Apparently it is a Gradle classpath problem since the jQAssistant commandline distribution works fine. So I modified the build.gradle file the following way:
dependencies {
jqaRuntime("com.buschmais.jqassistant:jqassistant-commandline:${project.jqaversion}") {
// because jQA 1.3 comes with Neo4j 2 and 3 support, there would be a classpath conflict
exclude module: 'neo4j'
}
jqaRuntime("com.buschmais.jqassistant.plugin:java:${project.jqaversion.substring(0, 3)}")
jqaRuntime("com.buschmais.jqassistant.plugin:junit:${project.jqaversion.substring(0, 3)}")
}
The mentioned example at https://github.com/kontext-e/jqa-gradle is also updated this way.

Related

gradle: how to create 2 jars with different java versions using Springboot bootJar task and java toolchain

springboot gradle plugin version: org.springframework.boot:spring-boot-gradle-plugin:2.7.2
I have defined different versions of Java for compilation and test as mentioned here but thats just for compile and test.
tasks.withType(JavaCompile).configureEach {
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(8)
}
}
task('testsOn14', type: Test) {
javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(14)
}
}
Ref: https://docs.gradle.org/current/samples/sample_jvm_multi_project_with_toolchains.html
The jar task is defined simply as jar.dependsOn(bootJar)
I want this task to create 2 jars: myproject-j8.jar and myproject-j14.jar meaning one build with Java-8 and other with Java-14. No idea how to do that. Thanks for taking a look.

Gradle can't find tests anymore after Spring Boot upgrade to 2.3.2

We recently upgraded our Kotlin Spring Boot project so Spring Boot 2.3.2 and since then it seems that gradle can no longer pick up any tests.
We were using the gradle wrapper 5.6.2 and upgraded to 6.3 even though the documentation stated that 5.6.x should work as well. The Gradle upgrade did not help and gradle still can not pick up any tests, when I downgrade to 2.2.3 it works fine. We are using Kotest, Junit5 and an embedded mongodb for our tests.
plugins {
val kotlinVersion = "1.3.50"
kotlin("jvm") version kotlinVersion
kotlin("plugin.spring") version kotlinVersion
id("org.springframework.boot") version "2.3.2.RELEASE"
id("io.spring.dependency-management") version "1.0.9.RELEASE"
id("jacoco")
}
dependencyManagement {
dependencies {
dependency("net.logstash.logback:logstash-logback-encoder:6.1")
dependency("com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0")
val kotlintestVersion = "3.4.2"
dependency("io.kotlintest:kotlintest-runner-junit5:$kotlintestVersion")
dependency("io.kotlintest:kotlintest-extensions-spring:$kotlintestVersion")
dependency("io.kotlintest:kotlintest-assertions:$kotlintestVersion")
}
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.springframework.boot:spring-boot-starter-data-mongodb")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.springframework.boot:spring-boot-starter-security")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
testImplementation("org.assertj:assertj-core")
testImplementation("org.springframework.boot:spring-boot-starter-test") {
exclude(group = "org.junit.vintage", module = "junit-vintage-engine")
}
testImplementation("org.springframework.amqp:spring-rabbit-test")
testImplementation("org.springframework.security:spring-security-test")
testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin")
testImplementation("io.kotlintest:kotlintest-runner-junit5")
testImplementation("io.kotlintest:kotlintest-extensions-spring")
testImplementation("io.kotlintest:kotlintest-assertions")
}
val jacocoTask = tasks.withType<JacocoReport> {
reports {
xml.isEnabled = true
}
}
tasks.withType<Test> {
doFirst {
environment("SPRING_DATA_MONGODB_PORT", "${project.mongo.port}")
}
this.extra.set("runWithMongoDb", true)
useJUnitPlatform()
finalizedBy(jacocoTask)
}
mongo {
setPort("RANDOM")
}
val compileKotlin: KotlinCompile by tasks
compileKotlin.kotlinOptions {
freeCompilerArgs = listOf("-XXLanguage:+InlineClasses")
}
Any hint on what I might be doing wrong?
One of our very simple tests:
#SpringBootTest
#ExperimentalUnsignedTypes
class HardwareServiceApplicationSpec : FunSpec() {
override fun listeners(): List<TestListener> {
return listOf(SpringListener)
}
#Autowired
private lateinit var rmqMessageReceiver: RmqMessageReceiver
init {
test("the messageReceiver bean is created on application startup") {
assertThat(rmqMessageReceiver).isNotNull()
}
}
}
The log output of the test also doesn't help me a lot:
> Task :test
file or directory 'C:\Users\Pia Gerhofer\Projects\hw-service-v2\build\classes\java\test', not found
Excluding []
Caching disabled for task ':test' because:
Build cache is disabled
Task ':test' is not up-to-date because:
Task.upToDateWhen is false.
Extracting Mongo binaries...
Starting Mongod 4.0.2 on port 55319...
start de.flapdoodle.embed.mongo.config.MongodConfigBuilder$ImmutableMongodConfig#7f4e7fe1
Mongod started.
file or directory 'C:\Users\Pia Gerhofer\Projects\hw-service-v2\build\classes\java\test', not found
Starting process 'Gradle Test Executor 3'. Working directory: C:\Users\Pia Gerhofer\Projects\hw-service-v2 Command: C:\Program Files\Java\jdk-11.0.5\bin\java.exe -Dorg.gradle.native=false -javaagent:build/tmp/expandedArchives/org.jacoco.agent-0.8.5.jar_6a2df60c47de373ea127d14406367999/jacocoagent.jar=destfile=build/jacoco/test.exec,append=true,inclnolocationclasses=false,dumponexit=true,output=file,jmx=false #C:\Users\Pia Gerhofer\AppData\Local\Temp\gradle-worker-classpath2455123809837509056txt -Xmx512m -Dfile.encoding=windows-1252 -Duser.country=AT -Duser.language=de -Duser.variant -ea worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle Test Executor 3'
Successfully started process 'Gradle Test Executor 3'
Gradle Test Executor 3 started executing tests.
> Task :test
~~~ Project Configuration ~~~
Gradle Test Executor 3 STANDARD_OUT
~~~ Project Configuration ~~~
-> Parallelism: 1 thread
-> Parallelism: 1 thread
-> Test order: LexicographicSpecExecutionOrder
-> Test order: LexicographicSpecExecutionOrder
-> Soft assertations: False
-> Soft assertations: False
-> Write spec failure file: False
-> Write spec failure file: False
-> Fail on ignored tests: False
-> Fail on ignored tests: False
-> Extensions
-> Extensions
- io.kotlintest.extensions.SystemPropertyTagExtension
- io.kotlintest.extensions.SystemPropertyTagExtension
- io.kotlintest.extensions.RuntimeTagExtension
- io.kotlintest.extensions.RuntimeTagExtension
Gradle Test Executor 3 finished executing tests.
> Task :test FAILED
So I see no exception or any other problem in the logs even though I get the following:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':test'.
> No tests found for given includes: [com.tractive.hwservice.HardwareServiceApplicationSpec](filter.includeTestsMatching)
Any help is appreciated, I already tried various gradle versions, no combination worked so far. A colleague told me I might have to use a different test runner but I can't find anything concerning that in the upgrade guide/documentation.
Interestingly enough I upgraded another of our services to the latest spring boot version, which uses gradle wrapper 6.4 and the tests work as expected there.
Finally got it to work with any of the Gradle versions, tried it with (5.6.x, 6.3, 6.4, 6.5 and 6.6).
The thing we were missing is updating the kotlin plugin.spring version. After we updated that to 1.3.72 instead of 1.3.50 everything was working as expected.

Issue getting Gradle apt plugin to work with QueryDSL, lombok & mapstruct

I am trying to get gradle apt plugin to work with:
QueryDSL
Mapstruct
Lombok
Here is what I have attempted:
plugins {
id 'net.ltgt.apt' version '0.10'
}
description = "Bignibou Common"
apply plugin: 'org.springframework.boot'
dependencyManagement {
dependencies {
dependency "org.elasticsearch:elasticsearch:${elasticsearchVersion}"
}
}
dependencies {
compile("org.springframework.boot:spring-boot-starter-data-jpa") {
exclude group: 'org.apache.tomcat', module: 'tomcat-jdbc'
}
compile("org.springframework.boot:spring-boot-starter-mail")
compile('org.springframework.security:spring-security-core')
compile('org.hibernate:hibernate-validator')
compile("org.hibernate:hibernate-java8")
compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310")
//Spring cloud
compile("org.springframework.cloud:spring-cloud-spring-service-connector")
compile("org.springframework.cloud:spring-cloud-localconfig-connector")
compile("org.springframework.cloud:spring-cloud-cloudfoundry-connector")
// Relational Database
compile("org.postgresql:postgresql:${postgresqlVersion}")
compile("org.flywaydb:flyway-core")
// Connection pooling
compile("com.zaxxer:HikariCP")
//Shield
compile("org.elasticsearch.client:x-pack-transport:${elasticsearchVersion}")
compile("org.elasticsearch:elasticsearch:${elasticsearchVersion}")
compile("org.apache.logging.log4j:log4j-api")
compile("org.apache.logging.log4j:log4j-core")
// QueryDSL
compile("com.querydsl:querydsl-core:${queryDslVersion}")
compile("com.querydsl:querydsl-jpa:${queryDslVersion}")
compileOnly('org.projectlombok:lombok')
compileOnly('org.mapstruct:mapstruct-jdk8:1.2.0.Beta3')
apt "com.querydsl:querydsl-apt:${queryDslVersion}", 'org.mapstruct:mapstruct-processor:1.2.0.Beta3', 'org.projectlombok:lombok'
// Jackson
compile("com.fasterxml.jackson.core:jackson-core")
compile("com.fasterxml.jackson.core:jackson-annotations")
compile("org.apache.httpcomponents:httpclient:${httpClientVersion}")
compile("org.jasypt:jasypt:${jasyptVersion}")
}
sourceSets {
main {
output.dir("build/generated-mail-templates")
}
}
bootRepackage {
enabled = false
}
task npmInstall(type: Exec) {
description "npm install"
commandLine 'npm', 'install'
}
task processMailTemplates {
description "Processes mail templates"
dependsOn npmInstall
outputs.upToDateWhen { false }
doLast {
def templateSrcDir = "src/main/templates/mail/"
def templateDestDir = "build/generated-mail-templates/META-INF/templates/mail/"
mkdir templateDestDir
def templateNames = []
fileTree(dir: templateSrcDir, include: '**/*.html').visit {
FileVisitDetails details -> templateNames << details.file.name
}
templateNames.each { templateName -> inlineCss(templateSrcDir + templateName, templateDestDir + templateName) }
}
}
static def inlineCss(src, dest) {
def juice = 'node_modules/.bin/juice'
def juiceResourcesDir = 'src/main/templates/misc/'
def juiceArgs = "--options-file ${juiceResourcesDir}juiceOptions.json --css ${juiceResourcesDir}mailStyle.css"
"${juice} ${juiceArgs} ${src} ${dest}".execute(null, new File('bignibou-common'))
}
compileJava {
aptOptions.processors = ['com.querydsl.apt.jpa.JPAAnnotationProcessor']
}
processResources.dependsOn processMailTemplates
Here is the error I get:
> Task :bignibou-common:compileJava
Putting task artifact state for task ':bignibou-common:compileJava' into context took 0.001 secs.
Resolving dependency management for configuration 'apt' of project 'bignibou-common'
Resolving global dependency management for project 'bignibou-common'
Excluding []
Resolving dependency management for configuration 'compileClasspath' of project 'bignibou-common'
Resolving dependency management for configuration 'compileOnly' of project 'bignibou-common'
Resolving dependency management for configuration 'implementation' of project 'bignibou-common'
Resolving dependency management for configuration 'compile' of project 'bignibou-common'
Excluding []
Executing task ':bignibou-common:compileJava' (up-to-date check took 0.628 secs) due to:
Task ':bignibou-common:compileJava' has additional actions that have changed
All input files are considered out-of-date for incremental task ':bignibou-common:compileJava'.
Excluding []
Compiling with JDK Java compiler API.
Note: Running JPAAnnotationProcessor
:bignibou-common:compileJava (Thread[Task worker,5,main]) completed. Took 0.727 secs.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':bignibou-common:compileJava'.
> java.lang.NoClassDefFoundError: javax/persistence/Entity
Indicating that the javaCompile task has somehow lost the compile classpath...
Can someone please help?
edit: Taking into account Thomas Broyer's advice, I was able to come up with the following changes:
compileJava {
aptOptions.processors = ['com.querydsl.apt.jpa.JPAAnnotationProcessor', 'lombok.launch.AnnotationProcessorHider$AnnotationProcessor', 'org.mapstruct.ap.MappingProcessor']
}
compileOnly('org.projectlombok:lombok')
compileOnly('org.mapstruct:mapstruct-jdk8:1.2.0.Beta3')
apt "com.querydsl:querydsl-apt:${queryDslVersion}"
apt "org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final"
apt "org.mapstruct:mapstruct-processor:1.2.0.Beta3"
apt "org.projectlombok:lombok"
Notice the added hibernate-jpa-2.1-api apt dependency and the three explicit processors defined on the aptOptions.
Thanks a lot Thomas!
Apparently, with querydsl-apt, you need to add the additional dependencies required by the specific processor you're using; in this case you need to add the JPA API to the apt configuration.
Also, note that by configuring aptOptions.processors explicitly with only the QueryDSL processor, the Lombok and MapStruct processors won't run.

How to apply javaagent to gretty plugin based on gradle command line?

The question is specific, but it's more of a general 'how to do this in gradle' question.
I have a demo java web app that I can run using the gretty plugin. I would like to selectively control whether a javaagent is applied to the jvmArgs of the gretty process based on a command line flag. The agent jar location is known by getting its path from a dummy configuration:
configurations {
agent
}
dependencies {
...
agent group: 'com.foo', name: 'foo-agent', version: '1.0'
}
I know I can access the jar file location using something like:
project.configurations.agent.find { it.name.startsWith("foo-agent") }
How can I selectively apply that to the gretty jvmArgs configuration based on a command line property such as
gradle -PenableAgent
I ended up solving this by creating a task and simply calling it before I run the war:
task agent {
doFirst {
def agentJar = project.configurations.agent.find { it.name.startsWith("foo-agent") }
gretty.jvmArgs << "-javaagent:" + agentJar
}
}
Then I can simply call:
gradle agent appRunWar
In my project I use Spring Instrument as java agent so this was my solution.
You can make appRun task dependent on agent task then no additional gradle run parameter needed.
dependencies {
...
agent 'org.springframework:spring-instrument:4.2.4.RELEASE'
}
configurations {
dev
agent
}
gretty {
...
contextPath = '/'
jvmArgs=[]
springBoot = true
...
}
task agent {
doFirst {
def agentJar = project.configurations.agent.find{it.name.contains("spring-instrument") }
gretty.jvmArgs << "-javaagent:" + agentJar
}
}
project.afterEvaluate {
tasks.appRun.dependsOn agent
}

How to run JBoss TattleTale from inside Gradle build

I am in love with JBoss TattleTale. Typically, in my Ant builds, I follow the docs to define the Tattletale tasks and then run them like so:
<taskdef name="report"
classname="org.jboss.tattletale.ant.ReportTask"
classpathref="tattletale.lib.path.id"/>
...
<tattletale:report source="${src.dir]" destination="${dest.dir}"/>
I am now converting my builds over to Gradle and am struggling to figure out how to get Tattletale running in Gradle. There doesn't appear to be a Gradle-Tattletale plugin, and I'm not experienced enough with Gradle to contribute one. But I also know that Gradle can run any Ant plugin and can also executing stuff from the system shell; I'm just not sure how to do this in Gradle because there aren't any docs on this (yet).
So I ask: How do I run the Tattletale ReportTask from inside a Gradle build?
Update
Here is what the Gradle/Ant docs show as an example:
task loadfile << {
def files = file('../antLoadfileResources').listFiles().sort()
files.each { File file ->
if (file.isFile()) {
ant.loadfile(srcFile: file, property: file.name)
println " *** $file.name ***"
println "${ant.properties[file.name]}"
}
}
}
However, no where in here do I see how/where to customize this for Tattletale and its ReportTask.
The following is adapted from https://github.com/roguePanda/tycho-gen/blob/master/build.gradle
It bypasses ant and directly invokes the Tattletale Java class.
It was changed to process a WAR, and mandates a newer javassist in order to handle Java 8 features such as lambdas.
configurations {
tattletale
}
configurations.tattletale {
resolutionStrategy {
force 'org.javassist:javassist:3.20.0-GA'
}
}
dependencies {
// other dependencies here...
tattletale "org.jboss.tattletale:tattletale:1.2.0.Beta2"
}
task createTattletaleProperties {
ext.props = [reports:"*", enableDot:"true"]
ext.destFile = new File(buildDir, "tattletale.properties")
inputs.properties props
outputs.file destFile
doLast {
def properties = new Properties()
properties.putAll(props)
destFile.withOutputStream { os ->
properties.store(os, null)
}
}
}
task tattletale(type: JavaExec, dependsOn: [createTattletaleProperties, war]) {
ext.outputDir = new File(buildDir, "reports/tattletale")
outputs.dir outputDir
inputs.files configurations.runtime.files
inputs.file war.archivePath
doFirst {
outputDir.mkdirs()
}
main = "org.jboss.tattletale.Main"
classpath = configurations.tattletale
systemProperties "jboss-tattletale.properties": createTattletaleProperties.destFile
args([configurations.runtime.files, war.archivePath].flatten().join("#"))
args outputDir
}
The previous answers either are incomplete or excessively complicated. What I did was use the ant task from gradle which works fine. Let's assume your tattletale jars are beneath rootDir/tools/...
ant.taskdef(name: "tattleTaleTask", classname: "org.jboss.tattletale.ant.ReportTask", classpath: "${rootDir}/tools/tattletale-1.1.2.Final/tattletale-ant.jar:${rootDir}/tools/tattletale-1.1.2.Final/tattletale.jar:${rootDir}/tools/tattletale-1.1.2.Final/javassist.jar")
sources = "./src:./src2:./etcetera"
ant.tattleTaleTask(
source: sources,
destination: "tattleTaleReport",
classloader: "org.jboss.tattletale.reporting.classloader.NoopClassLoaderStructure",
profiles: "java5, java6",
reports: "*",
excludes: "notthisjar.jar,notthisjareither.jar,etcetera.jar"
){
}
So the above code will generate the report beneath ./tattleTaleReport. It's that simple. The annoyance is that the source variable only accepts directories so if there are jars present in those directories you do not wish to scan you need to add them to the excludes parameter.

Resources