OM2M/Clone
< OM2M
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.
Contents
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 -b smart 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 NSCL product can be found on this directory: "om2m/org.eclipse.om2m/org.eclipse.om2m.site.nscl/target/products/nscl/<os>/<ws>/<arch>"
- The GSCL product can be found on this directory: "om2m/org.eclipse.om2m/org.eclipse.om2m.site.gscl/target/products/gscl/<os>/<ws>/<arch>"
Clone and build OM2M using Eclipse IDE
Install Eclipse IDE
- Install Eclipse Kepler (Eclipse for RCP and RAP Developers).
- You can download it from this link: https://www.eclipse.org/downloads/packages/eclipse-rcp-and-rap-developers/keplersr2
Configure Maven Proxy (Only if requried)
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.
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.
- Put in the name field "tycho0.8" and in the location filed this url "http://repo1.maven.org/maven2/.m2e/connectors/m2eclipse-tycho/0.8.0/N/LATEST/"
- Press on on ok button and check the "m2e extensions" and "Tycho Project Configurators" checkboxes and click on next.
- Select the "Tycho Project Configurators" and click on Next.
- Accept the terms of use and click on Finish.
Clone OM2M using Eclipse
- Select Windiow->Show View -> Other .
- In the dialog box, select the Git view.
- Click on “Clone a Git repository”.
- Clone the OM2M project using the following link: http://git.eclipse.org/gitroot/om2m/org.eclipse.om2m.git. In the first page, enter the mentioned link in the URI’s location field. Click Next .
- In the second page, keep the “master” branch checkbox selected and click Next.
- In the third page, check the “import all existing projects after clone finishes” and click “Finish”.
- The OM2M project is now cloned and is visible on the Git repositories’ and Package’ explorers.
- If some errors appears on the project, try to update it: Select the package "org.eclipse.om2m" -> right click -> maven -> update Project.
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 NSCL product can be found on this directory: "om2m/org.eclipse.om2m/org.eclipse.om2m.site.nscl/target/products/nscl/<os>/<ws>/<arch>"
- The GSCL product can be found on this directory: "om2m/org.eclipse.om2m/org.eclipse.om2m.site.gscl/target/products/gscl/<os>/<ws>/<arch>"
Test OM2M
- Go to the NSCL product directory: "om2m/org.eclipse.om2m/org.eclipse.om2m.site.nscl/target/products/nscl/<os>/<ws>/<arch>".
- Start the NSCL by executing the "start.bat" script on windows or "start.sh" on Linux and Mac OS.
- Once the NSCL 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.
- Open your browser and connect to the address "127.0.0.1:8080" to access the NSCL web interface.
- Enter username "admin" and password "admin" then click on login button to display the NSCL resource tree.
- After a successful authentication, the NSCL resource will be displayed. You can see the "nscl" SclBase sub-resources and attributes.
- Congratulation !! You built and started OM2M successfully.