Before you start, make sure you have the following tools installed:
Get a Github account. The ServiceComb projects is hosted on Github, so you will need a Github account. You can goto https://github.com/join?source=header-home for signup. Skip this if you already own an Github account. You can login on https://github.com/login?return_to=%2Fjoin%3Fsource%3Dheader-home after you finished the signup.
Configure Git. Configure personal information and setup git for push without username/password. Configure personal information:
git config --global user.name <your-user-name> git config --global user.email <your-email-address>
Substitute <your-user-name>和<your-email-address> with your name and email. ReferGit push without username and password{:target=“_blank”}to setup pushing without username/password.
Get the source code. For example, to get ServiceComb-Java-Chassis, execute the following command:
git clone https://github.com/apache/servicecomb-java-chassis.git
There are many Java IDEs around, like Eclipse, IntelliJ IDEA and STS, etc. We suggest to use IntelliJ IDEA, it's community edition is good enough for daily usage. After you installed IntelliJ IDEA, follow Initial Setup for basic configuration. For frequently used shortcuts, Cannot Miss Shortcuts
The Java Chassis and Saga project uses Google Code Style. You can find the settings file under etc
directory which can be imported to IDEA. There is also a settings file for Eclipse under the same directory.
![code style files]({{ site.url }}{{ site.baseurl }}/assets/images/intellij.code.style.3.png){: .align-center}
{% include toc %}
Configure IntelliJ IDEA
Open IntelliJ Settings page ![IntelliJ Settings]({{ site.url }}{{ site.baseurl }}/assets/images/intellij.code.style.4.png){: .align-center}
Import the coding style settings file etc/intellij-java-google-style.xml
![import code style]({{ site.url }}{{ site.baseurl }}/assets/images/intellij.code.style.1.png){: .align-center}
Open a modified but uncommited file, then Choose [Code] > [Show Reformat File Dialog] ![reformat file dialog]({{ site.url }}{{ site.baseurl }}/assets/images/intellij.code.style.5.png){: .align-center}
Choose [Only VCS changed text], then click [Run] ![reformat options]({{ site.url }}{{ site.baseurl }}/assets/images/intellij.code.style.2.png){: .align-center}
Just run [Reformat code] (Ctrl+Alt+L) afterwards to format the code.
For more IntelliJ usages, please check IntelliJ tutorial。