Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions java/developing-applications/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -664,35 +664,35 @@ To migrate from the deprecated goal `install-cdsdk` to the new `npm ci` approach
```xml
<properties>
<!-- Delete from here ... -->
<cds.install-cdsdk.version>8.4.2</cds.install-cdsdk.version>
<cds.install-cdsdk.version>x.x.x</cds.install-cdsdk.version>
<!-- ... to here -->
</properties>
```

4. Add `@sap/cds-dk` as devDependency to _package.json_:
```json
{
"devDependencies" : {
"@sap/cds-dk" : "^8.5.0"
}
"devDependencies" : {
"@sap/cds-dk" : "^9"
}
}
```

5. Perform `npm install` on the command line to get the _package-lock.json_ created or updated.

6. Finally, do a `mvn clean install` and verify that the installation of `@sap/cds-dk` is done with the new approach.

#### Maintaining cds-dk
#### Maintaining cds-dk in _package.json_ (preferred)

Newly created CAP Java projects maintain the `@sap/cds-dk` with a specific version as a `devDependency` in the _package.json_. So, when you update the cds-dk version in _package.json_, run `npm install` from the command line to update the _package-lock.json_. `npm ci` will then install the updated version of `@sap/cds-dk`.

#### Maintaining cds-dk in _pom.xml_ (outdated)

1. _package.json_ and `npm ci` <br>
Newly created CAP Java projects maintain the `@sap/cds-dk` with a specific version as a devDependency in `package.json`. So, when you update the version, run npm install from the command line to update the `package-lock.json`. `npm ci` will then install the updated version of `@sap/cds-dk`.
Older CAP Java projects, that still use the `install-cdsdk` goal of the `cds-maven-plugin`, maintain the `@sap/cds-dk` version in the *pom.xml* in property `cds.install-cdsdk.version`. To update the `@sap/cds-dk` version in this setup, the following steps are required:

2. Goal `install-cdsdk` <br>
Older CAP Java projects that use the `install-cdsdk` goal of the `cds-maven-plugin` don't update `@sap/cds-dk`. By default, the goal skips the installation if it's already installed.
To update the `@sap/cds-dk` version:
1. Specify a newer version of `@sap/cds-dk` in property `cds.install-cdsdk.version` in your *pom.xml* file.

3. Specify a newer version of `@sap/cds-dk` in your *pom.xml* file.
4. Execute `mvn spring-boot:run` with an additional property `-Dcds.install-cdsdk.force=true`, to force the installation of a **`@sap/cds-dk`** in the configured version.
2. Execute `mvn spring-boot:run` with an additional property `-Dcds.install-cdsdk.force=true`, to force the installation of a `@sap/cds-dk` in the configured version.

```sh
mvn spring-boot:run -Dcds.install-cdsdk.force=true
Expand Down
Loading