Skip to Content
Previous

Convert your app to a Maven-based project

By akula86

Convert your app to a Maven-based project

You will learn

In this tutorial you will learn how to convert your basic Java app into a Maven-based project which is useful to prepare for the complexities of dependency management in larger apps.

Details


Step 1: Open configuration menu

Select the weatherapp node in the project explorer and open the context menu. Select the Configure > Convert to Maven Project option.

Please log in to access this content.
Step 2: Change group ID

Change the group ID from weatherapp to com.sap.hana.cloud.samples and click on Finish. The most noticeable change will be that a pom.xml file will be created in the root folder of theweatherapp project.

Customizing Maven POM - pom.xml
Please log in to access this content.
Step 3: Replace existing content

Copy the entire content from the pom.xml file from GitHub and use it to replace the existing content in your project.

modifying the Maven pom.xml
Please log in to access this content.
Step 4: Update project

Open the context menu on the weatherapp project in the Project Explorer and select the menu entry Maven > Update Project… (The first time you do this can take a bit longer, as Maven will download all the required build plugins and dependencies specified in the pom.xml file). Make sure your project is selected then click on OK.

Please log in to access this content.
Step 5: Build

Select the Run as > Maven build… context menu of the weatherapp project and enter the following in the Goals field: clean package install.

Adding goals to the Maven Build settings
Please log in to access this content.
Step 6: Run the project

Click on Run and the project should build successfully.

Please log in to access this content.

Next Steps

Updated 03/24/2017

Time to Complete

10 min

Intermediate

Tags

Next
Back to top