zhengyangyong commented on a change in pull request #85: add 
easy-build-microservice-system-part-I blog
URL: 
https://github.com/apache/incubator-servicecomb-website/pull/85#discussion_r189150551
 
 

 ##########
 File path: _posts/cn/2018-05-17-easy-build-microservice-system-part-I.md
 ##########
 @@ -0,0 +1,91 @@
+---
+title: "轻松微服务系列:使用脚手架功能一键构建微服务"
+lang: cn
+ref: easy-build-microservice-system-part-I
+permalink: /cn/docs/easy-build-microservice-system-part-I/
+excerpt: "轻松微服务系列:使用脚手架功能一键构建微服务"
+last_modified_at: 2018-05-17T19:05:00+08:00
+author: Yangyong Zheng
+tags: [Archetypes, Scaffold]
+redirect_from:
+  - /theme-setup/
+---
+
+## 轻松微服务系列:使用脚手架功能一键构建微服务
+提到微服务,相信“程序猿”们已经不再陌生,估计大家都多少尝试过微服务框架,也遇到了不少“坑”直呼坑爹吧?实际上微服务的初衷正是为了“解放”开发者,使得系统构建的过程更加轻松愉快,所以我们开了这个“轻松微服务系列”,和大家一起愉快的走一遭!废话不多说,上菜:
+
+### 牛刀小试
+打开命令行,输入下面的命令:
+```bash
+mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate 
-DarchetypeGroupId=org.apache.servicecomb.archetypes 
-DarchetypeArtifactId=business-service-jaxrs-archetype 
-DarchetypeVersion=1.0.0-m2-SNAPSHOT 
-DarchetypeRepository=https://repository.apache.org/content/groups/snapshots-group
+```
+
+>提示:由于ServiceComb Archetypes还处于SNAPSHOT阶段,Repository托管在Apache 
Snapshots库中,所以下载速度会稍慢。
+
+之后按提示指定微服务的`groupId`,`artifactId`,`version`,`package`等信息,回车,一个新的微服务就创建好了:
+
+![Archetypes创建](/assets/images/scaffold/ArchetypesCreate.png)
+
+运行它也很简单,使用IDE打开项目,DEBUG -> Application.java,或在命令行:
+
+```bash
+#编译打包
+mvn package
+#切换到输出目录
+cd target
+#启动可执行jar包
+java -jar xxxx.jar
+```
+
+稍等微服务就启动好了,打开浏览器输入`http://localhost:8080/hello`验证一下:
+
+![输出hello](/assets/images/scaffold/OutputHello.png)
+
+是不是非常轻松呢?这份轻松来源我们使用Archetypes优化了构建过程,它是脚手架的基础。
+
 
 Review comment:
   Done

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to