Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs for IntelliJ plugin in new location #728

Merged
merged 7 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
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
31 changes: 15 additions & 16 deletions java/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,12 @@ Alternatively, you can use the CDS tools to bootstrap a Java project:
```sh
cds init <PROJECT-ROOT> --add java
```
Afterwards, switch to the new project by calling `cd <PROJECT-ROOT>`. All following steps need to executed from this directory!

::: tip
You can call `cds help init` for more information on the available options.
:::


### Add a Sample CDS Model

You can use the [CDS Maven plugin](developing-applications/building#cds-maven-plugin) to add a sample CDS model after creating your project. Navigate to the root folder of your CAP Java project and execute the following Maven command:
Expand Down Expand Up @@ -187,40 +188,38 @@ This command also creates a new folder *integration-tests/src/test/java*, which
To build and run the generated project from the command line, execute:

```sh
cd <PROJECT-ROOT>
mvn spring-boot:run
```
::: tip
To test whether the started application is up and running, open [http://localhost:8080](http://localhost:8080) in your browser.
:::

### Add *Spring Tools 4*

Install the [*Spring Tools 4*](https://spring.io/tools) Eclipse plugin, that makes development of Spring applications more convenient. From the Eclipse Marketplace (*Help > Eclipse Marketplace...*), search and install *Spring Tools 4*.
### Supported IDEs

### Import the Project
CAP Java projects can be edited best in a Java IDE. Leaving CDS support aside you could use any Java IDE supporting the import of Maven projects. But as CDS modeling and editing is a core part of CAP application development we strongly recommend to use an IDE with existing Java support:

1. Select *File > Import... > Existing Maven Projects*.
* [SAP Business Application Studio](/tools/#bastudio) is a cloud-based IDE with minimal local requirements and footprint. It comes pre packaged with all tools, libraries and extensions that are needed to develop CAP applications.
* [Visual Studio Code](/tools/#vscode) is a free and very wide-spread code editor and IDE which can be extended with Java and CDS support. It offers first class CDS language support and solid Java support for many development scenarios.
* [IntelliJ Idea Ultimate](/tools/#intellij) is one of the leading Java IDEs with very powerful debugging, refactoring and profiling support. Together with the CDS Plugin it offers the most powerful support for CAP Java application development.

2. Select your `PROJECT-ROOT` folder and click *Go*. Finally, select the project that was found.

<span id="inimportproject" />

> To not be distracted by CDS tools-specific folders in Eclipse, you can define resource filters. Open the context menu on the project's root folder and select "Properties". Go to **Resource > Resource Filters** and exclude folders with the name `node_modules`.
### Open the project in your IDE

The rest of this guide is targets IntelliJ Ultimate as your IDE. Nevertheless, the steps should be pretty similar for Visual Studio Code and SAP Business Application Studio.

<span id="inimportproject" />

### Compile the Project
You can open the project by either running `idea .` from the project root or use the `File->Open...` menu.

1. Right-click on the `pom.xml` file in the project root folder and select *Run as > Maven build*.
### Source Path Configuration and CDS build

2. Enter the string `clean install` to the field labeled with *Goals* and click *Run*. This step compiles your CDS artifacts. Repeat this step once your CDS model changes.
1. Open the internal terminal with `option+F12` (Windows: `alt+F12`) and type `mvn compile` to perform a full build of your project. This is needed because the IDE can build the right class path based on the dependencies of the project. But it does not trigger the CDS build or the following code generation. This is covered as part of the `mvn compile` call.

3. Right-click on the root project and select *Maven > Update Project ...*. Make sure *Refresh workspace resources from local filesystem* is selected and choose *Ok*.
2. In the project exporer, find the folder `srv/src/gen/java` and open the context menu with a right click on the folder. In the menu open `Mark directory as` and then `Sources Root`. If the option is not available the directory is already recognized as Sources Root. With this step you make sure that the IntelliJ build recognizes the generated sources as part of the Java ClassPath.

### Run and Test the Application

1. Right-click on the project root in the *Package Explorer* and select *Run as > Spring Boot App*.
1. Push `Ctrl` two times and type "Application". Double click the Application Spring Boot entry to start your CAP Java application.

2. Call the application in your browser at [http://localhost:8080/](http://localhost:8080).

Expand Down
2 changes: 1 addition & 1 deletion menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
- [CDS Editors](tools/index#cds-editor)
- [CDS Lint](tools/index#cds-lint)
- [CDS Typer](tools/cds-typer)
- [CAP Notebooks](tools/index#cap-notebooks-page)
- [CAP Notebooks](tools/index#cap-vscode-notebook)
- [Using Docker](tools/index#docker)


Expand Down
13 changes: 11 additions & 2 deletions tools/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ If not already done, [set up SAP Business Application Studio](https://developers
To learn about the features specific to CAP development in the studio, see the guide [Developing a CAP Application in SAP Business Application Studio](https://help.sap.com/docs/SAP%20Business%20Application%20Studio/9c36fdb911ae4cadab467a314d9e331f/8a648174036a458688391c3ad7ee7cd5.html)


### Tutorials
### Tutorials

+ [Combine CAP with SAP HANA Cloud to Create Full-Stack Applications](https://developers.sap.com/mission.hana-cloud-cap.html)
+ [Set Up SAP Business Application Studio for Development](https://developers.sap.com/tutorials/appstudio-onboarding.html).
Expand Down Expand Up @@ -293,7 +293,16 @@ Restart the server when you did changes to your code using the *Debug* views res



<div id="beforedocker" />
## IntelliJ

The CDS language support plugin for IntelliJ IDEs provides syntax highlighting, code completion, formatting, and more.

![Code completion in IntelliJ](https://raw.githubusercontent.com/cap-js/cds-intellij/9dab0d1984e79b74074a820fe97ee6f9fb53cab7/.assets/code_completion.png){ .ignore-dark style="width:450px"}

See the [detailed feature list](https://github.com/cap-js/cds-intellij/blob/main/FEATURES.md) and the [installation instructions](https://github.com/cap-js/cds-intellij#requirements) for how to get started.

[Report issues and provide feedback](https://github.com/cap-js/cds-intellij).




Expand Down
Loading