JBoss.orgCommunity Documentation

JBoss Tattletale 1.2 User's Guide

Betraying all your project's naughty little secrets


JBoss Tattletale is a tool that can help development teams getting an overview of the project they are working on or a product they depend on.

The tool generates reports that will show dependencies and general information that can help identify areas that needs attention such as minimizing the number of dependencies or eliminate duplicated class files from the class path.

JBoss Tattletale will help to improve the quality of your software project.

JBoss Tattletale can be downloaded in its binary form for easy installation.

The download location is: http://www.jboss.org/tattletale/downloads

Once downloaded extract the files by executing:

unzip jboss-tattletale-1.2.0.Beta1.zip
     

or

tar xzf jboss-tattletale-1.2.0.Beta1.tar.gz
     

depending on which archive type you downloaded.

JBoss Tattletale is now located in a folder under the directory you extracted the files into.

The configuration of JBoss Tattletale is done through its

jboss-tattletale.properties
     

file.

The current configuration parameters includes:

Table 3.1. JBoss Tattletale configuration

KeyValue
reports A comma separated list of which reports that should be generated. The following reports are supported:
  • classdependants

    The "Class Dependants" report.

  • classdependson

    The "ClassDependsOn" report.

  • dependants

    The "Dependants" report.

  • dependson

    The "DependsOn" report.

  • graphviz

    The "Graphical dependencies" report.

  • transitivedependants

    The "Transitive Dependants" report.

  • transitivedependson

    The "Transitive DependsOn" report.

  • circulardependency

    The "Circular Dependency" report.

  • classlocation

    The "Class Location" report.

  • osgi

    The "OSGi" report.

  • sealed

    The "Sealed Information" report.

  • sign

    The "Signing Information" report.

  • eliminatejars

    The "Eliminate Jar files with different versions" report.

  • invalidversion

    The "Invalid version" report.

  • multiplejars

    The "Multiple Jar files" report.

  • multiplejarspackage

    The "Multiple Jar files (Package)" report.

  • multiplelocations

    The "Multiple Locations" report.

  • unusedjar

    The "Unused Jar" report.

  • blacklisted

    The "Black listed" report.

  • noversion

    The "No version" report.

  • jar

    The "Jar archive" report.

Default: All reports (reports=*)

classloader Specifies which classloader structure that should be used when scanning the archives. Can be one of the following:
  • org.jboss.tattletale.reporting.classloader.NoopClassLoaderStructure

    A no-operation classloader structure implementation that doesn't scope any archives.

  • org.jboss.tattletale.reporting.classloader.JBossAS4ClassLoaderStructure

    A classloader structure implementation that scopes based on JBoss Application Server 4.x directory structures.

  • org.jboss.tattletale.reporting.classloader.JBossAS5ClassLoaderStructure

    A classloader structure implementation that scopes based on JBoss Application Server 5.x directory structures.

  • org.jboss.tattletale.reporting.classloader.JBossAS6ClassLoaderStructure

    A classloader structure implementation that scopes based on JBoss Application Server 6.x directory structures.

profiles Specifies a comma separated list of profiles to resolve against. The following profiles are supported:
  • java5

    The Java 5 API.

  • java6

    The Java 6 API.

  • ee5

    The Java Enterprise Edition 5 API.

  • ee6

    The Java Enterprise Edition 6 API.

  • seam22

    The JBoss Seam 2.2 API.

  • cdi10

    The Contexts and Dependency Injection (CDI) 1.0 API.

  • spring25

    The Spring 2.5 API.

  • spring30

    The Spring 3.0 API.

excludes A comma separated list of directories or files that should be excluded from the scan. F.ex.

**/server/**,myjar.jar

blacklisted A comma separated list of black listed classes or packages. F.ex.

com.mycompany.forinternaluseonly, com.partner.forinternaluseonly

scan A comma separated list of file extensions that should be scanned

Default: .jar

enableDot Should images be generated if the Graphviz DOT application is found

Default: true

graphvizDot The full path to the Graphviz DOT executable. This property is required if you want to generate PNG files and the Graphviz bin directory is not on your path. F.ex.

graphvizDot=C:\\Graphviz2.26.3\\bin\\dot.exe

or

graphvizDot=/opt/graphiz/bin/dot


The load order for the configuration file is

  1. configuration parameter in the Apache Ant / Maven task
  2. -Djboss-tattletale.properties system property
  3. jboss-tattletale.properties file in current directory
  4. jboss-tattletale.properties file in class loader

NOTE: The classloader structure feature is currently based on directory structures and may therefore fail to identify archives that should be included in the reports. If you want to be sure that all archives are included use the NoopClassLoaderStructure plugin.

JBoss Tattletale integrates with Apache Ant such that you can generate the reports directly from your build environment.

First, you need to add tattletale.jar, tattletale-ant.jar and javassist.jar to the Apache Ant classpath.

Second, you need to add the following to your project definition tag:

xmlns:tattletale="antlib:org.jboss.tattletale.ant"
   

That is it.

Alternative, you can do a taskdef for each task

<taskdef name="report"
         classname="org.jboss.tattletale.ant.ReportTask"
         classpathref="tattletale.lib.path.id"/>
   

See the Apache Ant documentation for additional instructions on installation.

Usage:

<tattletale:report source="${src.dir]" destination="${dest.dir}"/>
     

Table 4.1. Apache Ant: report

KeyValue
source The directory that contains the Java archives. Multiple directories can be scanned by separating each with the File.pathSeparator character - f.ex. dir1:dir2 on Un*x.

Default: Current directory

destination The directory where the reports should be generated

Default: Current directory

configuration Path to the configuration file

Default: No value

filter Path to the filter file

Default: No value

reports A comma separated list of which reports that should be generated. All reports can be selected by specifying "*". The following reports are supported:
  • classdependants

    The "Class Dependants" report.

  • classdependson

    The "Class DependsOn" report.

  • dependants

    The "Dependants" report.

  • dependson

    The "DependsOn" report.

  • graphviz

    The "Graphical dependencies" report.

  • transitivedependants

    The "Transitive Dependants" report.

  • transitivedependson

    The "Transitive DependsOn" report.

  • circulardependency

    The "Circular Dependency" report.

  • classlocation

    The "Class Location" report.

  • osgi

    The "OSGi" report.

  • sealed

    The "Sealed Information" report.

  • sign

    The "Signing Information" report.

  • eliminatejars

    The "Eliminate Jar files with different versions" report.

  • invalidversion

    The "Invalid version" report.

  • multiplejars

    The "Multiple Jar files" report.

  • multiplejarspackage

    The "Multiple Jar files (Package)" report.

  • multiplelocations

    The "Multiple Locations" report.

  • unusedjar

    The "Unused Jar" report.

  • blacklisted

    The "Black listed" report.

  • noversion

    The "No version" report.

  • jar

    The "Jar archive" report.

Default: All reports

classloader Specifies which classloader structure that should be used when scanning the archives. Can be one of the following:
  • org.jboss.tattletale.reporting.classloader.NoopClassLoaderStructure

    A no-operation classloader structure implementation that doesn't scope any archives.

  • org.jboss.tattletale.reporting.classloader.JBossAS4ClassLoaderStructure

    A classloader structure implementation that scopes based on JBoss Application Server 4.x directory structures.

  • org.jboss.tattletale.reporting.classloader.JBossAS5ClassLoaderStructure

    A classloader structure implementation that scopes based on JBoss Application Server 5.x directory structures.

  • org.jboss.tattletale.reporting.classloader.JBossAS6ClassLoaderStructure

    A classloader structure implementation that scopes based on JBoss Application Server 6.x directory structures.

Default: org.jboss.tattletale.reporting.classloader.NoopClassLoaderStructure

profiles Specifies a comma separated list of profiles to resolve against. All profiles can be selected by specifying "*". The following profiles are supported:
  • java5

    The Java 5 API.

  • java6

    The Java 6 API.

  • ee5

    The Java Enterprise Edition 5 API.

  • ee6

    The Java Enterprise Edition 6 API.

  • seam22

    The JBoss Seam 2.2 API.

  • cdi10

    The Contexts and Dependency Injection (CDI) 1.0 API.

  • spring25

    The Spring 2.5 API.

  • spring30

    The Spring 3.0 API.

Default: java5, java6

excludes A comma separated list of directories or files that should be excluded from the scan. F.ex.

**/server/**,myjar.jar

Default: Empty list

blacklisted A comma separated list of black listed classes or packages. F.ex. com.mycompany.forinternaluseonly, com.partner.forinternaluseonly

Default: Empty list

failOnInfo Fail the build if a failed INFO report is found

Default: false

failOnWarn Fail the build if a failed WARN report is found

Default: false

failOnError Fail the build if a failed ERROR report is found

Default: false

deleteOutputDirectory Should the output directory be deleted

Default: true

scan A comma separated list of file extensions that should be scanned

Default: .jar


Note

Note that defining a property in the task overrides the setting in the configuration file.

JBoss Tattletale integrates with Apache Maven such that you can generate the reports directly from your build environment.

To be able to use the Tattletale Maven plugin in your Maven project, you will have to add the following plugin declaration in the pom.xml of your project:

       
<build>
  <plugins>
    <plugin>
      <groupId>org.jboss.tattletale</groupId>
      <artifactId>tattletale-maven</artifactId>
      <!-- The version of the plugin you want to use -->
      <version>1.1.0.Final</version>
      <executions>
 	<execution>
 	  <goals>
 	    <goal>report</goal>
 	  </goals>
 	</execution>
      </executions>
      <configuration>
 	<!-- This is the location which will be scanned for generating tattletale reports
 	  --> 
 	<source>/absolutepath/to/source/dir</source>
 	<!-- This is where the reports will be generated -->
 	<destination>/absolute/path/to/reports/dir</destination>
      </configuration>
    </plugin>
  </plugins>
</build>     	
        
     

Note

By default, the tattletale-maven plugin is attached to the "package" phase of Maven.

Usage:

Once you have configured your project's pom.xml to include the tattletale-maven plugin, as explained earlier, you can generate the report by running the package goal on your project
mvn clean package
     

Table 5.1. Apache Maven: report

KeyValue
source The directory that contains the Java archives. Multiple directories can be scanned by separating each with the File.pathSeparator character - f.ex. dir1:dir2 on Un*x.

Default: Current directory

destination The directory where the reports should be generated

Default: Current directory

configuration Path to the configuration file

Default: No value

filter Path to the filter file

Default: No value

reports Contains nested report elements of which reports that should be generated. All reports can be selected by specifying "*". The following reports are supported:
  • classdependants

    The "Class Dependants" report.

  • classdependson

    The "Class DependsOn" report.

  • dependants

    The "Dependants" report.

  • dependson

    The "DependsOn" report.

  • graphviz

    The "Graphical dependencies" report.

  • transitivedependants

    The "Transitive Dependants" report.

  • transitivedependson

    The "Transitive DependsOn" report.

  • circulardependency

    The "Circular Dependency" report.

  • classlocation

    The "Class Location" report.

  • osgi

    The "OSGi" report.

  • sealed

    The "Sealed Information" report.

  • sign

    The "Signing Information" report.

  • eliminatejars

    The "Eliminate Jar files with different versions" report.

  • invalidversion

    The "Invalid version" report.

  • multiplejars

    The "Multiple Jar files" report.

  • multiplejarspackage

    The "Multiple Jar files (Package)" report.

  • multiplelocations

    The "Multiple Locations" report.

  • unusedjar

    The "Unused Jar" report.

  • blacklisted

    The "Black listed" report.

  • noversion

    The "No version" report.

  • jar

    The "Jar archive" report.

Default: All reports

classloader Specifies which classloader structure that should be used when scanning the archives. Can be one of the following:
  • org.jboss.tattletale.reporting.classloader.NoopClassLoaderStructure

    A no-operation classloader structure implementation that doesn't scope any archives.

  • org.jboss.tattletale.reporting.classloader.JBossAS4ClassLoaderStructure

    A classloader structure implementation that scopes based on JBoss Application Server 4.x directory structures.

  • org.jboss.tattletale.reporting.classloader.JBossAS5ClassLoaderStructure

    A classloader structure implementation that scopes based on JBoss Application Server 5.x directory structures.

  • org.jboss.tattletale.reporting.classloader.JBossAS6ClassLoaderStructure

    A classloader structure implementation that scopes based on JBoss Application Server 6.x directory structures.

Default: org.jboss.tattletale.reporting.classloader.NoopClassLoaderStructure

profiles Contains nested profile elements of profiles to resolve against. All profiles can be selected by specifying "*". The following profiles are supported:
  • java5

    The Java 5 API.

  • java6

    The Java 6 API.

  • ee5

    The Java Enterprise Edition 5 API.

  • ee6

    The Java Enterprise Edition 6 API.

  • seam22

    The JBoss Seam 2.2 API.

  • cdi10

    The Contexts and Dependency Injection (CDI) 1.0 API.

  • spring25

    The Spring 2.5 API.

  • spring30

    The Spring 3.0 API.

Default: <report>java5</report><report>java6</report>

excludes Contains nested exclude elements of directories or files that should be excluded from the scan. F.ex.

<exclude>**/server/**</exclude><exclude>myjar.jar</exclude>

Default: Empty list

blacklisted Contains nested blacklist elements of black listed classes or packages. F.ex. <blacklist>com.mycompany.forinternaluseonly</blacklist> <blacklist>com.partner.forinternaluseonly</blacklist>

Default: Empty list

failOnInfo Fail the build if a failed INFO report is found

Default: false

failOnWarn Fail the build if a failed WARN report is found

Default: false

failOnError Fail the build if a failed ERROR report is found

Default: false

deleteOutputDirectory Should the output directory be deleted

Default: true

scan A comma separated list of file extensions that should be scanned

Default: .jar


Note

Note that defining a property in the task overrides the setting in the configuration file.

So you have found an area where you are missing a feature and would like to submit a patch for it, great !

There are a couple of steps to get a feature included

First, you should create a new thread in our development forum where you describe the feature, its design and implementation.

Once there is an agreement on the feature and the design you should proceed with creating the patch.

To maximize your chances of getting the feature in the official build as soon as possible make sure that you run checkstyle to make sure that the code is correctly formatted:

ant clean checkstyle
      

when there are no errors, create a JIRA task (Feature) in our JIRA environment and attach the patch. See the developer guide for additional details.

Happy Coding !