You are on page 1of 13

openSAP

Developing Java-Based Apps on SAP Cloud


Platform* (Update Q1/2017)
*) Please note: SAP HANA Cloud Platform is being renamed to SAP Cloud Platform.

Week 0 Unit 1

00:00:11 Hello and welcome to the system preparation Unit 1 of the openSAP course "Developing
Java- Based Apps on SAP HANA Cloud Platform". In this unit we will look at how you get
your account
00:00:25 and you will get a very short introduction into what SAP HANA Cloud Platform is. So this is
our big architecture picture.
00:00:35 What is SAP HANA Cloud Platform? It's a platform-as-a-service offering from SAP
00:00:42 and you can use it to build new applications, to extend existing applications, and also to
build integrations between cloud systems, between on-premise systems,
00:00:53 and between cloud and on-premise systems, especially for your hybrid landscapes. So at
the bottom you see our infrastructure layer.
00:01:03 This is offered so SAP HANA Cloud Platform runs in our SAP data centers, and also in non-
SAP data centers.
00:01:15 In the big middle part, you see what's actually offered by the platform. So you see our data
and storage services, especially with SAP HANA.
00:01:25 You see our platform services for integration variety, for collaboration, and many more
capabilities. And we also have some business services, we have services for DevOps,
00:01:38 and also we have our runtimes and programming languages which you can use to write
your applications. On the left side, you see the on-premise and managed cloud some of
those products offered by SAP.
00:01:54 And those are displayed here because you can use SAP HANA Cloud Platform to build
extensions for those and also to integrate with those.
00:02:03 On the right side, you see some of our software-as-a-service products. And you can also
extend those with Cloud Platform.
00:02:13 So SAP HANA Cloud Platform, especially on this course, will be used to build a new Java-
based application with SAP HANA as a database in the background.
00:02:25 Here, also some stuff which I already mentioned. It's really a platform-as-a-service offering.
00:02:32 So it's not an infrastructure service offering, it's also not a software-as-a-service offering, it's
really a platform-as-a-service offering.
00:02:39 It has multiple runtimes, for example the Java runtime which we will be using very heavily. It
also offers the SAP HANA XS runtime, and the HTML5 program model, which we will also
use for our front end with SAPUI5 and Fiori.
00:02:56 Some of the big services include our persistence service which gives you access to the SAP
HANA database, as well as document service and the security and connectivity services.

00:03:07 I would also like to highlight our openSAP course "SAP HANA Cloud Platform Essentials".
That's really a basic openSAP course which gives you a broad understanding about
different parts of the platform.
00:03:20 And you can just click here on the link if you have not yet joined that course. And click on
the link and then do this course in a self-paced mode.
00:03:30 If you want to get a first introduction, this course is very good. Our current course is then
more focused on the advanced stuff.
00:03:42 As this is the system preparation unit, and we will be getting our first SAP HANA Cloud
Platform account if you don't yet have one, what does this account actually involve? What
does it have? What's in it?
00:03:56 So an account can hold resources that can be consumed by your application's resources,
for example your Java servers or space for a database.
00:04:09 Then you also have users in your account. For your developer accounts it's only you as the
single user, as the developer there,
00:04:17 but also in productive accounts you can have administrators, additional developers, and
much more. Then also an account holds applications.
00:04:25 So you can build applications, deploy them there, run them there, then those applications
are in the account, and use the resources offered by that account.
00:04:36 Then we also have the data. So it can be data which you write into your database via the
persistence service,
00:04:42 or also data which you store in the document service or in a Git repository, your source
code. Then also configurations, for example destinations which you use to interface to
different systems,
00:04:55 or also security configurations. And each account is always designated and assigned to a
data center.
00:05:03 And this data center for the trial landscape, we have one specific data center, and on a
productive landscape you really choose which data center you want.
00:05:12 For example, if you're a Japanese customer, you would choose your data center in Japan.
And then also each account on our platform is fully isolated,
00:05:22 meaning what you do in your account does not affect what someone else does in their
account, and nobody else can see the data which is in your account, only you.
00:05:34 So now going a bit deeper, the applications in your account. So those applications are
always managed by users.
00:05:42 So the users in your account can manage those applications, can start/stop them, and so
on. Those applications also consume resources.
00:05:50 For example, if you want to run a Java application, you need at least one small Java server
to run that application. On the trial landscape, we currently only have one Java server
available to each developer,
00:06:04 so you can only run one Java application at a time. Also then those applications create and
consume data.
00:06:14 For example, they write data to your database, they read data from the database, they
consume configurations. For example, security configurations or destinations which then
link to an on-premise system
00:06:26 via the cloud connector or to another cloud system. And the applications each run in a
defined data center, as mentioned before as well.
00:06:36 Now the account cockpit. We will briefly have a look at this as well.
00:06:41 So the account cockpit is really your central point for all administration purposes, for your
account and for your applications. You can configure all security aspects there.
00:06:54 You can use that to deploy applications, to start and stop applications, to look at monitoring
or logging data of your applications, and so on. That's also what you can access there.

00:07:08 We also offer Eclipse and integration with Eclipse for doing many of those things. But really
the main point for all administration stuff is the cockpit.
00:07:19 You can also see there what resources are available to your account, and if you're in
productive landscape, you could also assign resources between accounts via the cockpit.
00:07:31 Now let's get into our first hands-on part. We will have a look at the Web site of SAP HANA
Cloud Platform,
00:07:39 and then we will also sign up for our account, register for an account, log in, and then we
will have a look at what the cockpit offers.

2
00:07:50 So you can now click on the first link displayed on the slides. Just download the slides, click
on the first link on that slide,
00:07:58 or just here, use this and type in "hcp.sap.com". That's the other solution.
00:08:06 So this is really the Web site for SAP HANA Cloud Platform. And there we offer many
resources and then links to even more resources.
00:08:17 Then if you have a look at the Web site, you can read a bit about SAP HANA Cloud
Platform, you can read about popular features and our services.
00:08:27 The services are categorized by capabilities. So here you can see the capabilities that are
offered by the platform, if you want to have a look... download the infographics.
00:08:39 You can also read about scenarios, so success stories about many of our customers and
partners. Here you can also have a look at the App Center where partners offer apps built
on SAP HANA Cloud Platform.
00:08:55 And then you can also explore some tutorials, blogs, and getting started information here.
But now let's click "Goto HCP",
00:09:06 and this will take you directly to the "Log On" or "Register" screen. So if you already have an
account, just type in your information.
00:09:14 If not, click here on "Register" you are now registering for a free developer account and
this account is free forever.
00:09:23 So it's not a 30-day trial or so, so it's really a free account, but with limited resources. Type
in first name, last name, e-mail address, password.
00:09:34 Then you can put your contact preferences in here, read through the terms and conditions,
accept them, and then click on "Register".
00:09:42 If you do that, you will be sent an e-mail. Open your e-mail inbox and then click the link
there, and then you will be brought into the sign-
00:09:53 I will have to press that one again because I already have an account here, and I will log in.
00:10:02 So now we are taken automatically to the cockpit. Here we see my trial account, and that's
the overview page.
00:10:12 We see a bit about the system status, so if you had applications already running there or
database systems, this would be displayed here.
00:10:20 We could also have favorite applications, and some account information is also shown here.
For example, you see your account name here, which is this "p" user, your SCN user,

00:10:33 and then also with "trial" at the end. If you click on here on the right, on this little icon with
the head here,
00:10:43 on the "User Info" item, you see also your user name, your "p" number, and also your e-mail
address. And this really is your user ID, and it might be important to know where you can
have a look at this,
00:10:58 and you might need to use it later. So what else do we see here?
00:11:03 When we click here, we also see the data centers. So this account is an account on a trial
landscape, so in Europe it's a specific trial landscape.
00:11:12 Then you see your account here. You can have a look at applications.
00:11:17 For example, here if you had Java applications running here you would see them here
you could deploy applications, HTML5 applications, here the same.
00:11:28 You can then also look at the services offered by the platform here, so those services which
are currently available for your account, so some of those resources mentioned before.

00:11:40 You see here collaboration services, for example which we will be using later, the
persistence service, some DevOp services, some integration services, and mobile services.

00:11:52 And here then also for security we will be using those later as well and some services in
the UX area. If you click on "Persistence", you can see your schemas here under
"Databases & Schemas".

3
00:12:07 Or here you could also create a new HANA database. Then under "Connectivity" you would
see connected cloud connectors.
00:12:17 So the cloud connector is used to connect to an on-premise system or "Destinations", for
example to cloud systems. Here you have your security settings, you have your
"Repositories",
00:12:29 so either "Document Repositories" or "Git Repositories" for source code. And you could
have a look at the resource consumption.
00:12:38 Here under "Useful Links" we really have some very important things. One is, for example,
the "Documentation".
00:12:46 So if you click on that link, you are taken to the documentation. The link is
"help.hana.ondemand.com".
00:12:52 And here you really see a lot of information about the services, how you build applications
and how you use different parts of the platform.
00:13:02 So if you have questions, this is probably the first place you would like to look in case your
question is already answered there. Then what else do we have here?
00:13:13 We have our "Release Notes", so we release every two weeks on the platform. You could
see here what's new on the platform if you click on the Release Notes.
00:13:21 Then we have our "Tools" page we will be using this in the next unit because then we will
be setting up our Eclipse. And then we also have links to "Community" and "Newsletter".
00:13:35 So the Community is very important as you can ask questions there and get answers. You
can also see blogs, what other people are writing about the platform, what they are doing
with the platform,
00:13:46 so it's very interesting what you can do there as well. And with this, we had a look at the
account cockpit.
00:13:55 What else? Where you can get additional information. And with this we are at the end of this
unit.
00:14:01 So what did you learn? You got an elevator pitch about the platform what the platform is
and what it offers.
00:14:08 You also created your free developer account on the SAP HANA Cloud Platform. You had a
look around the cockpit, and at what's offered in the cockpit, what you can do there.
00:14:20 And then you could also see the first steps on how you might develop there, so how you
deploy, for example, a Java application, and then can use it there.
00:14:30 Thanks a lot for listening and see you in the next unit.

4
Week 0 Unit 2

00:00:13 Hello and welcome to the system preparation Unit 2 of the openSAP course "Developing
Java- Based Apps on SAP HANA Cloud Platform". In this unit we will set up our local
developer environment based on Eclipse.
00:00:30 So first let's recap why we are doing this. We are doing this because we want to use the
Java Runtime in this course.
00:00:38 And for the Java Runtime we use Eclipse as our developer environment. The Java Runtime
enables developers to leverage what they also know, so especially the Java developers,
00:00:51 and as Java is also a very widespread programming language. Therefore, we also put Java
servers based on Tomcat on our Cloud Platform
00:01:02 and offer an Eclipse integration with our platform Eclipse tools to use, to develop, with Java
for SAP HANA Cloud Platform. Key capabilities of this are that you use Java to develop
your applications, Eclipse also there.
00:01:18 Then to deploy the applications directly from Eclipse or via the cockpit, and then you can
also run and administer those Java applications in the cockpit.
00:01:29 Applications run in a runtime container based here on Tomcat. And currently we have SDKs
supported for Java 6, 7, and 8.
00:01:45 And it's really standards-based Java development so nothing big SAP-specific, just
standards-based Java development with the use of the very widespread Apache Tomcat
Web container.
00:02:02 Here we mainly use Eclipse as our developer environment, so it can come in two flavors
either SAP HANA Studio, which is mainly focused on SAP HANA development,
00:02:16 but you can also install the tools there to extend this with capabilities for Java development.
And then generally we offer the SAP HANA Cloud Platform tools,
00:02:27 and those are the tools you need to develop for Cloud Platform with Java. And you use
them, install them, for your Eclipse on your local machine, and then you have an SAP
HANA Cloud Platform-flavored Eclipse.
00:02:43 So key capabilities of Eclipse here it's really a full IDE, a fully integrated developer
environment. You can use that for offline development, and then when you have an Internet
connection, push your application to the cloud.
00:02:58 But also you can use it any time. You also have full access to all your Java developer plug-
ins which you know and love from Eclipse development from former times.
00:03:14 And here you can really leverage this huge ecosystem which is out there for standards-
based Java development. So now let's get into the hands-on part.
00:03:27 First, it's really important that you have a Java Development Kit installed on your machine.
You need Java first to run Eclipse.
00:03:35 And then you really need the development kit to build your applications. What we'll do first is
download and install Eclipse IDE for Java EE Developers,
00:03:50 then install the SAP HANA Cloud Platform tools for Java, then install the SAP HANA Cloud
Platform SDK, and set this up in Eclipse,
00:04:01 and that's as a runtime environment so that we can use this. So with this, we are again in
the cockpit, like the unit before.
00:04:14 When you click on "Useful Links" and then "Tools", you are taken to the tools page
"tools.hana.ondemand.com". There you select the tab "CLOUD".
00:04:24 And here you then see more or less the steps you need to do first. Let's get Eclipse, so we
click on the "Eclipse" link and download the "Eclipse IDE for Java EE Developers".
00:04:38 Here we currently support Eclipse Mars and Eclipse Neon. I would always advise you to set
up a new system to do this here and to always use the newest supported release of Eclipse.

00:04:53 So here just download the package and then unzip in a folder of your choice, and then you
can start your Eclipse. I already did this so I have my Eclipse already started here.

5
00:05:08 So what's the next step? By the way, we also have a link here at the bottom, which you can
click on.
00:05:17 Just download the slides below the video and then click on that link, which gives you step-
by-step information on how you install all those tools,
00:05:29 with screenshots so you can really follow along here. So when you start Eclipse, you will be
asked for a workspace.
00:05:38 Just select the workspace there, then you're on the welcome page. The next step we need
to do here is install new software... the tools.
00:05:46 So you can just take the tooling from here, or you take the tooling from here.
00:05:52 Just copy that link. And when you've done that, you can open your Eclipse window,
00:06:04 and... oh no, it was under "Help", "Install New Software". And then with "Add" you can put
the name in,
00:06:11 put the location for the tools in here, and then click "OK". So I already put them in...
00:06:18 and they are here. So now you're offered all the tools which we offer for Eclipse.
00:06:24 All the plug-ins you see some for ABAP development, for HANA development, and also
here for HANA Cloud Platform development, also SAPUI5 development.
00:06:36 Usually I would just say "Select All" you don't know what you will need in the future, so
just installing all of them would be my preference.
00:06:46 I already did this. So you just click "Next", accept the installation, and when the installation
is over, you need to restart Eclipse.
00:06:57 So now with this done, you will then have installed the SAP HANA Cloud Platform tools in
your Eclipse. If you face errors while you try to install this, so if you can't reach the update
site,
00:07:13 it might be the case that you are working behind a proxy but haven't configured this proxy in
your Eclipse. So here you just go to the settings, type in "proxy",
00:07:26 and then you would see here you could put in a proxy configuration depending on what you
are using. So currently I don't have a proxy selected because I'm directly connected to the
Internet.
00:07:37 If I were working behind a proxy, I would need to select "Manual" here and then enable this
stuff here, and then I could access the Internet through the proxy.
00:07:51 But as I said, I'm currently not behind a proxy so I don't need to do this. So, what else?
00:08:01 Tools are installed... restart Eclipse... Okay, next is the SAP HANA Cloud Platform
00:08:08 So for this again, we need to go here on the tools page. And here we now see the currently
offered and supported SDKs.
00:08:19 So we have Java Web SDK, which is for Java Tomcat 6. Then we have one for 7, one for 8,
and we have one for Java EE 6 Web Profile.
00:08:33 It's really here that we have brief information and explanations on what this SDK actually
means. What I would advise you to do is either download all of them, set all of them up,
00:08:45 then you are really ready for all kinds of development which might come in the future. What
we will be using for this course will be the Java Web Tomcat 8 SDK.
00:08:56 So please download this one and agree here, and then you can save this one.
00:09:07 What you do after you've saved it is unzip it and put it in a folder of your choice. So for me
I've got all my SDKs here.
00:09:20 This here, the version's 3, it's the Java Tomcat 8 SDK. What we next need to do is add this
SDK as a runtime environment in our Eclipse.
00:09:36 And we do that again, I'm now going to "Preferences", then "Server", "Runtime
Environments".
00:09:45 And here you see I've already added them before. But how does this work?
00:09:52 You go to "Add", you then select "Java Web Tomcat 8" here. That's for the Java Web
Tomcat 8 SDK.

6
00:10:01 You don't need to create a new local server right away. Just ignore this for now, then you go
to "Next".
00:10:08 And then here you can browse to the location of your SDK. And then also put a runtime
environment in here.
00:10:17 So I've currently configured from Oracle the JDK 7 and 8, and also from SAP JVM versions
7 and 8.
00:10:29 What you need to use for Java Web Tomcat 8 is one in version 8, so either the one from
Oracle or the one from
00:10:41 And then you add the SDK, and then you are finished with this step. What other instructions
are there here?
00:10:52 Download the SDK; add it as a runtime environment. Here it's described for the Java Web
but it works similar to each other SDK as well.
00:11:03 So perhaps what you might want to check if you don't know what Java version you have,
you could just go here, type "java -version" in your terminal on Mac, or in the command line
or PowerShell on Windows.
00:11:19 And you would then be shown what Java version you are currently running. So I'm currently
running a Java 8 version.
00:11:29 And you can do the same, and that's also 1.8 usually. It should always be the same.
00:11:39 And what else? So for the build-up, it might be very useful if you have also set the JDK as
the Java home environment
00:11:49 and added this to your path environment. How can you do this? Just Google it and... on
Windows, or I might show it here.
00:12:02 Here on Mac I can go into the "bash_profile". And then we see also here that I've currently
configured for Java home,
00:12:12 my installed JDK in the version 1.8. On Windows you go to your system preferences, into
your system, and then into your environment variables,
00:12:25 and then you put in this just here. So one thing if you don't want to use an Oracle JDK,
you can also use the SAP JVM.
00:12:39 So let's go to the documentation because the steps are explained there. And... then see...
here.
00:12:53 So where was it? "Setting Up the Development Environment" and then "(Optional) Installing
SAP JVM".
00:13:03 So if you want to use the SAP JVM, here are the steps on how you can install this as well.
And then how you can add the SAP JVM in Eclipse as an installed JRE.
00:13:17 So if I look into my Eclipse, under "Preferences"... "jre"... then I can see here my installed
JREs, and currently I have four JREs installed here:
00:13:34 the two named from Oracle and then also the two named here from SAP. And my standard
"vm" which I use for all builds currently in Eclipse is the SAP JVM 8.
00:13:47 So I'm running more the Oracle JVM 8 for generally running Java applications, for example
here also for running Eclipse.
00:13:57 And then I'm using the SAP JVM to build my SAP projects for SAP HANA Cloud Platform.
But this is really just if you're facing errors you might want to check if this is set,
00:14:12 and you might want to use the SAP JVM but you don't have to. So there was one more
step.
00:14:21 We have now done this hands-on part. But to really check if everything's working fine, we
can also do this here.
00:14:30 So for the second tutorial, just click on the link here and we will create a very simple
HelloWorld. And we can test this locally and then we can test this also in the cloud.
00:14:42 For this, let's first open up this tutorial this here. Let's close this and this.
00:14:52 And then if you are here, you are really shown what steps you need to do. We will open the
Java EE perspective, we will create a dynamic Web project, and then we will use runtime to
do that.

7
00:15:09 In our case, we will just use Tomcat 8 here. We will be using this later on as well.
00:15:15 Then we will deploy this. So... here I've already opened the Java EE perspective.
00:15:24 If you haven't yet, you can just do this here. Then "New"... "Dynamic Web Project"...
00:15:33 "helloworld"... for target runtime let's take "Java Web Tomcat 8". Everything else is fine.
00:15:44 Okay. That's fine.
00:15:50 "Finish". Then...
00:15:57 we see this project which we just created. So what are the next steps?
00:16:03 The next steps are that for that project we need to create a new servlet so that we can then
also deploy this to the Cloud Platform. There's a name here, and then while creating this
servlet we can also change the URL mapping
00:16:18 so that our application directly starts without us needing to put in this additional URL part.
So "New", "Servlet"...
00:16:31 What was the suggested package name? "helloworld"... "HelloWorldServlet"...
00:16:44 Here with the URL mapping as mentioned, just delete the "HelloWorldServlet" part and just
leave in the slash. Everything's fine.
00:16:56 Now we have our first servlet here. What else can we do here?
00:17:05 We can see the servlet here. Okay, I suggest that here we update the doGet method to print
out a "Hello World!"
00:17:19 "doGet"... let's update this one... save it... Okay, we've done that.
00:17:30 And then we can run this on a local server and also we can run this in the cloud. So let's do
this.
00:17:39 We right-click on our "helloworld" project... "Run As" and "Run on Server".
00:17:44 First let's do this locally, so we manually define a new server. We select Java Web Tomcat
8 Server.
00:17:53 Okay, that's all fine. We have configured our "helloworld" application and we can click on
"Finish",
00:18:00 and the server will start up. I've done that already here.
00:18:03 So then also here your URL should open up automatically, either directly in Eclipse or in
your browser, depending on how you configure that.
00:18:14 You see it here, it's running on "localhost", and it's displaying my "Hello World!" application.

00:18:21 Next let's do the same for our Cloud Platform as well. "Run As"... "Run on Server"...
00:18:28 Then we select SAP HANA Cloud Platform here as our server. We select our trial
landscape, "hanatrial.ondemand.com".
00:18:41 Go "Next"... "helloworld" application, "Automatic" runtime that's fine.
00:18:46 And then we put in our account name, user name, and password here. If you don't know
your account name and your user name, just go to your account.
00:18:57 And here you see your account name on the overview at the bottom left. And for your user
name, you click on the user information at the top right,
00:19:08 and then you see the ID here, which is your user name. Okay we do that... "Next"...
00:19:16 configure the "helloworld" application and click "Finish". Then it takes a bit of time for the
server to start
00:19:22 Therefore, I did this beforehand as well. "Application URL"... "Open"...
00:19:26 Here again, the application URL should automatically open. I've done that here now, it's
running on my trial account.
00:19:34 Here we see "Hello World!" So we can also then have a look at our Java applications in our
cockpit.
00:19:43 And here we see the application running, and here we could also click on this application
URL to call it up.

8
00:19:52 And that's the application. Okay, and with this...
00:19:58 What did we do? We deployed locally. We deployed to the cloud.
00:20:04 And with this, that's done as well. And we are at the end of this unit.
00:20:09 So what did we learn? We learned a bit about what the Java Runtime offers,
00:20:13 what the Eclipse IDE and the integration with SAP HANA Cloud Platform offers there. We
set up our Eclipse, configured the SDKs and so on,
00:20:23 and we tested this whole thing out with a simple "HelloWorld" application locally and in the
cloud. Thanks a lot and see you in the next unit.

9
Week 0 Unit 3

00:00:11 Hello and welcome to the system preparation Unit 3 of the openSAP course "Developing
Java- Based Apps on SAP HANA Cloud Platform". In this unit, we will set up our Git and
Maven.
00:00:25 These are two parts in our developer environment which we will be using later in this
course. So first what actually is Git?
00:00:34 Git is a version control system for distributed versioning. It was created in 2005, originally
for Linux kernel development.
00:00:45 And it enables collaborative workflows very well, meaning that you can develop as a team
with multiple developers for one project,
00:00:57 and then also put your code together to develop on one project. We will be using Git as our
version control system for the whole of this course.
00:01:08 And also it's very widely used on SAP HANA Cloud Platform and also on SAP HANA. And
so it might be very useful for you to have a look at this.
00:01:21 So at the bottom left you can also see a link to the Git Web site where you can read a bit
more. But generally, how does it work compared to some other version control systems
which you might know?
00:01:34 Like Subversion or Perforce two very big ones, especially in the past. But I would
personally say Git currently has gained a lot more attraction and is more widespread.
00:01:47 So here you have your central server and then also the other versions. This with central
versioning and then a developer has only his local files.
00:02:01 And only if he commits something to the server is everything then available on the server.
What about distributed versioning?
00:02:09 Like with Git, there each developer has all the code, so all the branches. Everything is there
and also everything is on the server,
00:02:19 but each developer also has everything on his local machine, meaning you don't always
need to have an Internet connection, you also always have everything on your local
machine,
00:02:29 which also usually gives you some speed advantage. Also how you can work with multiple
developers on this.
00:02:38 Usually on a big project you would create a new branch. This would be your branch where
you develop your code.
00:02:45 And then when you're finished with this part of your code which you are developing, you
would be pushing and merging this branch into the master branch.
00:02:55 So that would be the way you bring your own code into a bigger application. You won't be
using it in this way for this course,
00:03:04 it will be more like you will be downloading the code and different branches of the code for
different units and to look at different aspects of the platform
00:03:13 and these are different aspects of the application which we are using in this course. So let's
have a short look at the Git Web site.
00:03:24 So this here is the Git Web site. You can read a bit about it and you can also download it
here.
00:03:34 EGit is the integration of Eclipse with Git. So Git, or at least a part of a Git client, is brought
to you with the Eclipse environment which we downloaded in the previous unit.
00:03:50 So the Eclipse for Java EE developers, their Git comes through the plug-in of EGit with
Eclipse already. So you might just use Git via EGit via your Eclipse.
00:04:06 Here is the link for the Web site. So here you could also have a look at the Web site.
00:04:12 You don't need to download this. Sorry, I'll just click this link.
00:04:16 You can read about how this works. And now let's also have a look at EGit in our Eclipse
environment.
00:04:28 So here we have our Eclipse. And when we go here on our views, we can select the Git
view here.

10
00:04:37 And this way here is now the Git view which we can use to clone a Git repository, "cloning a
repository" meaning from a central server.
00:04:49 I download all the code so that I can then also use this locally. And that's exactly how we
will be using Git.
00:04:59 We will clone the repository and then check out different branches depending on what we
want to We already have installed this part of Git,
00:05:10 and if you like, you can stop here. But I personally also sometimes like to have the
command lines still available to me and have Git installed there as well if I want to use it.
00:05:25 You do that by going to the Git Web site, downloading your Git client here, and then install
this one. I've already done that so I could say "git -- version",
00:05:40 and I see here that Git is already installed on my machine. And with this, I've got two Git
clients more or less installed.
00:05:51 One already inside Eclipse and one directly on my machine in the path environment so that
I can use it directly for my command line.
00:06:03 So that was the part of Git, and next let's go to Maven. Maven is an Apache project
Apache Maven and it's a build management tool.
00:06:15 We will be using Maven mainly so that each library which we are using will be fetched
automatically and does not have to be brought with the application.
00:06:29 So Maven will be fetching each library we are using automatically for you. Maven was
created in 2002 to simplify the build project of the Apache Turbine project.
00:06:42 So it was one Apache project. And to simplify the build here, this was created,
00:06:49 and now the use is probably even more widespread. A very important concept here with
Apache Maven is the POM, so the project object model.
00:07:01 The POM specifies all the dependencies your application has. So if you're using a library,
for example a logging library in your application,
00:07:11 you could specify the dependency here in the And this... if the application was to be built
with Maven, you would do a Maven build,
00:07:20 then this library would be automatically fetched from a central server and then it would be
available in your application. And really the primary goal of Maven is to enable developers
to understand a complete state of a development project
00:07:41 in the shortest possible time. So here that's also one of the big parts that Maven does,
which we won't be using that much.
00:07:50 We will mainly focus just on the build part, but here it really also gives us a lot of abilities to
quickly switch between libraries which we are using,
00:08:00 and also so that we don't have to provide you with all the libraries which we are using. So
you can fetch them yourself automatically on the Internet.
00:08:10 So here we have also put in the Apache Maven Web site. If you like to just have a look at
the Web site, and you can also download Maven and then start it in the command line.
00:08:23 We will do this in just a minute. And then it's similar with Git.
00:08:30 First, let's go into a short explanation of the So it's a file pom.xml, it's an XML file.
00:08:37 Project object model is what POM means, I already mentioned that. And it's the basic unit of
work in Maven.
00:08:45 On the right side, you see a short POM, what that might look like. And here the "junit" library
is used in one version, so the version 4.11.
00:08:58 And that POM would say in your application during the build this library is fetched and put
into your application so that it's available for your application.
00:09:11 So if you want to see what libraries are used in a project and the project uses Maven, just
have a look at the POM and there you see it. Similar to Git, what's offered there with EGit,
we have M2Eclipse or M2E, which is a Maven integration for Eclipse.
00:09:32 And this is also already included with the Eclipse for Java EE Developers, but you can also
still use the command line.

11
00:09:42 So first let's check out the Web site here, M2E. You can read a bit about what it is, and also
if you want to find out more, you can do that via the Web site.
00:09:58 What we will be doing now is having a look at this through Eclipse because it's already
included. And then as a second step, I personally like to have it also available in my
command line.
00:10:11 So I also install it there. You don't need to do the second step, it's just if you want to, you
can do it.
00:10:20 So let's have a look at Git... go to the Java EE perspective again. And then what we might
see here is when we click on a project, we see if we would have a Maven project here.
00:10:36 We would see here some profiles which we might be using, for example a Maven update
dependencies. Or we could also do a "Run As" as a Maven build.
00:10:48 We'll then be directly using those in the next few weeks when we will be working with our
sample application. The second part of this was downloading Maven, adding it to the
command line,
00:11:05 if you want to use it there as well. So this part here is optional.
00:11:10 You can do that by downloading Maven here for your machine. What's important here is
that you need Java Development Kit installed
00:11:22 and also configured for your Java home environment variable. So if I go to my command
line... or perhaps I can show it to you here...
00:11:31 So here I have my Apache Maven. Under your applications, you just download the zip,
unzip it, and then you need to add the "bin" folder to your path variable.
00:11:45 So when I'm "mvn"... it's the comment... When I call this here I see I've got Maven installed,
it's in my application path.
00:11:57 The Java version that's used here is this one, and when I go to... into my "bash_profile", I
also see that I have added it here to my application path.
00:12:16 So on Windows, you would just go to system environment variables and then add the
Maven bin folder there, to your path environment variable so then it's always available in
your command line and also in PowerShell.
00:12:36 And with this, we have installed Maven here. Here, if you have problems with the
installation, you can also read about how the installation works and then do it via this.
00:12:54 And with this, we have also tested with the comment "mvn-v", tested whether it works,
whether it's available, what version it is.
00:13:05 And same is also done for Git. With this, we are already at the end of this unit.
00:13:12 So you've seen what Git is, how it's integrated with Eclipse, and also how you might
download it and just use it from the command line.
00:13:24 On the Git Web site, there is also much more information available if you don't know Git
from before and you want to read a bit more about it.
00:13:34 Then we have taken a look at Maven and how Maven works and how Eclipse and Maven
work together. Perhaps as one last thing I might show you the Web site github.com.
00:13:49 So we will be using this Web site in this course. So the link would be github.com/sap.
00:14:02 There SAP offers a lot of applications, and one of these will also be the application which
we will be using in this course.
00:14:11 And GitHub is a separate company. It uses the open-source Git server for versioning, but
does its own version of that one.
00:14:25 So in the GitHub enterprise server it offers them as a service in the cloud but also as an on-
premise installation. And, for example, SAP uses that one to offer applications for you,
sample applications.
00:14:41 And you can, for example, if you're here on such an application, you could just copy a link
here and then clone this repository for this application into your Eclipse.
00:14:57 With this now, we are really at the end of this unit. Thanks a lot and see you next week.

12
www.sap.com

2017 SAP SE or an SAP affiliate company. All rights reserved.


No part of this publication may be reproduced or transmitted in any form or
for any purpose without the express permission of SAP SE or an SAP affiliate
company.
SAP and other SAP products and services mentioned herein as well as their
respective logos are trademarks or registered trademarks of SAP SE (or an
SAP affiliate company) in Germany and other countries. Please see
http://global12.sap.com/corporate-en/legal/copyright/index.epx for additional
trademark information and notices.
Some software products marketed by SAP SE and its distributors contain
proprietary software components of other software vendors.
National product specifications may vary.
These materials are provided by SAP SE or an SAP affiliate company for
informational purposes only, without representation or warranty of any kind,
and SAP SE or its affiliated companies shall not be liable for errors or
omissions with respect to the materials. The only warranties for SAP SE or
SAP affiliate company products and
services are those that are set forth in the express warranty statements
accompanying such products and services, if any. Nothing herein should be
construed as constituting an additional warranty.
In particular, SAP SE or its affiliated companies have no obligation to pursue
any course of business outlined in this document or any related presentation,
or to develop
or release any functionality mentioned therein. This document, or any related
presentation, and SAP SEs or its affiliated companies strategy and possible
future developments, products, and/or platform directions and functionality
are all subject to change and may be changed by SAP SE or its affiliated
companies at any time
for any reason without notice. The information in this document is not a
commitment, promise, or legal obligation to deliver any material, code, or
functionality. All forward-looking statements are subject to various risks and
uncertainties that could cause actual results to differ materially from
expectations. Readers are cautioned not to place undue reliance on these
forward-looking statements, which speak only as of their dates, and they
should not be relied upon in making purchasing decisions.

You might also like