A minimal set of prerequisites must be installed on our developer machine to build applications using the SAP Cloud SDK.
After completing this lesson, you will be able to:
A minimal set of prerequisites must be installed on our developer machine to build applications using the SAP Cloud SDK.
Apache TomEE (pronounced "Tommy") is the Java Enterprise Edition of Apache Tomcat (Tomcat + Java EE = TomEE) that combines several Java enterprise projects including Apache OpenEJB, Apache OpenWebBeans, Apache OpenJPA, Apache MyFaces, and others. In October 2011, the project obtained certification by Oracle Corporation as a compatible implementation of the Java EE 6 Web Profile.
You can find detailed information about Apache TomEE at https://tomee.apache.org.
SAP provides an enhanced buildpack for Java. The SAP buildpack provides additional containers for TomEE and TomEE7.
The standard Cloud Foundry buildpack for Java is called java_buildpack. This buildpack provides a container for Tomcat. You can find detailed information at: https://github.com/cloudfoundry/java-buildpack
SAP extended the standard buildpack and created a new one called sap_java_buildpack. This buildpack provides containers for Tomcat, TomEE, TomEE 7. You can find detailed information at https://help.sap.com/viewer/product/BTP then navigate to Develop → Develop Applications → Development in the Cloud Foundry Environment → Developing Applications and Services → Development Languages → Developing Java in the Cloud Foundry Environment(link).
Maven is a build automation tool used primarily for Java projects. The Maven project is hosted by the Apache Software Foundation.
Maven addresses two aspects of building software: how software is built, and its dependencies.
Unlike earlier tools like Apache Ant, Maven uses conventions for the build procedure, and only exceptions need to be written down. An XML file (named pom.xml) describes the software project being built, its dependencies on other external modules and components, the build order, directories, and required plug-ins. It comes with pre-defined targets for performing certain well-defined tasks such as compilation of code and its packaging.
Maven dynamically downloads Java libraries and Maven plug-ins from one or more repositories, such as, the Maven 2 Central Repository, and stores them in a local cache. This local cache of downloaded artifacts can also be updated with artifacts created by local projects. Public repositories can also be updated.
The basic Maven command you'll use to build a Java application is:
Further information to use Maven can be found in the official web site at https://maven.apache.org.
The project is deployed to Cloud Foundry based on the deployment information specified in the manifest.yml file by executing cf push
. For example, given the information specified in the figure:
Further information about the Cloud Foundry push command is available at: https://docs.cloudfoundry.org/devguide/push.html
The Spring Framework is an open source application framework for the Java platform.
It provides comrehensive infrastructure support for developing Java applications.
It also handles the infrastructure so that the developers can focus on the application.
It is developed by Pivotal Software and distributed under the open source Apache Licence 2.0.
Spring Boot is used to build stand-alone and production-ready spring applications. In particular, Spring Boot Web applications are recognized by common development environments and run with one click, helping the developer to be more productive.
Additional information about Spring is available at http://spring.io.
Let's examine debugging using the Visual Studio Code debugger.
To debug using Visual Studio Code debugger, complete the following steps:
{
"type": "java",
"name": "Attach Java Debugger",
"request": "attach",
"hostName": "localhost",
"port": 5005,
"sourcePaths": [
"${workspaceFolder}"
]
}
Let us move on to debugging using the IntelliJ IDEA debugger.
To debug using IntelliJ IDEA debugger, complete the following steps:
We wish to debug the application running in Cloud Foundry using the debugger installed on our local computer, for example, Eclipse, IntelliJ IDEA, or Visual Studio Code.
Use the following steps:
cf set-env <<application name>> JBP_CONFIG_JAVA_OPTS "[java_opts: '-Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=n']"
Log in to track your progress & complete quizzes