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

[Documentation] Document the configuration of Project JDK and Maven JDK in IntelliJ #10371

Merged
merged 7 commits into from
Apr 28, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Document the configuration of Project JDK and Maven JDK in IntelliJ
  • Loading branch information
lhotari committed Apr 26, 2021
commit 8e05267315dd32c52a8dfb71ec9e9145d90cddfb
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,27 @@ required plugins.

### Intellij

#### Configure Project JDK to Java 8 (1.8) JDK

1. Open Project Settings dialog by going to
`File -> Project Structure -> Project Settings -> Project`.
lhotari marked this conversation as resolved.
Show resolved Hide resolved

2. Click on the JDK version drop down and select `Download JDK...` or choose an existing recent Java 8 (1.8) JDK version.
lhotari marked this conversation as resolved.
Show resolved Hide resolved

3. In the download dialog, select version `1.8` and vendor `AdoptOpenJDK (Hotspot)` for the JDK to download.
lhotari marked this conversation as resolved.
Show resolved Hide resolved


#### Configure Java version for Maven in IntelliJ

1. Open Maven Importing Settings dialog by going to
`Settings -> Build, Execution, Deployment -> Build Tools -> Maven -> Importing`.

2. Choose "Use Project JDK" for "JDK for Importer" setting. This uses the Java 8 (1.8) JDK for running Maven
when importing the project to IntelliJ. Some of the configuration in the Maven build is conditional based on
the JDK version. Incorrect configuration gets chosen when the "JDK for Importer" isn't the same as the "Project JDK".

3. Validate that the JRE setting in "Maven -> Runner" dialog is set to "Use Project JDK".

#### Configure annotation processing in IntelliJ

1. Open Annotation Processors Settings dialog box by going to
Expand Down
37 changes: 2 additions & 35 deletions site2/website/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,43 +118,10 @@ these two remotes for pushing changes).

You are now ready to start developing!

#### [Optional] IDE Setup
#### IDE Setup

Depending on your preferred development environment, you may need to prepare it to develop Pulsar code.
Please find the [instructions for IDE Setup in the README.md](https://github.com/apache/pulsar/#setting-up-your-ide) file.
lhotari marked this conversation as resolved.
Show resolved Hide resolved

##### IntelliJ

###### Enable Annotation Processing

To configure annotation processing in IntelliJ:

1. Open Annotation Processors Settings dialog box by going to Settings -> Build, Execution, Deployment -> Compiler -> Annotation Processors.
1. Select the following buttons:
1. "Enable annotation processing"
1. "Obtain processors from project classpath"
1. "Store generated sources relative to: Module content root"
1. Set the generated source directories to be equal to the Maven directories:
1. Set "Production sources directory:" to "target/generated-sources/annotations".
1. Set "Test sources directory:" to "target/generated-test-sources/test-annotations".
1. Click "OK".

##### Eclipse

Use a recent Eclipse version that includes m2e. Start Eclipse with a fresh workspace in a
separate directory from your checkout.

###### Initial setup

1. Import the Pulsar projects

File
-> Import...
-> Existing Maven Projects
-> Browse to the directory you cloned into and select "pulsar"
-> make sure all pulsar projects are selected
-> Finalize

You now should have all the Pulsar projects imported into eclipse and should see no compile errors.

### Create a branch in your fork

Expand Down