Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
OM2M/one/Clone
< OM2M | one
Revision as of 18:06, 23 May 2019 by Benalaya.sensinov.com (Talk | contribs) (→build OM2M using command line)
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 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 -DskipTests=true
- 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 for RCP and RAP Developers
- Install Eclipse Luna (Eclipse for RCP and RAP Developers).
- You can download it from this link: https://eclipse.org/downloads/packages/eclipse-rcp-and-rap-developers/lunasr2
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.
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.
- Update your project: Select the package "org.eclipse.om2m" -> right click -> maven -> update Project.
Clone OM2M using Eclipse
- Select Window->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 you still have an error on Tycho plugin lifecycle, check that you have downloaded the right Eclipse version (RCP and RAP Developers)
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.
- WARNING for Windows users: don't double click on the "start.bat" file from Eclipse explorer on Windows. This cause unwanted loading of bundles and the platform will NOT be launched. Use the File Explorer instead.
- 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.
- 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.
- After a successful authentication, the in-cse resource will be displayed. You can see the "in-cse" CseBase sub-resources and attributes.
- Congratulation!! You built and started OM2M successfully.