Step-by-Step Guide to Building a Spring Cloud Microservice Project (PassJava)
This tutorial walks through setting up the development environment, configuring generator files, generating channel microservice code, updating Maven dependencies and application settings, testing service endpoints, and publishing the complete PassJava Spring Cloud project with code snippets and deployment instructions.
This article provides a complete tutorial for building a Spring Cloud microservice project named PassJava, covering environment setup, code generation, and service configuration.
It starts by modifying the generator configuration files ( generator.properties and application.yml) to point to the target database and package.
mainPath=com.jackson0714
package=com.jackson0714.passjava
moduleName=channel
author=jackson0714
[email protected]
tablePrefix=chms_Next, the guide shows how to generate the channel microservice code via the built‑in generator UI (http://localhost:8003/#generator.html) and copy the generated sources into the channel module.
The pom.xml of the channel module is updated to include the common module dependency:
<dependency>
<groupId>com.jackson0714.passjava</groupId>
<artifactId>passjava-common</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>The application.yml is configured with MySQL datasource and MyBatis‑Plus settings:
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://129.211.188.xxx:3306/passjava_chms?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
username: root
password: xxx
mybatis-plus:
mapper-locations: classpath:/mapper/**/*.xml
global-config:
db-config:
id-type: autoAfter starting the service, the endpoint http://localhost:8000/channel/channel/list returns a JSON response confirming successful deployment:
{"msg":"success","code":0,"page":{"totalCount":0,"pageSize":10,"totalPage":0,"currPage":1,"list":[]}}Finally, the tutorial lists the port assignments for all microservices and provides the GitHub repository URL for the full source code.
passjava-channel 端口8000
passjava-content 端口9000
passjava-member 端口10000
passjava-question 端口11000
passjava-study 端口12000The complete project can be accessed at https://github.com/Jackson0714/PassJava-Platform .
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Wukong Talks Architecture
Explaining distributed systems and architecture through stories. Author of the "JVM Performance Tuning in Practice" column, open-source author of "Spring Cloud in Practice PassJava", and independently developed a PMP practice quiz mini-program.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
