Skip to content

Commit fbe327c

Browse files
authored
Improve README (#330)
Mention VS Code as supported IDE. Hint at problems with Maven CLI vs. IDE autobuild.
1 parent 9ea1986 commit fbe327c

File tree

1 file changed

+35
-27
lines changed

1 file changed

+35
-27
lines changed

README.md

Lines changed: 35 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Welcome to the bookshop-java project. It demonstrates how to build business appl
1616
- [Getting Started](#getting-started)
1717
- [Prerequisites](#prerequisites)
1818
- [Clone Build & Run](#clone-build--run)
19+
- [Using VS Code](#using-vs-code)
1920
- [Using Eclipse](#using-eclipse)
2021
- [Building and Running](#building-and-running)
2122
- [Using IntelliJ Idea (Community and Ultimate)](#using-intellij-idea-community-and-ultimate)
@@ -108,21 +109,41 @@ Make sure you have set up a development environment (that means, you’ve instal
108109

109110
## Clone Build & Run
110111

111-
1. Clone the project:
112+
1. Clone the project:
112113

113-
```bash
114+
```bash
114115
git clone https://github.com/SAP-samples/cloud-cap-samples-java.git
115-
```
116+
```
116117

117118
2. Build and run the application:
118119

119-
```
120+
```
120121
mvn spring-boot:run
121-
```
122+
```
123+
124+
> [!NOTE]
125+
> Please note that some IDEs may interfere with their autobuild when launching the application from the CLI using Maven. Therefore, please ensure that no IDEs are running in parallel or launch the application natively from your preferred IDE as described below.
126+
127+
3. Use the following links in the browser to check if everything works fine:
128+
129+
- http://localhost:8080: This should show the automatically generated index page of served paths.
130+
- http://localhost:8080/fiori.html: This is the actual bookshop application UI.
131+
- http://localhost:8080/swagger/index.html: This is providing a Swagger UI for the CatalogService API.
132+
133+
You'll start with a predefined stock of books as this procedure starts the bookshop application with a CSV-initialized in-memory H2 database.
134+
135+
Two mock users are defined for local development:
136+
- User: `user`, password: `user` to browse books
137+
- User: `admin`, password: `admin` to manage books and orders
138+
139+
## Using VS Code
140+
141+
VS Code supports the project out-of-the-box, when using the [Extension Pack for Java](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack).
142+
To launch the application in VS Code navigate to the `Application` class and click on `Run` or `Debug`.
122143

123144
## Using Eclipse
124145

125-
Optionally, use the following steps to import the project to Eclipse:
146+
Use the following steps to import the project to Eclipse:
126147

127148
1. Import the project using **File > Import > Existing Maven Projects**.
128149

@@ -149,30 +170,18 @@ Optionally, use the following steps to import the project to Eclipse:
149170

150171
Afterwards, click **Run**. This step starts the applications `main` method located in `src/main/java/my/bookshop/Application.java`.
151172

152-
4. Use the following links in the browser to check if everything works fine:
153-
154-
<http://localhost:8080/>: This should show the automatically generated index page of served paths.
155-
<http://localhost:8080/fiori.html>: This is the actual bookshop application UI.
156-
<http://localhost:8080/swagger/index.html>: This is providing a Swagger UI for the CatalogService API.
157-
158-
You'll start with a predefined stock of books as this procedure starts the bookshop application with a CSV-initialized in-memory H2 database.
159-
160-
Two mock users are defined for local development:
161-
- User: `user`, password: `user` to browse books
162-
- User: `admin`, password: `admin` to manage books and orders
163-
164173
## Using IntelliJ Idea (Community and Ultimate)
165174

166175
IntelliJ can handle the project more or less out-of-the-box. Since some of the event handlers in the project rely on
167176
the code generated from the CDS model the build path of the project (module) needs to be extended
168177
with the folder containing the generated code. In order to add the generated code you need to add the 'gen' folder
169178
to the build path:
170179

171-
* Open the project settings.
172-
* Navigate to the 'modules' section.
173-
* Select the srv/src/gen folder and mark it as 'sources'.
174-
* Save and leave the project settings.
175-
* Trigger a rebuild.
180+
1. Open the project settings.
181+
2. Navigate to the 'modules' section.
182+
3. Select the srv/src/gen folder and mark it as 'sources'.
183+
4. Save and leave the project settings.
184+
5. Trigger a rebuild.
176185

177186
After the generated code is considered by IntelliJ's build the application can be handled just as any other Spring Boot
178187
application in IntelliJ.
@@ -217,7 +226,6 @@ Prerequisites:
217226
> [!NOTE]
218227
> Please note that some IDEs may interfere with their autobuild during the MTA build and thus lead to corrupt MTA build results. Therefore, please ensure that no IDEs are running in parallel with your MTA build.
219228
220-
221229
Deploy as Single Tenant Application:
222230
- Rename `mta-single-tenant.yaml` to `mta.yaml`
223231
- Run `mbt build`
@@ -232,7 +240,7 @@ Deploy as Multitenant Application:
232240
- Go to another subaccount in your global account, under subscriptions and subscribe to the application you deployed.
233241
- Run `cf map-route bookshop-mt-app <YOUR DOMAIN> --hostname <SUBSCRIBER TENANT>-<ORG>-<SPACE>-bookshop-mt-app` or create and bind the route manually.
234242

235-
> [!NOTE]
243+
> [!NOTE]
236244
> Please note that the route length is limited to 63 characters and can easily be exceeded. So keeping the app name and sub-account subdomain as short as possible will help you stay within length.
237245
238246
Before you can access the UI using the (tenant-specific) URL to the bookshop(-mt)-app application, make sure to [Setup Authorizations in SAP Business Technology Platform](#setup-authorizations-in-sap-business-technology-platform).
@@ -492,7 +500,7 @@ docker push $YOUR_CONTAINER_REGISTRY/bookshop-approuter
492500
#### Single Tenant
493501

494502
```bash
495-
docker push $YOUR_CONTAINER_REGISTRY/bookshop-hana-deployer
503+
docker push $YOUR_CONTAINER_REGISTRY/bookshop-hana-deployer
496504
```
497505

498506
#### Multi Tenant
@@ -512,7 +520,7 @@ Make the following changes in the _`chart/values.yaml`_ file.
512520
3. Replace `<your-container-registry>` with your container registry.
513521

514522
4. Make the following change to add backend destinations required by Approuter.
515-
523+
516524
```diff
517525
- backendDestinations: {}
518526
+ backendDestinations:

0 commit comments

Comments
 (0)