Skip to content

Commit

Permalink
[Documentation] Document the configuration of Project JDK and Maven J…
Browse files Browse the repository at this point in the history
…DK in IntelliJ (apache#10371)

* Document the configuration of Project JDK and Maven JDK in IntelliJ

* Rephrase wording for choosing the JDK

* Update site2/website/contributing.md

Co-authored-by: Yu Liu <[email protected]>

* Update README.md

Co-authored-by: Yu Liu <[email protected]>

* Update README.md

Co-authored-by: Yu Liu <[email protected]>

* Update README.md

Co-authored-by: Huanli Meng <[email protected]>

* Address review feedback about using bold style for buttons instead of code style

Co-authored-by: Yu Liu <[email protected]>
Co-authored-by: Huanli Meng <[email protected]>
  • Loading branch information
3 people authored Apr 28, 2021
1 parent ce6fdab commit 9e8949b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 40 deletions.
34 changes: 29 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,21 +136,45 @@ required plugins.

### Intellij

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

1. Open **Project Settings**.

Click **File** -> **Project Structure** -> **Project Settings** -> **Project**.

2. Select the JDK version.

From the JDK version drop-down list, select **Download JDK...** or choose an existing recent Java 8 (1.8) JDK version.

3. In the download dialog, select version **1.8**. You can pick a version from many vendors. Unless you have a specific preference, choose **AdoptOpenJDK (Hotspot)**.


#### 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
`Settings -> Build, Execution, Deployment -> Compiler -> Annotation Processors`.
**Settings** -> **Build, Execution, Deployment** -> **Compiler** -> **Annotation Processors**.

2. Select the following buttons:
1. "Enable annotation processing"
2. "Obtain processors from project classpath"
3. "Store generated sources relative to: Module content root"
1. **Enable annotation processing**
2. **Obtain processors from project classpath**
3. Store generated sources relative to: **Module content root**

3. Set the generated source directories to be equal to the Maven directories:
1. Set "Production sources directory:" to "target/generated-sources/annotations".
2. Set "Test sources directory:" to "target/generated-test-sources/test-annotations".

4. Click "OK".
4. Click **OK**.

5. Install the lombok plugin in intellij.

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.
For how to set up IDE, see [here](https://github.com/apache/pulsar/blob/master/README.md#setting-up-your-ide).

##### 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

0 comments on commit 9e8949b

Please sign in to comment.