|
DevelopSimal
How to develop SimalThis How-To describes how to set up your development environment for working with Simal. Since Simal uses many Eclipse plugins in components of the Simal project it makes most sense for you to work within the Eclipse environment (although this is not a requirement, it just makes your life easier). This how-to therefore focuses on configuring Eclipse for working on Simal. If you just want to build and run Simal, without doing any development, then see GettingStarted instead. Intended AudiencePeople wishing to participate in the development of Simal. PurposeTo set up an Eclipse development environment that can build Simal. PrerequisitesReaders should
1. Install EclipseEclipse 3.5 + Web Tools Project 3.1If you do not currently have eclipse installed we recommend that you download and unpack the Eclipse IDE for Java EE Developers package. If you already have eclipse then you will need to ensure that you also have the Web Standards Tools (WST) plugin installed (use the WTP update site). Configure JDKThe m2eclipse plugin you're about to install requires Eclipse to be run in a JDK.
2. Get Eclipse PluginsThe easiest way to get the Simal code into Eclipse is as follows. SubclipseWe use a Subversion repository for our source code, therefore you need an SVN plugin like Subclipse for working with the repository. Install it as follows:
For more information about Eclipse plugins, try this tutorial. m2eclipseSimal is built with Maven. Therefore, you should install the m2eclipse plugin. Follow the above procedure, with this repository: http://m2eclipse.sonatype.org/sites/m2e This Core update site contains a single component: "Maven Integration for Eclipse (Required)". When you install this component (in the same way as above) you will be installing all of the core Wizards, the POM Editor, Maven Repository integration, and Maven integration. Wicket BenchWicket Bench is a plugin that makes working with Wicket files easier. It can be installed from the update site using the method described above. TODO describe how to use this. 3. Get Simal SourcesThe first thing you need to do is checkout the Simal source code. To do this use the simal.psf team set.
file in a convenient location
After following these steps the source code for Simal will be checked out from version control, ready for you to start work. 4. Get Maven dependenciesAfter importing the files from SVN you will need to tell Eclipse to use Maven to build the source. To do this right click on each of the uk.ac.osswatch.simal.* projects and select Maven -> Enable Dependency Management. Maven will now download all dependencies; this can take some time depending on the speed of your network detection, but it is a one-off step. 5. Test Setup So FarTo verify that everything compiles and builds correctly, let's now run some tests:
6. Building and Running from within EclipseBuildAt this point you will have three projects in Eclipse, one for the core, the rest and the web project. You can run Maven2 commands for each project from the Run as context menu.
This installs the core module in the local repository. DeployTo deploy the webapp from within Eclipse you can also use the m2eclipse run configuration.
Now you can debug the webapp from within Eclipse.
Now you can debug the webapp from within Eclipse.
Note however that there is an issue with persistencing the data when you're running from within. The shutdown hook in Simal that ensures that the project data is persisted on disk is not called when shutting down the JVM in Eclipse. This is a bug/feature of Eclipse. See Issue 344 for more info. 7. Start developingAssuming all tests past you are now ready to start developing. Further assistance is available in the relevant sections of the Simal documentation and in the JavaDocs. For information about how to contribute patches to the Simal team, see: For more information: http://code.google.com/p/simal/wiki/GettingStarted Updating sourceDon't forget to regularly (perhaps daily) check for updates in the Subversion repository:
8. Optional StepsCodestyle and code formattingWe have defined a custom Simal formatter and code templates for Eclipse. To install these first download the following files: To import the Formatter go to Window -> Preferences -> Java -> Code Style -> Formatter . Select Import and choose the simal_formatter.xml. To import the code templates go to Window -> Preferences -> Java -> Code Style -> Code Templates . Select Import and choose the simal_codetemplates.xml. Note that you do not need to use the Simal style and templates for all our projects, you can configure templates on a per project basis within Eclipse. Task ManagementThese plugins are useful in tracking and managing tasks. Mylyn Generic Issue Tracker IntegrationTODO Describe use of the Mylyn generic issue tracker to integrate with Google Code Code QualityThe plugins are used for managing code quality in Simal. They typically generate a number of reports indicating potential problems with code quality. It is good practice to run these reports on a periodic basis and to fix as many issues they highlight as is possible. Many of these plugins integrated with our Maven builds and our continuous integration server. This allows us to keep an eye on the quality trends within our code. PMDPMD scans Java source code and looks for potential problems like:
Use the PMD Eclipse update site to install this plugin. Find bugsFindBugs uses static analysis to look for bugs in Java code. Use the FindBugs Eclipse update site to install this plugin. | |