IntelliJ IDEA project and module files

You should be able to use these files "As Is" (see below for some exceptions).
Just select the thredds.ipr file from the IntelliJ IDEA "File | Open Project..."
menu item. Click on the "Project" side-bar item on the left side of the IDEA
window to open up the project view. You should see the following modules:

"cdm" - the client side netcdf-java and thredds code
"intelliJ" - the IntelliJ IDEA project files (Please don't add or commit
             things to Subversion in this module unless you are sure everyone
             will want that change.)
"lib" - the libraries used by  the various THREDDS modules
"tds" - the THREDDS Data Server (TDS) code
"ui" - the ToolsUI code

Now for the non-"As Is" part. There are several things to setup that are
specific to your local machine and working directory:

1) Set the version control system to Subversion.
  a) Bring up the "Settings" window by clicking on the "wrench and bolt" icon.
  b) Brint up the "Version Control" window.
  c) In the "Default Module Version Control" pull-down, select "Subversion".
  d) Select the "OK" button to close the "Version Control" window.

2) Make sure a valid JDK is selected.
  a) Bring up the "Modules" window.
  b) Select the "Libraries" tab.
  c) If the JDK is shown in red, click the "..." button and select a valid JDK.

3) Make sure a valid web application server (like Tomcat) is selected.
  a) Back in the "Modules" window, make sure the "tds" module is selected.
  b) Select the "Web Module Settings" tab.
  c) If the "Application Server" is shown in red (or is blank?), click the
     "Configure ..." button and select a valid application server (Tomcat).

4) Mark the IntelliJ IDEA project files as "Exclude from commit". (This will
   make sure they don't accidentally get checked in.)
  a) Make sure a file in the intelliJ module has changed (it will turn from
     black to blue in the project window). I generally just add a space or
     something to this README file and then save it. Make sure the README
     file turns blue in the project window. (If it still isn't blue, try
     minimizing your IntelliJ IDEA window and then opening it back up.)
  b) From the "Version Control" menu item, select "Commit project".
  c) Select the "intellJ" module.
  d) Click the "Exclude from commit" (the minus sign, "-") icon.
  e) Close the "Commit Project" window by clicking on the "Close" button.

5) Setup the Ant builds (optional).
  a) From the right sidebar, click on the "Ant Build" item.
  b) Click on the "Add" button at the top of the "Ant Build" window.
  c) Browse through your directory structure to the location where you checked
     out the project source.
  d) From there, locate the Ant build script files ("build.xml"); there is one
     in the "cdm" directory and on in the "tds" directory.
  e) Select one of the build scripts and select "OK".
  f) Repeat steps b-e for any other build scripts.

  g) The TDS Ant build uses some Tomcat deploy add-ons. To use the TDS build
     script, the catalina-ant.jar file must be available to Ant. There are two
     ways to set this up. Either:
    1) Setup IntelliJ IDEA to run Ant with catalina-ant.jar on the class path.
      a) In the "Ant Build" window, select the "tds" build script. Bring up
         the "Properties" window by clicking on the "Properties" icon (looks
         like a check list) at the top of the "Ant Build" window.
      b) Select the "Additional Classpath" tab.
      c) Click on the "Add" button.
      d) Browse your directory tree to find a copy of catalina-ant.jar. The
         Tomcat distribution contains one in the server/lib directory.
      e) Select the copy of catalina-ant.jar and click on the "OK" button.
    OR
    2) Copy catalina-ant.jar (distributed with Tomcat) into the lib directory
       of the Ant being used by IntelliJ IDEA.
      a) In the "Ant Build" window, select the "tds" build script. Bring up
         the "Properties" window by clicking on the "Properties" icon (looks
         like a check list) at the top of the "Ant Build" window.
      b) Select the "Execution" tab.
      c) Look at the setup of the Ant being used (default or custom) to
         determine the location of the Ant lib directory.
      d) Copy catalina-ant.jar to the Ant lib directory.

6) Setup Run/Debug configuration (optional)
  a) Bring up the "Run/Debug Configuration" window. (From the IntelliJ IDEA
     toolbar, find the "Run/Debug Configuration" pull-down and select
     "Edit Configuration".)
  b) Set some defaults:
    1) Bring up the "Application Default Settings" window. (Under the
       "Application" tab, select the "Edit Defaults" button.)
    2) Set the "VM Parameters" to: "-Xmx512m -ea"
    3) Set the "Working directory" to "<yourThreddsCheckoutDir>/cdm" and
       select "cdm" for the "Use classpath and JDK of module" item. [You can
       replace "cdm" with "tds" or "ui" if you like depending on where the
       majority of your applications will reside.]
    4) Close the "Application Default Settings" window by clicking the "OK" button.
    5) Bring up the "JUnit Default Settings" window. (Under the
       "JUnit" tab, select the "Edit Defaults" button.)
    6) Repeat steps 2 and 3.
    4) Close the "JUnit Default Settings" window by clicking the "OK" button.
  c) Setup to run/debug the desired apps, web apps, and JUnit tests.
     A few possibilities:
    1) Some JUnit tests:
      a) ucar.nc2.TestAll
      b) thredds.tds.TestTDSAll
      c) thredds.TestCompareTwoCatalogs
      d) (more to come)
    2) NetCDF-java ToolsUI: ucar.nc2.ui.ToolsUI
    3) TDS:
      a) In the "Run/Debug Configuration" window, select the "Web Server" tab.
      b) Add a new application by clicking on the "+" icon and selecting "Local".
      c) Name the new application "TDS".
      d) Under the "Server" tab:
        1) For "Application Server", select your Tomcat server.
        2) Deselect the "Start browser" option.
      e) Under the "Deployment tab:
        1) Select the "tds" web module.
        2) Change the "Application Context" field from "/" to "/thredds".
  d) Close the "Run/Debug Configuration" window by clicking the "OK" button.
