[[BackLinksMenu]]
= Platform deployment build in Eclipse =
== Prerequisites ==
Before you can import the Sophie 2.0 project in Eclipse, you must have Maven and Subversion installed and integrated in it. For detailed information on how to do that, please refer to the Setup section of [wiki:DEVELOPMENT_OVERVIEW].
== Importing for the first time ==
To deploy the Sophie 2.0 project in Eclipse you have to follow these steps:
* Choose the '''Import...''' option from the File menu or by right-clicking in Package Explorer.
* Select '''General''' -> '''Maven Projects''' and click '''Next''' (or use the search box to search for Maven).
* Browse to your local copy of the repository and choose sophie2-platform for Root Directory.
* (recommended) Check '''Add project(s) to working set''' and
* Click the '''New...''' button next to the Working set field;
* Select '''Java''' as a Working set type and click '''Next''';
* Choose the name for the working set (i.e. sophie2-working-set) and click '''Finish'''.
* Click '''Finish'''
* Note: do not worry about the mistakes in Maven Console
* Right-click on the project in Package Explorer and select '''Maven''' -> '''Update Dependencies''' to finish integration.
* Note that the first time that you import the project it will take a while before the process is complete.
== Running Sophie2 ==
Now you have an Eclipse working set containing the Sophie 2.0 modules. The base module of the project is sophie2-platform. To run the project:
* Go to sophie2-platform/dev-tools.
* To run Sophie2 Author right-click on author.FakeAuthorMain.launch and select '''Run as''' -> '''author.FakeAuthorMain'''
* To run Sophie2 Server right-click on server.FakeServerMain.launch and select '''Run as''' -> '''author.FakeServerMain'''
* Note that you might have to select '''Run configurations...''' if no other options are available.
* When the Reader is available, you can run it the same way.
These are not the real OSGi containers but only emulations for running the application under Eclipse IDE - otherwise, you have to wait at least two minutes for Maven to build for every little change in the source code.
== Creating a new module ==
When you have to create a new module, follow these steps:
* Copy sophie2-platform/dev-tools/org.sophie2.proto.project to sophie2-platform/modules
* Right-click on the module in the new location, choose '''Refactor''' -> '''Rename''' and enter the name of the new module.
* Edit the following part of the pom.xml file of the new module:
{{{
org.sophie2.proto.project
2.0-SNAPSHOT
Sophie 2 Author Component
bundle
Copy from this one to create a sophie2 module
... (some more lines)
org.sophie2.proto.project.*
}}}
The should be the same as the module name. All other occurencies of org.sophie2.proto.project (for example in the should be replaced with the new module name. You should also edit the and tags. You can look at the tag if your module reqires a main class or a class extending SophieModule.
* Edit the pom.xml of sophie2-platform and add the name of the new module in the section.
* After you create the module, you have to import it. See the next section for details.
== Importing newly created modules ==
To import a newly created module, follow these steps:
* Choose the '''Import...''' option from the File menu or by right-clicking in Package Explorer.
* Select '''General''' -> '''Maven Projects''' and click '''Next''' (or use the search box to search for Maven).
* Browse to your local copy of the repository and choose sophie2-platform for Root Directory.
* You will see the new modules selected. Make sure the current working set is selected and click '''Finish'''.
* Right-click in the Package Explorer and choose '''Update Project Configuration''' and '''Update Dependencies''' from the '''Maven''' submenu.
== Troubleshooting information ==
* If you see errors in your pom.xml files after an update, then probably someone has commited a new module and you have to import it.
* If you don't see the working sets, use the View Menu in the upper right corner of Package Explorer.
* for Top Level Elements choose Working Sets.
* use the Configure Working Sets option.
= Comments =