This page last changed on Mar 18, 2007 by sleberrigaud.
Getting the source code
Firstly, you will probably only have access to the source code if you have a commercial license. If you don't, but feel you should, contact Atlassian and see what you can work out.
Assuming the above, do the following:
- Download the desired version of Confluence.
- Expand the archive to your desired location (we'll call it $CONFSRC)
Pre Confluence 2.3 - Use Maven 1 and follow these steps
- Open the 'confluence' subdirectory under it.
- Open the contained build.properties file in a text editor and adjust it to meet your environment settings. In particular, pay attention to the following:
- JDK Version - This should be set to whatever your target JDK is called in IDEA. On Mac OS X, this is usually '1.4' or '1.5' (without quotes). Eg:
- Source code location - The location of extra source code. For some reason this is set incorrectly in the default source release. Set it to this:
- Application Server Settings - Uncomment these and point to your app server installation. Only uncomment the ones you actually have installed. Eg:
- Application Settings - The settings in which your application server will launch confluence. The settings below will allow you to access the running server at http://localhost:8080/confluence:
- WAR Settings - These should already be set for you in later versions, but it's good to check them. Eg:
- Database Settings - If you are using an external database, set this up as documentation dictates.
Post Confluence 2.3 - Use Maven 2 and follow these steps
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.
If you don't have any existing file, create a new file called settings.xml and paste the following code into it. If you have already a settings.xml then just add the extra information.
Configure your web application server. For example to configure Resin uncomment the atlassian.idea.resin.location variable and set its value to the path of your Resin installation. You can do the same with the Tomcat and Orion parameters to use different application servers.
Note The "..." are placeholders. In case you have an already existing settings.xml in your Maven2 home directory, you want to fill in the existing properties here. Otherwise simply delete the dots.
<settings>
<pluginGroups>
<pluginGroup>com.atlassian.confluence.maven.plugins</pluginGroup>
<pluginGroup>com.atlassian.maven.plugins</pluginGroup>
</pluginGroups>
<mirrors>
<mirror>
<id>ibiblio.net</id>
<url>http://www.ibiblio.net/pub/packages/maven2</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
<profiles>
<profile>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
...
<repositories>
<repository>
<id>atlassian-m2-repository</id>
<name>Atlassian Maven 2.x Repository</name>
<url>http://repository.atlassian.com/maven2</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>interval:30</updatePolicy>
</snapshots>
</repository>
<repository>
<id>atlassian-m1-repository</id>
<name>Atlassian Maven 1.x Repository</name>
<url>http://repository.atlassian.com</url>
<layout>legacy</layout>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>Codehaus</id>
<name>Codehaus Repository</name>
<url>http://repository.codehaus.org/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>atlassian-m2-repository</id>
<name>Atlassian Maven 2.x Repository</name>
<url>http://repository.atlassian.com/maven2</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</pluginRepository>
</pluginRepositories>
<properties>
...
C:\resin-2.1.17</atlassian.idea.resin.location>-->
C:\resin-3.0.19\resin-3.0.19</atlassian.idea.resin3.location>-->
C:\apache-tomcat-5.5.17</atlassian.idea.tomcat.location>-->
C:\orion2.0.7\orion</atlassian.idea.orion.location>-->
<atlassian.idea.includeAcceptanceTests>true</atlassian.idea.includeAcceptanceTests>
<atlassian.idea.tomcat_env.jdk.name>1.5</atlassian.idea.tomcat_env.jdk.name>
<atlassian.idea.jdk.name>1.4</atlassian.idea.jdk.name>
...
</properties>
...
</profile>
</profiles>
</settings>
Install Confluence into the local 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:
mvn install -Pcore,bamboo -Dunit-test=false
 | Important
Make sure you run this from your project root, this is one step above where Maven 1 commands were run. All commands in Maven 2 are now run one folder higher. |
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.
Creating the IDEA project files
Pre Confluence 2.3 - Use Maven 1 and follow these steps
Open a command prompt and enter the following:
Post Confluence 2.3 - Use Maven 2 and follow these steps
Open a command prompt and enter the following:
That's it! Now just open up the freshly-generated 'confluence.ipr' file in IDEA. It should look something like this:

Setting up the 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.
Compiling and running/debugging Confluence
Now that it's set up, we should make sure it's all working by getting it to run inside IDEA.
- Click the 'confluence' module and then select 'Build > Make Project' from the menu. Alternately, click the
button.
 | The most common problem here is that the JDK has not been set up correctly. If you have a problem, check the following:
- Right-click on the 'confluence' module in the project window and select 'Module Settings' at the bottom of the popup-window.
- Select the 'Libraries' tab
- Check that a valid JDK has been selected for the module.
- Check the other modules in the project for the same.
|
- From the drop-down beside the
button, select your app server (eg. 'Tomcat').
- Click the
button next to the app server drop-down.
Hopefully your project will now run and you will be able to access Confluence through your web browser.
To debug, basically switch the last step of the above to clicking the button instead of the button.
What's Next?
Now that we've got Confluence running, we can start working on plugins.
If maven fails to download jars, uncomment the line containing 'maven.repo.remote'.

Posted by yeonsh at Mar 23, 2006 03:35
|
I get the following eror:
Attempting to download rome-0.8.jar.
Error retrieving artifact from \[http:WARNING: Failed to download rome-0.8.jar.
The build cannot continue because of the following unsatisfied dependency:
rome-0.8.jar
Is the remote repository location http://www.ibiblio.org/maven still valid?

Posted by chackob at Dec 04, 2006 13:57
|
The ibiblio repository has moved and Maven does not understand the 301 redirect. Please see our developer blog post for a fix.

Posted by christopher.owen@atlassian.com at Dec 05, 2006 00:16
|
unfortunately, I have problems.
1. When I complile confluence project, error is occur in CssServlet.java file.
because, confluence use deprecated method , and not implement all HttpServletRequest's method.
I think that , umm. because I use JDK 1.5.
so I add "getRemotePort(),String getLocalName(),String getLocalAddr(),int getLocalPort()"
and then complile it.
is it OK?
2. I follow this procedure, but I can't deploy "E:\consoc\confluence\target\exploded" to IntelliJ IDEA
If I run confluence web module, http://localhost:8080 indicates tomcat's default directory.
(i don't have complie error. )
Other projects are well done! ...

Posted by chchoi at Jan 03, 2007 01:41
|
Hi Chang Hee,
- Confluence was not written to the specification of Java EE 1.5. Although implementing the methods will solve the compilation problems and possibly get Confluence to run, please take note that Confluence was not tested with Java EE 1.5.
- This document has Confluence setup in Tomcat under the context path of "confluence". Therefore, you'll need to access Confluence using http://localhost:8080/confluence.
Cheers,
David

Posted by dchui at Jan 03, 2007 02:48
|
thanks to you i solved the problem 1
(download JDK 1.4, tomcat 4.x)
Thank you!
Choi Chang Hee
--------------------------------------------------------------------------------------
I solved problem 2, add (copy) all library files to the exploded directory!!
and then re-compile , make moulde , restart tomcat server !
[for users suffer from same problem]

Posted by chchoi at Jan 03, 2007 19:14
|
Hi Chang Hee,
I'm glad to be of help. Thank you for sharing how you solved problem 2 with us.

Posted by dchui at Jan 05, 2007 01:06
|
Is there a Maven 2 plugin for atlassian-idea?
Can this be updated to provide Maven 2 details?

Posted by dhardiker@adaptavist.com at Jan 13, 2007 07:06
|
Is there a Maven 2 plugin for atlassian-idea?
Yes there is a Maven 2 Atlassian-idea plugin
Can this be updated to provide Maven 2 details?
Done! 

Posted by michael@atlassian.com at Jan 16, 2007 18:38
|
Hate to break it to you, but the Maven 2 instructions do not work with the source distribution. There seems to be some significant differences between how internal Atlassian people have their source directory structured and what is given to us in the source distribution.
For example, running the 'mvn' commands above in the directory you specify - the parent of the 'confluence' directory, does not work, due to there being no pom.xml present in that directory.

Posted by david@randombits.org at Jan 16, 2007 18:47
|
This is what we get for having a "confluence" directory in confluence!
The root directory you check out of the repository should have a pom.xml in it. When we say the "parent of the 'confluence' directory", we mean that root directory, which you may well have called confluence. That's what I call it. Unfortunately it leads to confusion because that main directory contains another directory called 'confluence'.
In short, run mvn from the top level directory of the confluence project.
The reason we say "the parent of the 'confluence' directory" is that when using maven 1, the maven command was usually run from the confluence subdirectory within the confluence checkout.
Does that clear things up or has it made them even muddier?

Posted by don.willis@atlassian.com at Jan 16, 2007 21:16
|
As a 3rd party developer, I don't believe I can check confluence source code out from the repository. All I have access to are the source code bundles available here:
http://www.atlassian.com/software/confluence/ConfluenceSourceDownloads.jspa
Try downloading one of those and following the above instructions. It doesn't work.

Posted by david@randombits.org at Jan 16, 2007 21:32
|
Hi David,
we appreciate the feedback. Can you be a bit more precise on what does and doesn't work? So that we can help you make it work or fix things that could be broken.
It is actually maybe better if you create an issue on http://support.atlassian.com. We will be happy to help you there.

Posted by sleberrigaud at Jan 21, 2007 19:06
|
I am stuck trying to build the project files.
working on confluence-2.3.2
From $CONFSRC/confluence I am running mvn -Pidea and this is I am getting:
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'atlassian-idea'.
[INFO] ----------------------------------------------------------------------------
[INFO] Building Confluence
[INFO] task-segment: [atlassian-idea:all]
[INFO] ----------------------------------------------------------------------------
[INFO] Preparing atlassian-idea:all
[INFO] snapshot org.apache.maven.plugins:maven-idea-plugin:2.1-atlassian-SNAPSHOT: checking for updates from atlassian-m2-repository
[INFO] No goals needed for project - skipping
[INFO] [atlassian-idea:all]
[INFO] Executing: [mvn idea:idea -Pidea -DjdkName=1.5]
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Can't run goal
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7 seconds
[INFO] Finished at: Thu Mar 15 11:10:53 PDT 2007
[INFO] Final Memory: 5M/10M
[INFO] ------------------------------------------------------------------------
Any ideas?

Posted by rodogu at Mar 15, 2007 13:14
|
|