Dashboard > BobsGear Main Space > Home > Confluence Plugin Development Diary > Confluence Development Environment Setup
Confluence Development Environment Setup
Added by Garnet R. Chaney, last edited by Garnet R. Chaney on May 29, 2007  (view change)
Labels: 


Implementation Resources

Development Systems

Libretto

On machine: jre 1.5.06
Attempt to install JDK for J2SE 1.4.2 http://java.sun.com/j2se/1.4.2/download.html

Application Server: Download and install Tomcat 5.5.23

  • Ran the windows service installed.
    • Port:9090 admin / adminpwd

Database setup: Already done with Sql Server Express.

  • Didn't do this: Making a copy of my current laptop database to [ConfluenceDev]
  • Just start with a fresh database
  • http://confluence.atlassian.com/display/DOC/Database+Setup+for+SQL+Server
    • Get jtds from http://jtds.sourceforge.net/

      The standalone download of Confluence has a common/lib off of the ${confluencehome} directory. But the EAR/WAR version doesn't. So where to put the jtds-<version>.jar in the EAR/WAR version?
      Answer: If you installed the Tomcat 5.5 server, the jtds-<version>.jar goes in the Tomcat installdir/common/lib. Under Windows this might be C:\Program Files\Apache Software Foundation\apache-tomcat-5.5.23\common\lib

Subversion Client: SVN 1.4.3 for windows

IDE Development environment: Atlassian prefers IDEA. So setup IDEA 6.0.5

Get Confluence Running Under Tomcat
  • C:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\Catalina\localhost - create confluence.xml, settng docBase to ${confhome}
          <Context path="/confluence" 
             docBase="C:/projects/confluence-2.4.5.earwar/confluence" 
             debug="0" 
             reloadable="true">
          <Logger className="org.apache.catalina.logger.FileLogger"
             prefix="atlassian-confluence." 
             suffix=".log" 
             timestamp="true"/>
          </Context>
    
  • Go to http://localhost:9090/confluence to start Tomcat 5.5 running Confluence EAR/WAR version
  • Create [ConfluenceWAR] database in sql server, with Confluence user
    • If copying from previous setup, see Confluencedata/confluence.cfg.xml for database username and password
  • Run: http://localhost:9090/confluence - Follow setup screens

tx1000 setup - With Windows Vista

  • Download [NetBeans] IDE + J2SE SDK, powerful IDE J2SE v1.4.2_13 SDK with [NetBeans] 5.0 Bundle
  • Get Maven 1.0 - http://maven.apache.org/download.html
    • Need to set JAVA_HOME to JDK before installing
  • Tomcat 5.5.23 http://www.eng.lsu.edu/mirrors/apache/tomcat/tomcat-5/v5.5.23/apache-tomcat-5.5.23.exe
    • Change service to Automatic - Didn't find a system tray manager for tomcat, like on Windows XP installation
      • When trying to run tomcat5w on Windows Vista, get "Access is denied - Unable to open the service 'tomcat5'
    • A tomcat home page came up at http://127.0.0.1:9090/
  • Create fresh sql server database: Confluence_2_5_1, with Confluence user
  • Create directory \Confl\earwar\2.5.1
  • C:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\Catalina\localhost - create confluence.xml, settng docBase to ${confhome}
          <Context path="/confluence251" 
             docBase="C:/confl/earwar/2.5.1/confluence" 
             debug="0" 
             reloadable="true">
          <Logger className="org.apache.catalina.logger.FileLogger"
             prefix="atlassian-confluence." 
             suffix=".log" 
             timestamp="true"/>
          </Context>
    
  • http://confluence.atlassian.com/display/DOC/Installing+the+Confluence+EAR-WAR+edition
  • Install jdk1.5.0_11 - http://java.sun.com/javase/downloads/index_jdk5.jsp
    • JAVA_HOME was c:\j2sdk1.4.2_13 Now: c:\progra~1\java\jdk1.5.0_11
  • Argued with tomcat for hours, could not get it to server /confluence251. Suspended the machine, then came back the next day, and the localhost/confluence.xml was gone from file explorer! Couldn't see it with dos either! Yet it was still open in an editor, and saving it would still not making it appear! Actually it happened to be open in two editors, and when saved with one editor, the other editor knew the file had been overwritten on disk. But could not see the file with either DOS prompt DIR or with the Windows Vista File Explorer. Very strange. Uninstalling Tomcat, and reinstalling with all options.
    • Reinstall and select JRE: C:\Program Files\Java\jre1.5.0_11
    • Got error "Failed to install Tomcat5 service. Check your settings and permissions. Ignore and continue anywhay (not recommended)?"
    • Reboot so the old service could be removed, then reinstall with full settings
  • Note: The confluence.xml file will cause tomcat to run confluence at http://localhost:9090/confluence regardless of what is configured inside the file for a path. So created a new one c251.xml so http://localhost:9090/c251 - Personal license
  • Reinstall the jtds jar in tomcat / common / lib
  • Run setup - paste personal license - jdbc direct database connection
  • SQL Server Configuration Manager - Need to enable tcp-ip on port 1433
  • Admin: Garnet with standard wiki password.
  • Install the bobsgear plugins:
  • After next reboot, the system tray Tomcat manager failed to control the tomcat service. But the service is running, and Confluence local instance can be activated.
  • Install Subversion Client for plugin checkin: SVN 1.4.3 for windows

Configuring JDK version in build.properties:

I'm new to Idea, and I don't know where to find this in Idea 6.0.5:

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).

I'm using JDK 1.5.0_09, j2re1.4.2_14, jree1.5.0_09, j2sdk1.4.2_14 (which I installed on the get the Java Development Kit). So would I put 1.5, or 1.5.0_09 ? Or maybe I can only do this after I open IDEA go to IDE Settings, then Project Structure, right click JDKs, and add the home directory for j2sdk1.4.2_14, in which case it's name is 1.4? If so, this step of adding this JDK should probably included in the install IDE steps on [Initial development environment setup].

STUCK: The create a confluence IDEA project step seems entirely wrong, their step to build one doesn't work, and there are no .ipr files anywhere.

I've already followed the [initial development environment setup] by installing:

  • Java(TM) 2 SDK, Standard Edition 1.4.2_14
  • Maven 2.0.5
    Application Server: Download and install Tomcat 5.5.23
    • Ran the windows service installed. / Port:9090
      Subversion Client: SVN 1.4.3 for windows
      IDE Development environment: Atlassian prefers IDEA. Installed IDEA 6.0.5
      *Getting the EAR/WAR distribution

For the step

Creating the IDEA project files
Open a command prompt and enter the following:

cd $CONFBASE
maven atlassian-idea

there is no atlassian-idea file in the main directory of the ear/war distribution for 2.4.5. In fact, there is no atlassian-idea anywhere in the zip, and no confluence.ipr anywhere. Also, Maven with 2.0.5 is called mvn. I tried this:

C:\projects\confluence-2.4.5.earwar>mvn atlassian-idea
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Invalid task 'atlassian-idea': you must specify a valid lifecycle phase,
or a goal in the format plugin:goal or pluginGroupId:pluginArtifactId:pluginVers
ion:goal
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Sat Apr 21 23:41:14 PDT 2007
[INFO] Final Memory: 1M/2M
[INFO] ------------------------------------------------------------------------

So how do I make this Confluence.ipr file? BTW, I've logged CSP-8398 on this.

Posted here

Hi Garnet,

The documentation provided above is meant for creating IDEA project using Maven 1. I would suggest you to try building again using Maven 1 and let me know how it goes.

Please ensure that you follow through the given steps and configuration and make sure that the following files within confluence-dist are updated and extracted into '$CONFBASE':

1. build.properties
2. project.properties
3. project.xml

Regards,
Mei

Building Example Plugins

Despite being unable to get the confluence.ipr project made for IDEA, I was able to build at least on plugin from the commandline using ANT.
Survey of Bundled Plugin Functionality...

Other Questions I Asked On Confluence Wiki

Posted here April 21, 2007, 19:13 to an unanswered question from October 5, 2006:

How do I programmatically create pages?

I need to automatically create new pages from within a confluence plugin, what would be the best method to create these pages?

I also would like an answer to this. I've spent a couple of hours looking through the definitions for [Confluence Objects Accessible From Velocity] and I have yet to find any way to create a page from User Macros. I'd like to see an example for user macros that creates a page and makes it a child of the current page.


Which version of Maven to use for plugins (Confluence Plugin Development Kit|http://confluence.atlassian.com/display/DOC/Confluence+Plugin+Development+Kit?focusedCommentId=44269846#comment-44269846]:

Confluence Plugin Development Kit says that Maven 1.0 should be used. But 2.0.6 is the current version of Maven. Will 2.0.6 work?

Posted by Garnet R. Chaney at Apr 21, 2007 19:36 | Edit | Reply To This

The PDK is still on Confluence 2.2, which was built with Maven 1. Confluence 2.3+ uses Maven 2.

My suggestion for Confluence 2.3+ is to use the Atlassian Plugin Archetype with the Plugin Developer Kit for Maven2.

Posted by David Peterson at Apr 21, 2007 19:48 | Reply To This

Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.4.3 Build:#705 Mar 21, 2007) - Bug/feature request - Contact Administrators
Complete Wiki Notation Guide