Skip to main content
Jump to: navigation, search

Difference between revisions of "OM2M/one/Clone"

< OM2M‎ | one
m (Fix clone URI)
Line 14: Line 14:
 
* Clone the OM2M project using git with the following command:
 
* Clone the OM2M project using git with the following command:
 
<pre>
 
<pre>
git clone http://git.eclipse.org/gitroot/om2m/org.eclipse.om2m.git
+
git clone https://git.eclipse.org/r/om2m/org.eclipse.om2m
 
</pre>
 
</pre>
  

Revision as of 07:06, 20 January 2016

In this tutorial, you can download already built OM2M binaries or learn how to build OM2M from source code by yourself using command line or Eclipse.

Prerequisites

  • Git is required to clone OM2M.
  • JAVA 1.7 or later is required to run OM2M.
  • Apache Maven 3 or later is required to build OM2M.

Clone and build OM2M using Command line

Clone OM2M using command line

  • Clone the OM2M project using git with the following command:
git clone https://git.eclipse.org/r/om2m/org.eclipse.om2m

build OM2M using command line

  • Go to "org.eclipse.om2m" directory.
  • Build OM2M using the following command: (An internet connection is required to download required dependencies)
mvn clean install
  • Two Eclipse products will be generated after a successful built:
    • The IN product can be found on this directory: "om2m/org.eclipse.om2m/org.eclipse.om2m.site.in-cse/target/products/in-cse/<os>/<ws>/<arch>"
    • The MN product can be found on this directory: "om2m/org.eclipse.om2m/org.eclipse.om2m.site.mn-cse/target/products/mn-cse/<os>/<ws>/<arch>"
    • The ASN product can be found on this directory: "om2m/org.eclipse.om2m/org.eclipse.om2m.site.asn-cse/target/products/asn-cse/<os>/<ws>/<arch>"

Clone and build OM2M using Eclipse IDE

Install Eclipse IDE

Configure Maven Proxy (Only if required)

If you are required to use a proxy server to access the Internet, then you have to configure maven proxy settings as follows:

  • Select Window -> Preferences -> Maven -> User settings
  • You will find the warning message "settings.xml file doesn't exist" .
  • Move to the .m2 directory location and create the settings.xml file and put this snippet.
<settings>
  <proxies>
   <proxy>
      <active>true</active>
      <protocol>http</protocol>
      <host>proxy-host</host>
      <port>proxy-port</port>
    </proxy>
  </proxies>
</settings>

Install Tycho plugin

Tycho quick install using Eclipse Maven Marketplace

  • Click Window -> Preferences -> maven -> discovery -> open catalog and type Tycho. Check the “Tycho Configurator” checkbox.
Eclipse Maven marketplace

Tycho Manual install using the Eclipse Update repository (Only if requried)

It happens that the Tycho plugin do not appears in the Eclipse Maven marketplace, then you have to install it manually using the following steps

  • Select Help -> Install New Software.
  • Click on the Add button.
Tycho install
Tycho install
  • Select the "Tycho Project Configurators" and click on Next.
Tycho install
  • Accept the terms of use and click on Finish.
  • Update your project: Select the package "org.eclipse.om2m" -> right click -> maven -> update Project.

Clone OM2M using Eclipse

  • Select Windiow->Show View -> Other .
  • In the dialog box, select the Git view.
  • Click on “Clone a Git repository”.
Git clone
  • In the second page, keep the “master” branch checkbox selected and click Next.
Git clone
  • In the third page, check the “import all existing projects after clone finishes” and click “Finish”.
Git clone
  • The OM2M project is now cloned and is visible on the Git repositories’ and Package’ explorers.

Build OM2M using Eclipse

  • Select “org.eclipse.om2m” package and right click. Select “Run as -> maven install”.
  • Two Eclipse products will be generated after a successful built:
    • The IN product can be found on this directory: "om2m/org.eclipse.om2m/org.eclipse.om2m.site.in-cse/target/products/in-cse/<os>/<ws>/<arch>"
    • The MN product can be found on this directory: "om2m/org.eclipse.om2m/org.eclipse.om2m.site.mn-cse/target/products/mn-cse/<os>/<ws>/<arch>"
    • The ASN product can be found on this directory: "om2m/org.eclipse.om2m/org.eclipse.om2m.site.asn-cse/target/products/asn-cse/<os>/<ws>/<arch>"

Test OM2M

  • Go to the IN-CSE product directory: "om2m/org.eclipse.om2m/org.eclipse.om2m.site.in-cse/target/products/in-cse/<os>/<ws>/<arch>".
  • Start the IN-CSE by executing the "start.bat" script on windows or "start.sh" on Linux and Mac OS.
  • Once the IN-CSE is started, you will see an OSGi console. You can type “ss” to report a summary status of all installed bundles. Type "exit" to shutdown.
IN-CSE OSGi console
  • Open your browser and connect to the address "http://127.0.0.1:8080/webpage" to access the IN-CSE web interface.
  • Enter username "admin" and password "admin" then click on login button to display the IN-CSE resource tree.
IN-CSE web interface: authentication
  • After a successful authentication, the in-cse resource will be displayed. You can see the "in-cse" CseBase sub-resources and attributes.
IN-CSE web interface: in-cse cseBase resource
  • Congratulation!! You built and started OM2M successfully.

Back to the top