This page describes how to setup your IDE for developing flexive.
IDE setup for 'old-school' (Ant-based) flexive projects is described in the Reference Documentation.
IDE setup for Maven projects is trivial nowadays (all major IDEs have native support for Maven projects), just open the project and it should work without further setup work.
In each modules resources folder exists an .iml file that can be used to import it into idea. The modules have the correct dependencies set.
To checkout and setup IDEA for the framework follow these instructions:
- Launch IDEA
- Version Control|Checkout from Version Control|Subversion
- Add a new repository by clicking the "+" icon
- In the dialogbox enter "http://svn.flexive.org/repository/flexive" and click "OK"
- Open the tree that appears and select "trunk"
- Click "Checkout"
- In the "Select Path" dialog create a new directory (I used /home/<user>/develop/flexive)
- Select the directory and click "OK"
- Check all options in the next dialog box and wait until flexive has been checked out
- Select "No" when asked if you wish to create a project from the sources you just checked out (we will use the provided module files instead)
- Create a new project using File|New Project...
- Select "Create project from scratch" and click "Next"
- Enter "flexive" as name and select the directory where you checked out flexive before as "Project file location" and uncheck Create module!
- Click finish
- The "Project Settings" dialog will appear, select "Module" in the left panel and click the "+" icon above the second panel to the left
- Repeat this by selecting Import existing module for the following files:
- docbook/docbook.iml - if you plan on writing documentation
- at the bottom right click the "Apply" button and then the "Ok" button.
- Make sure to install the JetGroovy plugin if you plan on coding using Groovy
- Create a custom build.properties file by selecting build.properties.sample in the root-module inside the project view.
- Right click the file and select Refactor|Copy (or press F5).
- As new name enter build.properties, then click "OK".
- Don't include this file in version control!
- Adjust the paths/properties according to your needs
- Enable version control by selecting File|Settings|Project Settings|Version Control and choosing Subversion for <Project Root>
- To configure ANT, click the Ant Build-tab on the right side, select the "+" icon and add build.xml from the projects root directory
Please make sure that you do not commit back your modified .iml files as IDEA will modify them every blue moon for sure
I'd recommend moving them to a separate changelist so you can't accidently commit them.
- Go to http://www.eclipse.org and download the latest build
- Unpack the distribution and start eclipse
- Go to Help|Software Updates|Find and install ...
- Install updates from the callisto discovery site
[fleXive] comes with a Checkstyle configuration. When working on [fleXive] code, you might want to install the eclipse plugin and try not to add new warnings to the source code. The flexive checks can be added as a global configuration in Preferences|Checkstyle|Global Check Configurations, the file is src/framework/resources/checkstyle/flexive_checks.xml. We are aware that our own code is not 100% compliant, but at least we try.
Optional Plugins you might want to try:
Can be grabbed from here.
Eclipse 3.2 uses an embedded mozilla renderer.
Issues regarding this renderer are described here and here.
A solution can be found here:
Download mozilla for linux and point MOZILLA_FIVE_HOME to your mozilla installation. Please note that the firefox distribution from mozilla.org is not compiled with embeddable support:
- File|New|Other... -> SVN|Checkout Projects from SVN
- "Create a new repository location"
- Select trunk|flexive
- "Checkout as project configured using the New Project Wizard"
- after checkout delete the project but not the contents!
- "Java project from existing ant build file" -> choose the build.xml file from the checked out repository
- If you use checkstyle, activate the flexive configuration in the project's preferences.
Checking out the sources
- Start Netbeans
- Open Team -> Checkout
- Enter the flexive repository URL: http://svn.flexive.org/repository/flexive
- Click Next
- Repository Folder: select "trunk" for the current development version
- Choose a local directory for "Local Folder"
- Start the checkout by clicking "Finish"
For best support for auto-completion, it is recommended to create several projects:
- A Java project (with existing sources) for the framework
- Web projects for the UI components
Use a project group (File -> Project Group -> New Group) to group these projects together permanently.
Creating a project for the framework
- File -> New Project -> Java -> Java Project with Existing Sources
- Select the flexive root folder you just checked out as the project folder
- In the next screen, select the source folders you want to manage, e.g.:
Creating a web project for the JSF components
To improve autocompletion support, it is advisable to create a web project for each of the JSF component libraries you want to use.
- File -> New Project -> Java Web -> Web Application with Existing Sources
- Choose the source folder of the component library, e.g. src/ui/jsf-components
- Choose JavaEE 5 in the next screen
- Choose the source, web and WEB-INF libraries in the next screen (the WEB-INF library must be specified, although it's usually not necessary for the components)
- Right-click on the created project, select Properties
- Under Libraries, click "Add Project" and add the main flexive project
- Under Frameworks, select Java Server Faces if it is not already selected
Managing the flexive libraries
It's advisable to create a global library for flexive dependencies.
- Tools -> Libraries
- New Library...
- Use a common name, e.g. "flexive-libs"
- Add all JAR files in the lib/ folder
- Possibly attach sources for some of the libraries
- Add the flexive-libs dependency to the main project and the web projects (right-click on the project, Properties, Libraries).