Differences between revisions 6 and 7
Revision 6 as of 2009-09-20 22:58:26
Size: 5590
Editor: localhost
Comment: converted to 1.6 markup
Revision 7 as of 2011-07-22 08:28:51
Size: 5635
Editor: EricCharles
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
To build James V3 in eclipse, read [[http://james.apache.org/server/3/dev-build.html]]
Line 8: Line 10:
Line 18: Line 19:

Line 21: Line 20:
 *  Open the SVN perspective and create a new Repository Location with these properties:
   *  URL: http://svn.apache.org/repos/asf/james
 * Open the SVN perspective and create a new Repository Location with these properties:
  * URL: http://svn.apache.org/repos/asf/james
Line 27: Line 26:
 *  In the SVN perspective expand the Apache SVN hierarchy to show server/trunk. 
   * Right-click on 'server/trunk', and select 'Checkout' from the pop-up menu.
   * A dialog window will be present where button 'Finish' can be clicked (assuming that a new project is satisfactory).
   * From the "New Project Wizard", select Java as the project type and click the "Next" button. 
   * Specify a project name and location and click the "Next" button. 
   * Click the "Finish" button to proceed.
 * In the SVN perspective expand the Apache SVN hierarchy to show server/trunk.
  * Right-click on 'server/trunk', and select 'Checkout' from the pop-up menu.
  * A dialog window will be present where button 'Finish' can be clicked (assuming that a new project is satisfactory).
  * From the "New Project Wizard", select Java as the project type and click the "Next" button.
  * Specify a project name and location and click the "Next" button.
  * Click the "Finish" button to proceed.
Line 37: Line 36:
 *  Open a shell and switch to the directory into which James was checked out. 
 *  Run the Ant 'build' script without arguments. 
 *  When this completes cleanly, the checkout is verified.
 * Open a shell and switch to the directory into which James was checked out.
 * Run the Ant 'build' script without arguments.
 * When this completes cleanly, the checkout is verified.
Line 42: Line 41:

JAMES trunk is a series of modules (See [[Modularisation]]). Each module should be a separate project in Eclipse. It is usually convenient to use a separate workspace for JAMES.  
JAMES trunk is a series of modules (See [[Modularisation]]). Each module should be a separate project in Eclipse. It is usually convenient to use a separate workspace for JAMES.
Line 47: Line 45:
For example module, a project needs to be created in Eclipse. This is a slighty labourous process.  For example module, a project needs to be created in Eclipse. This is a slighty labourous process.
Line 50: Line 48:
As James is a server application I prefer to transfer my updated files to a remote machine, run James' Ant build script (build.bat or build.sh) on the remote machine to update the distribution and then use the Eclipse remote debugger to test. This means that the build, deployment and execution are being tested as they will be used and any changes validated.
You can use another session on your local machine as the 'remote machine', the JVM is still 'remote' from the one used by Eclipse.
The JVM pointed to by the JAVA_HOME environment variable for the session used to build and run James must be v1.4.0 or above.
To debug remotely:
 *  Uncomment the DEBUG property in the James start-up script (run.bat or run.sh). Now, when you run the script the JVM will pause waiting for a debugger to attach.
 *  In Eclipse select Run>Debug... to open the Launch Configuration widget. 
   *  Select 'Remote Java Application' as the configuration type and click the 'New' button. 
   *  Fill in the configuration properties so that they match those specified in the James start-up script and click the 'Apply' button.
 *  If you have not already done so, run the James start-up script so that it is waiting for a connection. 
 *  In Eclipse, select the appropriate Launch Configuration and click the 'Debug' button to proceed. James will now start and you will see all of its threads, as they are created, displayed in the Eclipse debugger.
Read the Eclipse Help to understand the many facilities now at your fingertips. 
As James is a server application I prefer to transfer my updated files to a remote machine, run James' Ant build script (build.bat or build.sh) on the remote machine to update the distribution and then use the Eclipse remote debugger to test. This means that the build, deployment and execution are being tested as they will be used and any changes validated.  You can use another session on your local machine as the 'remote machine', the JVM is still 'remote' from the one used by Eclipse. The JVM pointed to by the JAVA_HOME environment variable for the session used to build and run James must be v1.4.0 or above. To debug remotely:

* Uncomment the DEBUG property in the James start-up script (run.bat or run.sh). Now, when you run the script the JVM will pause waiting for a debugger to attach.
 * In Eclipse select Run>Debug... to open the Launch Configuration widget.
  * Select 'Remote Java Application' as the configuration type and click the 'New' button.
  * Fill in the configuration properties so that they match those specified in the James start-up script and click the 'Apply' button.
 * If you have not already done so, run the James start-up script so that it is waiting for a connection.
 * In Eclipse, select the appropriate Launch Configuration and click the 'Debug' button to proceed. James will now start and you will see all of its threads, as they are created, displayed in the Eclipse debugger.

Read the Eclipse Help to understand the many facilities now at your fingertips.
Line 63: Line 60:
Eclipse is able to build patches against the code stored in the SVN repository. This makes patch creation very easy. Still, remember that the code in the repository may have changed since you imported it. Use the SVN Perspectives Synchronisation feature to ensure you are up-to-date before creating a patch.
Eclipse offers the ability to generate a patch that includes new files. This does not work when the new file is in a new directory! It is safest to work in the more conventional manner, building a patch for changed files and submitting new files separately.
Eclipse is able to build patches against the code stored in the SVN repository. This makes patch creation very easy. Still, remember that the code in the repository may have changed since you imported it. Use the SVN Perspectives Synchronisation feature to ensure you are up-to-date before creating a patch. Eclipse offers the ability to generate a patch that includes new files. This does not work when the new file is in a new directory! It is safest to work in the more conventional manner, building a patch for changed files and submitting new files separately.
Line 67: Line 63:
 *  Select the item or items you wish to create a patch for.
 *  From the pop-up menu, select "Team>Create Patch...".
 *  Select "Save In File System", "Browse" to select a target file and click the "Next" button.
 *  Select "Recurse into sub-folders", unselect "Include new files in patch", select the Diff output format of "Unified" and Click the "Finish" button.

* Select the item or items you wish to create a patch for.
 * From the pop-up menu, select "Team>Create Patch...".
 * Select "Save In File System", "Browse" to select a target file and click the "Next" button.
 * Select "Recurse into sub-folders", unselect "Include new files in patch", select the Diff output format of "Unified" and Click the "Finish" button.

To build James V3 in eclipse, read http://james.apache.org/server/3/dev-build.html

A Rough Guide to James Development Using Eclipse

Follow these steps to develop James code using the Eclipse IDE. Use the Eclipse Help and Tutorials to more fully understand the Eclipse concepts and actions described here.

Download and Install Eclipse

Eclipse can be obtained from http://www.eclipse.org/. Follow the installation instructions that come with the download.

NOTE REGARDING CVS

The CVS sections are obsolete. The ASF is migrating to Subversion. We encourage anyone who uses Eclipse with SVN to update this page to provide the appropriate process.

The JAMES project is rooted at svn.apache.org/repos/asf/james. The main development branch for the server is svn.apache.org/repos/asf/james/server/trunk.

Those unfamiliar with Subversion would benefit from the Version Control with Subversion.

Download and install the Subversion plugin for Eclipse

This can be done by downloading it from http://subclipse.tigris.org/ or by adding http://subclipse.tigris.org/update_1.0.x as an update site in the Eclipse update manager (which you can find in the Help menu).

Connect to the Apache SVN repository

and click on 'Finish'.

Check Out James from the Apache SVN repository

  • In the SVN perspective expand the Apache SVN hierarchy to show server/trunk.
    • Right-click on 'server/trunk', and select 'Checkout' from the pop-up menu.
    • A dialog window will be present where button 'Finish' can be clicked (assuming that a new project is satisfactory).
    • From the "New Project Wizard", select Java as the project type and click the "Next" button.
    • Specify a project name and location and click the "Next" button.
    • Click the "Finish" button to proceed.

Verify Checkout

Before attempting to configure Eclipse, verify that you have everything you need by running a build of James outside of Eclipse. This will fetch, or prompt you to fetch, any missing components.

  • Open a shell and switch to the directory into which James was checked out.
  • Run the Ant 'build' script without arguments.
  • When this completes cleanly, the checkout is verified.

Modularisation

JAMES trunk is a series of modules (See Modularisation). Each module should be a separate project in Eclipse. It is usually convenient to use a separate workspace for JAMES.

Start by creating a new user library containing all the jars in stage except those starting james-server-*. All projects will need to add this library. The modules use the conventional Maven 2 layout so it's best to set up the defaults for source to src/main/java -> target/classes and src/test/java -> target/test-classes.

For example module, a project needs to be created in Eclipse. This is a slighty labourous process.

Build, Test and Debug Code

As James is a server application I prefer to transfer my updated files to a remote machine, run James' Ant build script (build.bat or build.sh) on the remote machine to update the distribution and then use the Eclipse remote debugger to test. This means that the build, deployment and execution are being tested as they will be used and any changes validated. You can use another session on your local machine as the 'remote machine', the JVM is still 'remote' from the one used by Eclipse. The JVM pointed to by the JAVA_HOME environment variable for the session used to build and run James must be v1.4.0 or above. To debug remotely:

  • Uncomment the DEBUG property in the James start-up script (run.bat or run.sh). Now, when you run the script the JVM will pause waiting for a debugger to attach.
  • In Eclipse select Run>Debug... to open the Launch Configuration widget.

    • Select 'Remote Java Application' as the configuration type and click the 'New' button.
    • Fill in the configuration properties so that they match those specified in the James start-up script and click the 'Apply' button.
  • If you have not already done so, run the James start-up script so that it is waiting for a connection.
  • In Eclipse, select the appropriate Launch Configuration and click the 'Debug' button to proceed. James will now start and you will see all of its threads, as they are created, displayed in the Eclipse debugger.

Read the Eclipse Help to understand the many facilities now at your fingertips.

Release patches

Eclipse is able to build patches against the code stored in the SVN repository. This makes patch creation very easy. Still, remember that the code in the repository may have changed since you imported it. Use the SVN Perspectives Synchronisation feature to ensure you are up-to-date before creating a patch. Eclipse offers the ability to generate a patch that includes new files. This does not work when the new file is in a new directory! It is safest to work in the more conventional manner, building a patch for changed files and submitting new files separately.

To create a patch:

  • Select the item or items you wish to create a patch for.
  • From the pop-up menu, select "Team>Create Patch...".

  • Select "Save In File System", "Browse" to select a target file and click the "Next" button.
  • Select "Recurse into sub-folders", unselect "Include new files in patch", select the Diff output format of "Unified" and Click the "Finish" button.

You have created a patch!

EclipseNotes (last edited 2011-07-22 08:28:51 by EricCharles)