Version 20 (modified by boyan, 16 years ago) (diff) |
---|
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 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.
Additional information
- You have to be careful making new modules for the project. These are the steps:
- make new empty directory with org.sophie2.modulename name in sophie2-platform/modules and create its pom.xml file
- add it to repository and commit it. Also add it to base pom.xml of sophie2-platform in modules section.
- right click - Import... - Maven projects - choose the new created module
- Keep in mind to use Maven options Update Project Configuration and Update Dependencies when you change the pom.xml files. They are available in Maven section when you right click on the project you want to update.
- If you don't see the working sets, use
- View Menu(in upper right corner of Package Tree) and Configure working sets option.
- Top Level Elements - choose Working Sets
How to create a new module
- Copy sophie2-platform/dev-tools/org.sophie2.proto.project to sophie2-platform/modules
- Edit pom.xml
<artifactId>org.sophie2.proto.project</artifactId> <version>2.0-SNAPSHOT</version> <name>Sophie 2 Author Component</name> <packaging>bundle</packaging> <description>Copy from this one to create a sophie2 module</description>
and
<instructions> <Main-Class>org.sophie2.proto.project.ProtoModule</Main-Class> <Export-Package>org.sophie2.proto.project.*</Export-Package> <!-- <Private-Package>org.apache.felix.moduleloader.*,org.apache.felix.framework.*,org.apache.felix.main,org.osgi.*,org.apache.log4j.*</Private-Package>--> <Bundle-Activator>org.sophie2.author.Activator</Bundle-Activator> <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency> <Import-Package>*;resolution:=optional</Import-Package> </instructions>
If you don't have main class you should remove <Main-Class>
- Rename the project - artifactId and the name of the project should be the same
- right click at sophie-working-set - Import... - Maven projects - choose the new created module
Comments
- boyan
- There is duplicate information about creating a new module and the one in the Additional Information section is not correct.