Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
Showing results for 
Search instead for 
Did you mean: 

Prerequisite: download and configure Maven in your laptop. Once done, type "mvn" in command line and you should observe the following output by Maven:

Suppose I have a simple Java project with following package hierarchy:

The source code of MavenSandboxTest is also very simple:

import static org.junit.Assert.assertEquals;
import org.junit.Test;
public class MavenSandboxTest {
public void test() {
MavenSandbox tool = new MavenSandbox();
assertEquals(tool.hello(),"Hello world");

How to build this simple Java project using Maven?

Create a pom.xml under the root folder of your project,

and paste the following source code:

<?xml version="1.0" encoding="UTF-8"?> 
<project xmlns="" xmlns:xsi=""

Create a new Configuration:

Specify the following settings and click run:

If everything goes well, you should see the Build Success message:

and there will be a new folder "target" generated automatically:

go to folder classes, and you can execute the compiled java class via command "java":

or you can also directly execute the jar file via the command below ( you should first navigate back to target folder )

since we have specified the dependency of JUnit with version 4.10 in pom.xml:

so when "mvn clean install" is executed, you can observe the corresponding jar file is automatically downloaded by Maven:

Finally you could find the downloaded jar file from this folder: