Software developers can customise Confluence extensively by modifying the source code. Follow the instructions to build Confluence from source using IntelliJ IDEA.
Setup Development Environment
Complete the Initial Development Environment Setup to setup your environment.
Download Confluence Source Code
Access to the Confluence source code is provided to all commercial license holders. If you don't have a commercial licence but believe you have a valid reason to need the source, you can request access.
If you have source-code access:
- Download the desired version of Confluence.
- Expand the archive to your desired location (we'll call it
$CONFSRC)
The settings.xml file is the file that stores the configurations that are relevant to Maven 2. This should be under your $HOME/.m2/ directory (which is located at C:\Documents and Settings[your username]\.m2 on a Windows environment). Dependencies are, by default, downloaded in $HOME/.m2/repository.
You can see an example settings.xml.
If you don't have any existing file, create a new file called settings.xml and paste the example code into it. If you have already a settings.xml then just add the extra information.
Install Confluence into the local Maven2 repository
Because of Maven2's dependencies you have to install Confluence into the local repository to get rid of any warning messages that pop up with maven commands. So use the following command:
> cd $CONFSRC/confluence
> mvn install -Pcore,bamboo -Dunit-test=false
This will take approximately 10 minutes to run for the first time, as all the dependencies are downloaded from the Internet. Go get a cup of coffee or find a blog to read.
Building a new Standalone
You can build a Confluence standalone distribution from this source release using the 'standalone' maven profile.
- To do this you must download the zip release of Tomcat and the Tomcat JDK 1.4 Compatability Package. Place them in the same directory. Download them from here.
- Add two new properties to the settings.xml file described above.
- Then run this command in the root of the confluence source.
This will create a
confluence-VERSION-std.tar.gz and confluence-VERSION-std.zip in confluence/conf-standalone/release relative to your confluence source root.
Create the IDEA project files
Open a command prompt and enter the following:
That's it! Now just open up the freshly-generated 'confluence-project.ipr' file in IDEA. It should look something like this:
Setup Confluence Environment
Once the project is loaded, you will need to set up where the 'confluence home' is.
- Open
src/etc/java/confluence-init.properties
- Set the
'confluence.home' property to the location you want confluence data stored. An example might be $CONFSRC/confluence/home, or somewhere in your home directory. If the location doesn't exist, Confluence will try to create it when you run the webapp.
Hopefully your project will now run and you will be able to access Confluence through your web browser.
What's Next?
Now that we've got Confluence running, we can start working on plugins.