Skip to Content

How to use Maven to build your SAPUI5 application


At the moment I am working as a QA officer on a SAPUI5 project at a customer. The customer has a development and QA environment containing Jenkins for CI and Sonar for quality inspection. As a QA officer I want to use these tools to ensure code quality. To be able to do so I needed to convert my standard SAPUI5 project to a Maven project. Below is a step by step guide how I achieved this.

Install Maven

Installing Maven is pretty straight forward. Follow the link below and you should be ready to start in five minutes:

Install SAPUI5 Eclipse Plugin

  • Download the latest version: , at the time of writing this was version 1.16.3
  • Howto install in eclipse
    • Extract folder “tools-updatesite”
    • Open eclipse -> Help -> Install New Software…
    • Select “Add…” -> “Local…” -> Browse to the “tools-updatesite” folder

Add SAPUI5 libraries to local Maven repository

To be able to use SAPUI5 libraries with Maven you have to add the jar files to your local Maven repository. If you use Nexus as a repository you can add the jar files there. For this example the jar files are added locally.Open a command prompt and cd to the “\tools-updatesite\plugins” folder. Execute the following commands (version numbers may vary):

  • mvn install:install-file -Dversion=1.16.3 -Dpackaging=jar
  • mvn install:install-file -Dversion=1.16.3 -Dpackaging=jar
  • mvn install:install-file -Dversion=1.16.3 -Dpackaging=jar
  • mvn install:install-file -Dversion=1.16.3 -Dpackaging=jar
  • mvn install:install-file -Dversion=1.16.3 -Dpackaging=jar
  • mvn install:install-file -Dversion=1.16.3 -Dpackaging=jar
  • mvn install:install-file -Dversion=1.16.3 -Dpackaging=jar
  • mvn install:install-file -Dversion=1.16.3 -Dpackaging=jar
  • mvn install:install-file -Dversion=1.16.3 -Dpackaging=jar
  • mvn install:install-file -Dversion=1.16.3 -Dpackaging=jar
  • mvn install:install-file -Dversion=1.16.3 -Dpackaging=jar
  • mvn install:install-file -Dversion=1.16.3 -Dpackaging=jar
  • mvn install:install-file -Dversion=1.16.3 -Dpackaging=jar
  • mvn install:install-file -Dversion=1.16.3 -Dpackaging=jar
  • mvn install:install-file -Dversion=1.16.3 -Dpackaging=jar
  • mvn install:install-file -Dversion=1.16.3 -Dpackaging=jar

Create POM

A POM file has to be created to be able to build the project and to be able to create an eclipse project for it. Also a “org.eclipse.wst.common.project.facet.core.xml” should be created in the .settings folder in your project if you want to share the project using a version control system (like SVN). This file describes the project facets to use. In my project I have started with a standard SAPUI5 application project and added the files in the project folder. I have attached both files as a reference.


Now that everything is in place the project war file can be built, this is done by executing the following command:

“mvn clean install package”

Create eclipse project <optional>

This is an optional step. If you want to use eclipse as your IDE and share the project using a version control system you don’t want to checkin your project definition files. When you have checked out the project execute the following command to create a project definition file:

“mvn eclipse:eclipse”

This creates a project for you which you can import in Eclipse. After you import the project you still have to convert the project to faceted form by opening the project properties:

After selecting “Convert to faceted form…” you have to deselect “SAPUI5 application” from the list and press “Apply”. This will update your project to use the facets. Unfortunately the SAPUI5 facet only works if it was deselected first.

After pressing “Apply” you can now select the “SAPUI5 application” item from the list and press “Apply” again.

Now you can run your application with “Web App Preview” which was not available before.

Congratulations, you are now ready to use Maven to build your project!

You must be Logged on to comment or reply to a post.
      • Whilst OpenUI5 is now open source, I can’t find a Maven distribution for it, nor does that help if I want the SAPUI5 distribution 🙁

        • Hi Chris,

          You are correct, it would be VERY nice to have OpenUI5 added to Maven Central so we can use it easily. For SAPUI5 this is different because it is not open source. These issue’s also arise with other non open source solutions where you need to add them to your repository manually. The only way to make this easier (when working with multiple developers) is to have a local repository like Nexus where you can then add the libraries once.

  • Is there meanwhile a better way to add the SAP UI5 dependencies in a maven project? What I would expect is to have a single dependency and not such a huge list.

    Thanks for your help!

    • Hi Stefan,

      When working with multiple developers you could think of installing your own local repository like Nexus where you can add the dependencies once for everyone to use. I think it is a good thing that SAP has split up the dependencies so that you only add the functionality you need in stead of just adding everything to the project.

      • Hi Ted,

        Thank you for your reply.

        The splitting of the dependencies is only the one point. I can understand that in some cases more granularity is useful and not always is easy to find the balance.

        Anyhow the need to add the dependencies in the local Maven Repository is a bad idea. Why is not possible to have the artifacts in the central Maven repository? This would make the step “Add SAPUI5 libraries to local Maven repository” obsolete and the developer would have easier way to upgrade to some new version of the library in some future point.

        Thanks for you attention!

        Best regards,


  • Hi,

    since May 2015 there are the open source web jars 🙂

    Maven Central


    The maven eclipse plugin is deprecated for a few years (replaced by m2eclipse).

    Does anybody know a good solution for working with m2eclipse?


  • Hi folks, what is the definitive solution for use SAPUI5 + Java Project + Maven? Is there a new solution to this problem?

    Should I go to OpenUI5? My company has a premium HCP account… is there a better solution that allows me to use Maven naturally (without workarounds)?