Last updatedMay 8, 2019

Confluence Data Center Plugin Validator

Confluence Data Center provides high availability and performance at scale for large Confluence installations. Running Confluence in a cluster places constraints on how apps can be developed.

Before you begin, head to Developing apps for Atlassian Data Center products for an overview of the requirements you'll need to meet to get your app approved for Data Center.

The Confluence Data Center Plugin Validator tool will attempt to verify that the apps installed into an existing Confluence installation do not contain any known issues which will prevent them from running under Confluence Data Center. This initial version of the tool finds where plugins are attempting to store non Serializable data into an Atlassian Cache. 

The tool has been developed using FindBugs with a custom detector. The tool is a standalone JAR file that, on execution will:

  1. Extract the required files (a FindBugs distribution and Atlassian detector).
  2. Extract the plugin files from the specified Confluence database into the plugins directory.
  3. Run FindBugs on each of the plugins.
  4. Generate a summary report indicating whether each plugin passed or failed.

Please note: This tool is provided as-is without any form of warranty and is not supported by Atlassian Support.

Requirements

Running the tool requires:

  • A Java 6 runtime (or greater).
  • A working Confluence installation.
  • The credentials for the database used by Confluence (this is required to extract out the installed Plugins).

The tool currently supports the following databases systems:

  • PostgreSQL
  • Oracle
  • MySQL

Download

The tool is available for download cdc-plugin-validator-1.0.0.jar.

The tool bundles a copy of FindBugs, which is licensed under Lesser GNU Public License. More details are available at http://findbugs.sourceforge.net/manual/license.html.

Usage

The tool requires the following arguments when run:

ArgumentPurpose
-dbdriverSpecify the JDBC driver class
-dbfileSpecify the JAR file containing the JDBC driver
-dbpasswordSpecify the database password
-dburlSpecify the JDBC URL for the database
-dbuserSpecify the database userid
-installationSpecify the Confluence installation directory

An example invocation is:

1
2
3
4
5
6
prompt% java -jar cdc-plugin-validator-1.0.0.jar \
     -installation /usr/local/atlassian-confluence-5.5.2 \
     -dbuser confuser -dbpassword confuser \
     -dburl jdbc:postgresql://localhost:5432/confluence \
     -dbdriver org.postgresql.Driver \
     -dbfile /usr/local/atlassian-confluence-5.5.2/confluence/WEB-INF/lib/postgresql-9.2-1002.jdbc4.jar

Output

Running the tool generates a lot of output. 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
    [unzip] Expanding: /Users/oburn/work/cdc-tool-test/findbugs-2.0.3.zip into /Users/oburn/work/cdc-tool-test
   [delete] Deleting: /Users/oburn/work/cdc-tool-test/findbugs-2.0.3.zip
Exporting com.atlassian.analytics.analytics-client
    to ./plugins/com.atlassian.analytics.analytics-client--analytics-client-3.24.jar
fall back
Exporting com.atlassian.analytics.analytics-whitelist
    to ./plugins/com.atlassian.analytics.analytics-whitelist--analytics-whitelist-3.24.jar
fall back
Exporting com.atlassian.confluence.plugins.confluence-questions
    to ./plugins/com.atlassian.confluence.plugins.confluence-questions--confluence-questions-1.0.645.jar
fall back
Validating: ./plugins/com.atlassian.analytics.analytics-client--analytics-client-3.24.jar
 [findbugs] Executing findbugs FindBugsTask from ant task
 [findbugs] Running FindBugs...
 [findbugs] Missing classes: 24
 [findbugs] Calculating exit code...
 [findbugs] Setting 'missing class' flag (2)
 [findbugs] Exit code set to: 2
 [findbugs] Java Result: 2
 [findbugs] Classes needed for analysis were missing
 [findbugs] Output saved to /Users/oburn/work/cdc-tool-test/./plugins/com.atlassian.analytics.analytics-client--analytics-client-3.24.jar.report
Validating: ./plugins/com.atlassian.analytics.analytics-whitelist--analytics-whitelist-3.24.jar
 [findbugs] Executing findbugs FindBugsTask from ant task
 [findbugs] Running FindBugs...
 [findbugs] java.io.IOException: No files to analyze could be opened
 [findbugs]     at edu.umd.cs.findbugs.FindBugs2.execute(FindBugs2.java:275)
 [findbugs]     at edu.umd.cs.findbugs.FindBugs.runMain(FindBugs.java:393)
 [findbugs]     at edu.umd.cs.findbugs.FindBugs2.main(FindBugs2.java:1317)
 [findbugs] Java Result: 4
Validating: ./plugins/com.atlassian.confluence.plugins.confluence-jira-metadata--confluence-jira-metadata-1.7.3.jar
 [findbugs] Executing findbugs FindBugsTask from ant task
 [findbugs] Running FindBugs...
 [findbugs] Warnings generated: 2
 [findbugs] Missing classes: 6
 [findbugs] Calculating exit code...
 [findbugs] Setting 'missing class' flag (2)
 [findbugs] Setting 'bugs found' flag (1)
 [findbugs] Exit code set to: 3
 [findbugs] Java Result: 3
 [findbugs] Classes needed for analysis were missing
 [findbugs] Output saved to /Users/oburn/work/cdc-tool-test/./plugins/com.atlassian.confluence.plugins.confluence-jira-metadata--confluence-jira-metadata-1.7.3.jar.report
Validating: ./plugins/com.atlassian.confluence.plugins.confluence-questions--confluence-questions-1.0.645.jar
 [findbugs] Executing findbugs FindBugsTask from ant task
 [findbugs] Running FindBugs...
 [findbugs] Missing classes: 19
 [findbugs] Calculating exit code...
 [findbugs] Setting 'missing class' flag (2)
 [findbugs] Exit code set to: 2
 [findbugs] Java Result: 2
 [findbugs] Classes needed for analysis were missing
 [findbugs] Output saved to /Users/oburn/work/cdc-tool-test/./plugins/com.atlassian.confluence.plugins.confluence-questions--confluence-questions-1.0.645.jar.report

Summary:
========
PASS: ./plugins/com.atlassian.analytics.analytics-client--analytics-client-3.24.jar.report
PASS: ./plugins/com.atlassian.analytics.analytics-whitelist--analytics-whitelist-3.24.jar.report
FAIL: ./plugins/com.atlassian.confluence.plugins.confluence-jira-metadata--confluence-jira-metadata-1.7.3.jar.report
PASS: ./plugins/com.atlassian.confluence.plugins.confluence-questions--confluence-questions-1.0.645.jar.report

The important part of the output is the last part with the heading "Summary", where each extracted plugin is either flagged as a PASS or FAIL.

For example:

1
2
3
4
5
6
Summary:
========
PASS: ./plugins/com.atlassian.analytics.analytics-client--analytics-client-3.24.jar.report
PASS: ./plugins/com.atlassian.analytics.analytics-whitelist--analytics-whitelist-3.24.jar.report
FAIL: ./plugins/com.atlassian.confluence.plugins.confluence-jira-metadata--confluence-jira-metadata-1.7.3.jar.report
PASS: ./plugins/com.atlassian.confluence.plugins.confluence-questions--confluence-questions-1.0.645.jar.report

In the example above the plugin confluence-jira-metadata-1.7.3.jar is flagged as failing. For more details, look at the contents of the file ./plugins/com.atlassian.confluence.plugins.confluence-jira-metadata--confluence-jira-metadata-1.7.3.jar.report.