Version 10 (modified by Tanya, 16 years ago) (diff) |
---|
Platform deployment build in Eclipse
To deploy Sophie 2.0 project in Eclipse you have to follow these steps:
- choose Import... option from File menu or with right click in the Package tree
- Select Maven Projects and click Next
- Choose sophie2-platform directory for Root Directory, browsing to your imported repo(you must have sophie2-repo in your filesystem. See PLATFORM_INFRASTRUCTURE_OVERVIEW for info)
- (recommended) Choose Add Project to working set and
- make New... working set with Java elements
- choose the name for the working set (i.e. sophie2-working-set)
- click Finish
- note: do not worry about the mistakes in Maven Console
Now you have Eclipse working set contains the Sophie 2.0 modules.
The base project is sophie2-platform and there you can run the project choosing author.FakeAuthorMain.launch's Run As option.
This is not the real OSGi container, it is only an emulation for running the application under Eclipse IDE - otherwise, you have to wait at least two minutes for Maven build for every little change in the source.
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 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