| <!doctype html> |
| <!-- |
| Minimal Mistakes Jekyll Theme 4.4.1 by Michael Rose |
| Copyright 2017 Michael Rose - mademistakes.com | @mmistakes |
| Free for personal and commercial use under the MIT license |
| https://github.com/mmistakes/minimal-mistakes/blob/master/LICENSE.txt |
| --> |
| <html lang="cn" class="no-js"> |
| <head> |
| <meta charset="utf-8"> |
| |
| <!-- begin SEO --> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <title>开发环境准备 - Apache ServiceComb</title> |
| |
| |
| |
| |
| <meta name="description" content="开发环境准备"> |
| |
| |
| |
| |
| <meta name="author" content=""> |
| |
| <meta property="og:locale" content="cn"> |
| <meta property="og:site_name" content="Apache ServiceComb"> |
| <meta property="og:title" content="开发环境准备"> |
| |
| |
| <link rel="canonical" href="https://github.com/pages/apache/incubator-servicecomb-website/cn/developers/setup-develop-environment/"> |
| <meta property="og:url" content="https://github.com/pages/apache/incubator-servicecomb-website/cn/developers/setup-develop-environment/"> |
| |
| |
| |
| <meta property="og:description" content="开发环境准备"> |
| |
| |
| |
| <meta name="twitter:site" content="@ServiceComb"> |
| <meta name="twitter:title" content="开发环境准备"> |
| <meta name="twitter:description" content="开发环境准备"> |
| <meta name="twitter:url" content=""> |
| |
| |
| <meta name="twitter:card" content="summary"> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <script type="application/ld+json"> |
| { |
| "@context" : "http://schema.org", |
| "@type" : "Person", |
| "name" : "Apache ServiceComb", |
| "url" : "https://github.com/pages/apache/incubator-servicecomb-website", |
| "sameAs" : null |
| } |
| </script> |
| |
| |
| |
| <meta name="google-site-verification" content="HvJjNd7vvJ-yjSTHlBiIWEYxp_Hrz-PYEY5Idz9LRcA" /> |
| |
| |
| |
| |
| <!-- end SEO --> |
| |
| |
| <link href="/feed.xml" type="application/atom+xml" rel="alternate" title="Apache ServiceComb Feed"> |
| |
| <!-- http://t.co/dKP3o1e --> |
| <meta name="HandheldFriendly" content="True"> |
| <meta name="MobileOptimized" content="320"> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| |
| <script> |
| document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/g, '') + ' js '; |
| </script> |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.7.1/clipboard.min.js"></script> |
| <script src="/assets/vendor/prism/prism.js"></script> |
| |
| <script type="text/javascript" async |
| src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML"> |
| </script> |
| |
| <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous"> |
| |
| <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script> |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script> |
| <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1" crossorigin="anonymous"></script> |
| <!-- For all browsers --> |
| <link rel="stylesheet" href="/assets/css/main.css?v=1"> |
| <link rel="stylesheet" href="/assets/vendor/prism/prism.css?v=1"> |
| |
| <!--[if lte IE 9]> |
| <style> |
| /* old IE unsupported flexbox fixes */ |
| .greedy-nav .site-title { |
| padding-right: 3em; |
| } |
| .greedy-nav button { |
| position: absolute; |
| top: 0; |
| right: 0; |
| height: 100%; |
| } |
| </style> |
| <![endif]--> |
| |
| <meta http-equiv="cleartype" content="on"> |
| |
| <!-- start custom head snippets --> |
| |
| <!-- insert favicons. use http://realfavicongenerator.net/ --> |
| <link href="https://fonts.loli.net/css?family=Roboto:400,500,700|Source+Code+Pro" rel="stylesheet"> |
| <script src="/assets/js/custom.js"></script> |
| <!-- end custom head snippets --> |
| |
| </head> |
| |
| <body class="layout--single"> |
| |
| <!--[if lt IE 9]> |
| <div class="notice--danger align-center" style="margin: 0;">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</div> |
| <![endif]--> |
| <div class="masthead" onmouseleave="$('#childrenShow').css('display', 'none')"> |
| <div class="masthead__inner-wrap"> |
| <div class="masthead__menu"> |
| <nav id="site-nav" class="greedy-nav"> |
| |
| <a class="site-title active" href="/cn"><img src="https://www.apache.org/img/servicecomb.png"></a> |
| |
| <ul class="visible-links"> |
| |
| |
| |
| |
| |
| <li class="masthead__menu-item" onmouseenter="$('#childrenShow').css('display', 'none')"> |
| |
| <a href="/cn/">首页</a> |
| |
| </li> |
| |
| |
| |
| |
| |
| |
| <li class="masthead__menu-item" onmouseenter="$('#childrenShow').css('display', 'none')"> |
| |
| <a href="/cn/developers/">项目</a> |
| |
| </li> |
| |
| |
| |
| |
| |
| |
| <li class="def-nav-li" onmouseenter="$('#childrenShow').css('display', 'block')"> |
| |
| |
| |
| |
| |
| <a href="/cn/docs/users/">文档</a> |
| |
| |
| <ul id="childrenShow" class="def-children-show-cn" onmouseleave="$('#childrenShow').css('display', 'none')"> |
| |
| <li><a href="/cn/docs/getting-started/" class="">入门指南</a></li> |
| |
| <li><a href="/cn/docs/users/" class="">用户手册</a></li> |
| |
| <li><a href="/cn/slides/" class="">大咖视频</a></li> |
| |
| <li><a href="/cn/faqs/" class="">常见问题</a></li> |
| |
| </ul> |
| </li> |
| |
| |
| |
| |
| |
| |
| <li class="masthead__menu-item" onmouseenter="$('#childrenShow').css('display', 'none')"> |
| |
| <a class="active" href="/cn/developers/contributing">社区</a> |
| |
| </li> |
| |
| |
| |
| |
| |
| |
| <li class="masthead__menu-item" onmouseenter="$('#childrenShow').css('display', 'none')"> |
| |
| <a href="/cn/year-archive/">博文</a> |
| |
| </li> |
| |
| |
| |
| |
| |
| |
| <li class="masthead__menu-item" onmouseenter="$('#childrenShow').css('display', 'none')"> |
| |
| <a href="/cn/release/">下载</a> |
| |
| </li> |
| |
| |
| </ul> |
| <button><div class="navicon"></div></button> |
| <ul class="hidden-links hidden"></ul> |
| <div class="nav-lang"> |
| |
| |
| |
| <a href=/developers/setup-develop-environment/>English</a> |
| |
| </div> |
| </nav> |
| </div> |
| </div> |
| </div> |
| |
| |
| |
| |
| |
| |
| <div id="main" role="main"> |
| |
| <div class="sidebar sticky"> |
| |
| <div class="back-to-home"><a href="/cn/">首页</a> > 开发环境准备</div> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <nav class="nav__list"> |
| |
| <input id="ac-toc" name="accordion-toc" type="checkbox" /> |
| <label for="ac-toc">切换菜单</label> |
| <ul class="nav__items"> |
| |
| <li> |
| |
| |
| |
| |
| <a href="/cn/developers/"><span class="nav__sub-title nav__sub-title-with-url">项目列表</span></a> |
| |
| |
| |
| </li> |
| |
| <li> |
| |
| |
| |
| |
| <a href="/cn/developers/team/"><span class="nav__sub-title nav__sub-title-with-url">开发团队</span></a> |
| |
| |
| |
| </li> |
| |
| <li> |
| |
| |
| |
| |
| <a href="/cn/developers/contributing"><span class="nav__sub-title nav__sub-title-with-url">如何做贡献</span></a> |
| |
| |
| |
| </li> |
| |
| <li> |
| |
| |
| |
| |
| <a href="/cn/developers/becomming-a-commiter"><span class="nav__sub-title nav__sub-title-with-url">成为Committer</span></a> |
| |
| |
| |
| </li> |
| |
| <li> |
| |
| |
| |
| |
| <a href="/cn/developers/setup-develop-environment/"><span class="nav__sub-title nav__sub-title-with-url">开发环境准备</span></a> |
| |
| |
| |
| </li> |
| |
| <li> |
| |
| |
| |
| |
| <a href="/cn/developers/submit-issues/"><span class="nav__sub-title nav__sub-title-with-url">发现问题</span></a> |
| |
| |
| |
| </li> |
| |
| <li> |
| |
| |
| |
| |
| <a href="/cn/developers/submit-codes/"><span class="nav__sub-title nav__sub-title-with-url">代码提交指南</span></a> |
| |
| |
| |
| </li> |
| |
| <li> |
| |
| |
| |
| |
| <a href="/cn/developers/subscribe-mail-list/"><span class="nav__sub-title nav__sub-title-with-url">邮件列表订阅指南</span></a> |
| |
| |
| |
| </li> |
| |
| <li> |
| |
| |
| |
| |
| <a href="/cn/developers/use-jira/"><span class="nav__sub-title nav__sub-title-with-url">JIRA使用方法</span></a> |
| |
| |
| |
| </li> |
| |
| <li> |
| |
| |
| |
| |
| <a href="/cn/developers/use-gitter/"><span class="nav__sub-title nav__sub-title-with-url">Gitter 使用方法</span></a> |
| |
| |
| |
| </li> |
| |
| <li> |
| |
| |
| |
| |
| <a href="/cn/developers/setup-committer-rights/"><span class="nav__sub-title nav__sub-title-with-url">设置代码仓库写权限</span></a> |
| |
| |
| |
| </li> |
| |
| <li> |
| |
| |
| |
| |
| <a href="/cn/developers/release-guide/"><span class="nav__sub-title nav__sub-title-with-url">Servicecomb发版指南</span></a> |
| |
| |
| |
| </li> |
| |
| <li> |
| |
| |
| |
| |
| <a href="/cn/developers/release-validation-guide/"><span class="nav__sub-title nav__sub-title-with-url">ServiceComb发版验证指南</span></a> |
| |
| |
| |
| </li> |
| |
| <li> |
| |
| |
| |
| |
| <a href="/cn/developers/sonarcloud-how-to/"><span class="nav__sub-title nav__sub-title-with-url">SonarCloud集成指南</span></a> |
| |
| |
| |
| </li> |
| |
| </ul> |
| </nav> |
| |
| |
| |
| </div> |
| |
| |
| |
| <article class="page" itemscope itemtype="http://schema.org/CreativeWork"> |
| <meta itemprop="headline" content="开发环境准备"> |
| <meta itemprop="description" content="开发环境准备"> |
| |
| <meta itemprop="dateModified" content="June 24, 2017"> |
| |
| <div class="page__inner-wrap"> |
| |
| |
| <header> |
| <h1 class="page__title" itemprop="headline">开发环境准备 |
| </h1> |
| |
| </header> |
| |
| |
| |
| <section class="page__content" itemprop="text"> |
| <aside class="sidebar__right"> |
| <nav class="toc"> |
| <!-- <header><h4 class="nav__title"><i class="fa fa-file-text"></i> 在本页上</h4></header> --> |
| <ul class="toc__menu" id="markdown-toc"> |
| <li><a href="#基本环境准备" id="markdown-toc-基本环境准备">基本环境准备</a></li> |
| <li><a href="#git配置" id="markdown-toc-git配置">Git配置</a></li> |
| <li><a href="#ide-环境配置" id="markdown-toc-ide-环境配置">IDE 环境配置</a> <ul> |
| <li><a href="#intellij-idea-配置" id="markdown-toc-intellij-idea-配置">IntelliJ IDEA 配置</a></li> |
| </ul> |
| </li> |
| <li><a href="#下一步" id="markdown-toc-下一步">下一步</a></li> |
| </ul> |
| |
| </nav> |
| </aside> |
| |
| <h2 id="基本环境准备">基本环境准备</h2> |
| <p>在您开始前,请确保以下应用已安装:</p> |
| <ul> |
| <li><strong>Git</strong>,安装详情可参考<a href="https://git-scm.com/book/zh/v2/%E8%B5%B7%E6%AD%A5-%E5%AE%89%E8%A3%85-Git" target="_blank">Git安装教程</a></li> |
| <li><strong>JDK 1.8</strong>,安装详情可参考<a href="https://docs.oracle.com/javase/8/docs/technotes/guides/install/install_overview.html" target="_blank">JDK安装教程</a></li> |
| <li><strong>Maven 3.x</strong>,安装详情可参考<a href="https://maven.apache.org/install.html" target="_blank">Maven安装教程</a></li> |
| <li><strong>Docker</strong>,安装详情可参考<a href="https://docs.docker.com/engine/installation/" target="_blank">Docker 安装教程</a></li> |
| <li><strong>Service Center</strong>, 安装详情可参考<a href="/cn/docs/service-center/install/">Service Center安装教程</a></li> |
| <li><strong>IntelliJ Idea IDE</strong>(可选,您可以使用其他心仪的IDE,如eclipse),安装详情可参考<a href="https://www.jetbrains.com/help/idea/installing-and-launching.html" target="_blank">IntelliJ安装教程</a></li> |
| </ul> |
| |
| <h2 id="git配置">Git配置</h2> |
| <ol> |
| <li>注册Github。由于ServiceComb的代码是托管在Github上的,所以您需要有一个Github的帐号,可前往 <a href="https://github.com/join?source=header-home">https://github.com/join?source=header-home</a> 进行注册,如您已有Github帐号,则可跳过此步。注册完成后直接在 <a href="https://github.com/login?return_to=%2Fjoin%3Fsource%3Dheader-home">https://github.com/login?return_to=%2Fjoin%3Fsource%3Dheader-home</a> 进行登录即可。</li> |
| <li> |
| <p>配置Git。主要配置Git的个人信息和设置免密码提交代码。个人信息可通过以下指令进行配置:</p> |
| |
| <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git config <span class="nt">--global</span> user.name <your-user-name> |
| git config <span class="nt">--global</span> user.email <your-email-address> |
| </code></pre></div> </div> |
| |
| <p>其中,请将<your-user-name>和<your-email-address>替换为您在Github上注册用到的用户名和邮箱信息。设置免密码提交代码可参考<a href="https://stackoverflow.com/a/8588786" target="_blank">Git免密码提交代码教程</a>。</p> |
| </li> |
| <li> |
| <p>获取项目代码。以 <a href="https://github.com/apache/servicecomb-java-chassis">ServiceComb-Java-Chassis</a> 项目为例,可直接执行以下指令获取代码:</p> |
| |
| <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git clone https://github.com/apache/servicecomb-java-chassis.git |
| </code></pre></div> </div> |
| </li> |
| </ol> |
| |
| <h2 id="ide-环境配置">IDE 环境配置</h2> |
| <p>现有支持Java开发的IDE很多,如Eclipse, IntelliJ IDEA和STS等。我们在此推荐使用IntelliJ IDEA,对于日常开发,其社区版的功能已经足够了。在安装完IntelliJ IDEA后,您可以根据<a href="https://www.jetbrains.com/help/idea/installing-and-launching.html#d325787e291">初始化设置教程</a>对IntelliJ IDEA进行配置,随后可通过阅读<a href="https://www.jetbrains.com/help/idea/keyboard-shortcuts-you-cannot-miss.html">必备快捷键</a>了解常用的快捷键。</p> |
| |
| <p>Java Chassis和Saga项目使用了<a href="https://github.com/google/styleguide">Google Code Style</a>作为代码风格,配置文件可以在本项目 <code class="highlighter-rouge">etc</code> 目录下找到。其中,目录中也有Eclipse的代码风格,读者可以直接导入使用。</p> |
| |
| <p><img src="/assets/images/intellij.code.style.3.png" alt="code style files" class="align-center" /></p> |
| |
| <aside class="sidebar__right"> |
| <nav class="toc"> |
| <!-- <header><h4 class="nav__title"><i class="fa fa-file-text"></i> 在本页上</h4></header> --> |
| <ul class="toc__menu"> |
| <li>Auto generated table of contents</li> |
| </ul> |
| </nav> |
| </aside> |
| |
| <h3 id="intellij-idea-配置">IntelliJ IDEA 配置</h3> |
| <p><a href="https://www.jetbrains.com/idea/download/">IntelliJ IDEA</a>的配置方法如下</p> |
| |
| <ol> |
| <li> |
| <p>打开IntelliJ配置 |
| <img src="/assets/images/intellij.code.style.4.png" alt="IntelliJ Settings" class="align-center" /></p> |
| </li> |
| <li> |
| <p>Import 配置文件 <code class="highlighter-rouge">etc/intellij-java-google-style.xml</code> |
| <img src="/assets/images/intellij.code.style.1.png" alt="import code style" class="align-center" /></p> |
| </li> |
| <li> |
| <p>打开已修改而未提交的文件,并打开格式化文件对话框 |
| <img src="/assets/images/intellij.code.style.5.png" alt="reformat file dialog" class="align-center" /></p> |
| </li> |
| <li> |
| <p>选择只格式化修改部分 |
| <img src="/assets/images/intellij.code.style.2.png" alt="reformat options" class="align-center" /></p> |
| </li> |
| </ol> |
| |
| <p>配置完成后,后续按快捷键 (Ctrl+Alt+i) 格式化修改文件即可。更多关于IntelliJ的使用技巧可阅读<a href="https://www.jetbrains.com/help/idea/tutorials.html">IntelliJ教程</a>。</p> |
| |
| <h2 id="下一步">下一步</h2> |
| |
| <ul> |
| <li>阅读<a href="/cn/developers/submit-codes/">代码提交指南</a></li> |
| </ul> |
| |
| |
| </section> |
| |
| <footer class="page__meta"> |
| |
| |
| |
| |
| |
| </footer> |
| |
| |
| |
| |
| |
| </div> |
| |
| |
| </article> |
| |
| |
| |
| </div> |
| |
| |
| <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> |
| <div align="center" style="margin: 0 0;"> |
| <ins class="adsbygoogle" |
| style="display:block; border-bottom: initial;" |
| data-ad-client="ca-pub-7328585512091257" |
| data-ad-slot="3049671934" |
| data-ad-format="auto"></ins> |
| </div> |
| |
| <div class="page__footer"> |
| <footer> |
| <!-- start custom footer snippets --> |
| |
| <!-- end custom footer snippets --> |
| |
| <div class="container"> |
| <div class="row justify-content-md-center"> |
| |
| <div class="col"> |
| <ul> |
| <p class="header">资源</p> |
| <li><a href="/cn/docs/getting-started/">入门指南</a></li> |
| <li><a href="/cn/docs/users/">用户指南</a></li> |
| <li><a href="/cn/slides/">资料</a></li> |
| <li><a href="/cn/users/faq/">常见问题</a></li> |
| </ul> |
| </div> |
| <div class="col"> |
| <ul> |
| <p class="header">ASF</p> |
| <li><a href="http://www.apache.org">基金会</a></li> |
| <li><a href="http://www.apache.org/licenses/">许可证</a></li> |
| <li><a href="http://www.apache.org/events/current-event">活动</a></li> |
| <li><a href="http://www.apache.org/foundation/sponsorship.html">赞助</a></li> |
| <li><a href="http://www.apache.org/foundation/thanks.html">鸣谢</a></li> |
| </ul> |
| </div> |
| <div class="col"> |
| <ul> |
| <p class="header">贡献</p> |
| <li><a href="http://issues.apache.org/jira/browse/SCB">报告本网页问题</a></li> |
| <li><a href="https://github.com/apache/servicecomb-website/edit/master/_developers/cn/setup-develop-environment.md">在Github上编辑此页</a></li> |
| <li><a href="/cn/developers/submit-codes/">代码提交指南</a></li> |
| <li><a href="/cn/security">安全</a></li> |
| </ul> |
| </div> |
| <div class="col"> |
| <ul class="social-icons"> |
| <p class="header">社区</p> |
| <li> |
| <a href="mailto:dev-subscribe@servicecomb.incubator.apache.org" rel="nofollow"><span class="mail">邮件列表</span></a> |
| </li> |
| <li> |
| <a href="https://github.com/apache?q=ServiceComb" target="_blank"><span class="github">Github</span></a> |
| </li> |
| <li> |
| <a href="https://twitter.com/ServiceComb" target="_blank"><span class="twitter">Twitter</span></a> |
| </li> |
| <li> |
| <a href="/feed.xml" target="_blank"><span class="rss">Feed</span></a> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </div> |
| <div class="page__footer-bottom"> |
| <div>© 2020 Apache ServiceComb. 技术来自于 <a href="http://jekyllrb.com" rel="nofollow">Jekyll</a> & <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div> |
| <div>All other marks mentioned may be trademarks or registered trademarks of their respective owners.</div> |
| </div> |
| |
| </footer> |
| </div> |
| |
| <script src="/assets/js/main.min.js"></script> |
| |
| |
| |
| |
| <script> |
| (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ |
| (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), |
| m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) |
| })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); |
| |
| ga('create', 'UA-101622733-1', 'auto'); |
| ga('send', 'pageview'); |
| </script> |
| |
| |
| |
| |
| |
| |
| |
| </body> |
| </html> |