A travel booking application built with CAP Java using master data provided by capire/xflights-java.
git clone https://github.com/capire/xtravels-java
cd xtravels-java
mvn package
The package has dependencies to other capire
packages, including sap.capire/xflights-data
, that can be pulled from GitHub Packages or from a local workspace setup as follows...
Reuse packages among the capire samples are published to the GitHub Packages registry. This includes Maven packages as well as NPM packages.
Authenticate to GitHub's Maven repository by adding the following to your ~/.m2/settings.xml
:
<servers>
<!-- ... -->
<server>
<id>github</id>
<username>USERNAME</username>
<password>TOKEN</password>
</server>
</servers>
As password you're using a Personal Access Token (classic) with read:packages
scope.
Read more about it in Authenticating to GitHub Packages.
Run npm login
once like that:
npm login --scope=@capire --registry=https://npm.pkg.github.com
When prompted for a password enter a Personal Access Token (classic) with read:packages
scope.
Learn more about that in Authenticating to GitHub Packages.
A successfull npm login
adds entries like that to your local ~/.npmrc
file, which allow you to npm install @capire packages subsequently using npm add
or npm install
as usual:
@capire:registry=https://npm.pkg.github.com/
//npm.pkg.github.com/:_authToken=<generated token>
Alternatively you can work with related packages in local workspace setups like so:
-
Create a workspace root for NPM, e.g. at
cap/samples-java
:mkdir -p cap/samples-java && cd cap/samples-java echo '{"workspaces":["*","*/apis/*"]}' > package.json
-
Add related projects:
git clone https://github.com/capire/xtravels-java git clone https://github.com/capire/xflights-java git clone https://github.com/capire/common
-
Install NPM dependencies:
npm install
-
Install Maven dependencies:
cd xflights-java && mvn install
For Maven, this will share cross dependencies between projects via your local Maven repository placed at ~/.m2
.
For NPM, this will install all dependencies of all cloned projects, with cross dependencies between them being symlinked automatically by npm install
.
To start the xtravels
application, run the Application
class in your preferred IDE.
Alternatively, execute mvn spring-boot:run
on the command line.
Click the http://localhost:8080 link in the terminal to open the app in a browser.
The dependencies to the xflights application are mocked automatically by CAP.
You can also connect the xtravels
application to a locally running xflights application.
Start the xflights
application first, then start the xtravels
application with Spring Boot profile hybrid
.
Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, version 2.0 except as noted otherwise in the LICENSE file.