wiki:PLATFORM_DEPLOYMENT_BUILD_ECLIPSE

Version 17 (modified by boyan, 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 the File menu or with right click on the Package tree.
  • Select General->Maven Projects and click Next (Or use the search box to search for Maven)
  • Choose sophie2-platform directory for Root Directory, browsing to your imported repo.
  • (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
  • right-click on the project in Eclipse, and click Maven/Update Dependencies to finish integration.

Now you have Eclipse working set containing the Sophie 2.0 modules.
The base project is sophie2-platform. You can run the project by:

  1. Right click on "org.sophie2.author "
  2. Choose "Run As->Java Application"
  3. Choose "FakeAuthorMain - org.sophie2.author"

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 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.