Skip to end of metadata
Go to start of metadata

How to develop with WTP Tomcat Maven2

A way to build a developpement based on :

  • WTP 0.7.0 (based on Eclipse 3.1.0), free and more light than WSAD 5.1.2 and RAD 6.0 used at the office.
  • Tomcat 5.0.28 : The configuration of this release has been more easy for me with Eclipse and JIRA.
  • Maven 2.0.1 : I know that Atlassian team has not yet made the upgrade to this release, but why not ?

Tools Installation / Configuration

  • Maven 2.0.1 : Standard installation ...
    System Env. Variable M2_HOME set to Maven Root installation
    Default %USERPROFILE%\.m2\settings.xml with <mirrors> and <localRepository> sections updated
  • Tomcat 5.0.28 : Nothing special ... See Install an Appserver
  • Eclipse / WTP :
    • a Classpath variable M2_REPO configured in Preferences settings.
    • Declare the Tomcat Runtime ( Preferences/Server/Installed runtime ), with correct setting :
      • A Runtime Name : i.e Tomcat v5.O Server
      • The Runtime location
      • A JRE

JIRA Distribution in this environment

Integrate JIRA Distribution in Eclipse, I process as follow :

  1. Creation of to "Simple Eclipse Project" :
    • atlassian-jira-enterprise-3.5
    • atlassian-jira-enterprise-3.5-source
  2. Download and Unpack corresponding JIRA distribution files.
  3. Launch the build : build.bat
    Let default configuration based on Tomcat/HSQL

Import Tomcat WAR File as Eclipse Project :

  1. Launch File / Import,
  2. Select WAR File to Import from atlassian-jira-enterprise-3.5\dist-tomcat\atlassian-jira-3.5.war
    • WEB Project Name will be deduced from WAR File Name and should not already exist in Workspace (i.e. atlassian-jira-3_5)
    • Select Tomcat 5.0 Server Runtime with correct location and JRE (Create it if not yet done)
    • Click on Finish to perform Import
    • Correct the Classpath (not correctly generated). You should have
      All classpathentry based on WebContent Directory should be removed
      because all jar are already provided by classpathentry container ...
  3. Copy atlassian-jira-enterprise-3.5\dist-tomcat\tomcat-5\jira.xml to atlassian-jira-3_5\WebContent\META-INF\context.xml

Plugin Developpement :

I made the choice to use a project dedicated to the Build of my plugins.
To do that, the project jira-plugin-kaamelot has the following structure :

  • CODEGEIST:pom.xml file, in \jira-plugin-kaamelot\atlassian-jira-3.5 directory, with package type to "pom", provides JIRA dependencies,
    This pom.xml file has been built manualy from Maven 1 project.xml
    (\atlassian-jira-enterprise-3.5-source\jira\project.xml
  • CODEGEIST:pom.xml file, in \jira-plugin-kaamelot directory, is used to build referenced plugin, and as parent pom.xml for this plugins.

"Install" JIRA Runtime

The JIRA Runtime have to be installed in the Local Repository. To do that :

  1. In command line, cd \jira-plugin-kaamelot\atlassian-jira-3.5
  2. Execute mvn install

Project Plugin Creation

Follow the below steps :

  1. Create the Eclipse Project
  2. Due to Maven 2 standards, your Plugin should apply the following structure :
  3. Update the pom.xml file with above Build Project as parent. i.e. see pom.xml of jira-plugin-kaamelot-addon.
  4. Generate the Eclipse Classpath from pom.xml
    • In command line, cd \jira-plugin-kaamelot-addon
    • Execute mvn eclipse:eclipse
    • Refresh Project resources under Eclipse
      The WST Builder will update the generated Classpath as follow

Integration of Plugin :

When your Plugin Project is created, then it can be referenced in JIRA Web Project (i.e. atlassian-jira-3_5), as follow :

From Project Properties,

  1. In Java Build Path, add your project as Project
  2. In Project References, select your project
  3. Apply modification.
    After, a .wtpmodules file should be updated with your project as dependence of JIRA WEB Project

Now, Eclipse take in charge :

  • Compilation of java file to .deployables/jira-plugin-XXX" directory,
  • Copy of resource to .deployables/jira-plugin-XXX" directory,
  • Build of Jar File from .deployables/jira-plugin-XXX" directory,
    and copy of it to .deployables\XXX\WEB-INF\lib of referencing project.
    (i.e. atlassian-jira-3_5\.deployables\atlassian-jira-3_5\WEB-INF\lib)

Plugin Deployment :

To deploy created plugins, follow below steps :

    • From the root of the Build Project
    • Execute mvn install ... (i.e. for jira-plugin-kaamelot Project)
Labels:
  1. Jul 21, 2009

    I search an IDE of developpment by the api jira