Confluence 2.6 のサポートは終了しています。
ドキュメントの最新バージョンを確認してください。
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
)
Configure settings.xml
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.
You will need to update the <properties>
section to match where you installed Tomcat and/or Resin.
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.
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. Comment out any application servers which are not relevant for you.
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 clean install -Dmaven.test.skip
Where $CONFSRC
is the root directory of the expanded confluence source release.
Since some of our tests contain information (such as license keys) that aren't distributed as part of the source release, its recommended to not run the tests during the build. If you omit the -Dmaven.test.skip
argument, the build will fail and the project files will not be created.
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.
If you receive an OutOfMemoryError during the build you may want to set the MAVEN_OPTS environment variable to include -Xmx512m
. This will set the available memory to 512m for the maven process and should be enough to complete the build.
Building a new Standalone
エラー
There is currently an issue (CONF-10138) that is affecting the building of a standalone distribution using this method.
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.
<standalone.tomcat.zip.location>/path/to/zip/</standalone.tomcat.zip.location> <standalone.confluence.tomcat.version>5.5.23</standalone.confluence.tomcat.version>
- Then run this command in the root of the confluence source.
This will create a
> cd $CONFSRC/confluence > mvn package -Pstandalone -Dmaven.test.skip
confluence-VERSION-std.tar.gz
andconfluence-VERSION-std.zip
inconfluence/conf-standalone/release
relative to your confluence source root.
Create the IDEA project files
Open a command prompt and enter the following:
> cd $CONFSRC/confluence > mvn idea:idea
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.
You have two options for this step, one involved modified the properties file, other other involves defining the parameter within the Idea run details.
- 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.
If you do not wish to modify the source code, you can pass a command line argument to your run configuration to define this property. Simply add -Dconfluence.home=/path/to/confluence
to the {{VM Arguments section}
Compiling and running 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.
- From the drop-down beside the button, select your app server (eg. 'Tomcat').
- Click the button next to the app server drop-down.
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.
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.