Confluence 4.0 has reached end of life
Check out the [latest version] of the documentation
The content on this page relates to platforms which are not supported for Confluence. Consequently, Atlassian can not guarantee providing any support for the steps described on this page. Please be aware that this material is provided for your information only and that you use it at your own risk.
In Confluence, many files are contained inside a JAR file. This page tells you how to customise such a file:
- Extract the contents of the JAR file into a working directory.
- Edit one of the files extracted from the JAR.
- Place the updated file in a location which Confluence will recognise. Files in this location will override the version of the file in the JAR.
Note that, using the instructions below, you do not need to bundle the updated file back into the JAR.
On this page:
About JAR Files
A JAR file is a Java ARchive file. It is similar to a UNIX tar file (or a Windows zip file). To manage a JAR file, you can use the jar
command-line tool which is included with the JDK. The jar
tool takes several files, or an entire directory structure, and compresses them together into a single file. This saves a little space, and makes it much easier to manage that group of files as a single unit. The terms 'file' and 'archive' can be used interchangeably in this context, as they refer to the same collection of bytes.
Customising a File Contained within a Confluence JAR File
These instructions assume that you already know which JAR file contains the file you need to edit.
To customise a file contained with a JAR:
- Shut down Confluence.
- Create a new working directory, for example
/tmp/confluence-working
. - Change directory (
cd
) to your working directory. Extract the contents of the JAR:
jar xf </path/to/file.jar>
For example, to edit the main Confluence JAR file for Confluence 3.5:jar xf $CONFLUENCE/confluence/WEB-INF/lib/confluence-3.5.jar
- You now have a directory structure, or at least a set of files, which is the contents of the JAR archive.
- Find the file that you need to update, edit the file and save it.
- Examine the structure of files and folders in your working directory, created when you extracted the content of the JAR.
- Files in the root level of your structure can be recognised by Confluence if you put them in the
/WEB-INF/classes/
folder. For example, if you modify theschedulingSubsystemContext.xml
file, you can place it in<confluence install>/confluence/WEB-INF/classes/schedulingSubsystemContext.xml
. - Files in a subdirectory of your structure need to be placed in a similar subdirectory under
<confluence install>/confluence/WEB-INF/classes/
. For example, if you modify thefonts/verdanaz.xml
file, you must put it in<confluence install>/confluence/WEB-INF/classes/fonts/verdanaz.xml
.
- Files in the root level of your structure can be recognised by Confluence if you put them in the
- Restart Confluence.
Notes
As an alternative to the jar
utility, you can extract the JAR file using an unzipping utility like Winzip, 7-zip, Stuffit or the OS X Archive Extractor.
RELATED TOPICS
Installing Patched Class Files
Where are the files that used to be in my Confluence installation directory?