Setting Up the Environment
These steps are for the framework developers. You do not need to do any of this if all you want is to use the Shine Framework, however, you may find this information useful anyway.
Plugins
- Put the settings.xml in your <home-directory>/.m2 (in windows this will be c:\Documents and Settings\<username>\.m2).
- Edit your settings.xml file and put your username and password where appropriate.
- Setup the maven preferences in eclipse:
- Go to window -> preferences -> Maven2.
- Set the local repository location to <home-directory>/.m2 (in windows this will be c:\Documents and Settings\<username>\.m2).
- Enable "Download Artifact Sources".
Running in Eclipse
Even though we've instructed how to install the m2 plugin, we do not recommend using it. Instead, we recommend using Maven as an external tool from within eclipse. Before you can do that you need to define the following in your system environment:
- MAVEN_HOME - to point to the location of your Maven installation
- JAVA_HOME - to point to the location of your jdk
- Add $MAVEN_HOME/bin and $JAVA_HOME/bin to your system path
To define Maven as an external tool:
- Go to Run -> External Tools -> External Tools ...
- Select "Program" on the side bar and click on the "new" icon.
- Name your first external tool "m2 clean" and click on the "Variables" button in the Location section.
- The following instructions need only be used once for the first m2 external tool:
- Click "Edit Variables"
- Click "New"
- Name the variable "mvn_exec" (without the quotes), and assign the location of the Maven executable to its value (in windows point to mvn.bat, in Linux point to the mvn executable script).
- Click "Ok" until you close the variable selection dialog.
- Put the ${mvn_exec} in the Location.
- Put ${project_loc} in the Working Directory.
- Write clean in the Arguments.
- Move to the "Refresh" tab and select the correct refresh for your specific m2 task (see table below). For clean use "The entire workspace".
- Move to the "Common" tab and select "External Tools" in the "Display in favorites menu".
m2 External Task Name | Maven action | Refresh level |
m2 clean | clean | The entire workspace |
m2 compile | compile | The project containing the selected resource |
m2 eclipse | eclipse:eclipse | The project containing the selected resource |
m2 install | install | The entire workspace |
m2 test | test | The project containing the selected resource |
m2 external tasks table
Derby DB as an eclipse plugin
IMHO it is more convenient to use the Derby DB as a plugin within eclipse. To do so follow the instructions in the Derby DB Web Site. Another option, though is to do it all manually - see next section.
Setting Up Derby DB as a Network Database
In some projects it is more convenient to setup derby db as an embedded database, in which case there is no extra configuration. However, it is sometime more convenient to treat the derby DB as a regular network database. To set it up:
- Download the relevant Derby DB version (right now 10.2.2.0), but there may already be a newer version that we might migrate to soon.
- Unzip it somewhere (from here on end the installation directory).
- Define DERBY_HOME to point to the installation directory.
- Add $DERBY_HOME/bin to your path.
- Start the server:
# cd whereever-I-want-my-db-to-be-created
# $DERBY_HOME/frameworks/NetworkServer/bin/NetworkServerControl.ksh start
- For windows change .ksh to .bat
- To create the database:
# ij
ij> connect 'jdbc:derby://localhost/derbyDB;create=true';
- To connect to the database (once it's created):
# ij
ij> connect 'jdbc:derby://localhost/derbyDB';