Initializing the PassJava Project and Adding Microservices
This tutorial walks through creating an empty GitHub repository, importing it, adding a content service and additional microservices, configuring the Maven parent pom, setting up a root Maven configuration and .gitignore, and finally committing the code for the PassJava Java microservice suite.
This guide shows how to set up the PassJava project from scratch and integrate several microservices using Maven and Git.
1. Create an empty repository on GitHub and clone it locally.
2. Import the empty project into your IDE.
3. Add the content service named passjava-content with groupId com.jackson0714.passjava , artifactId passjava-content , and package com.jackson0714.passjava.content . Include dependencies such as Spring Web and OpenFeign.
4. Add other microservices – a member service ( passjava-member ) and a question service ( passjava-question ).
5. Create the parent pom.xml for the PassJava platform :
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.jackson0714.passjava</groupId>
<artifactId>passjava</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>passjava</name>
<description>佳必过-聚合服务</description>
<packaging>pom</packaging>
<modules>
<module>passjava-content</module>
<module>passjava-member</module>
<module>passjava-question</module>
</modules>
</project>6. Add root Maven configuration (e.g., parent pom settings) and run mvn clean to verify the build.
7. Configure .gitignore to exclude build artifacts, IDE files, logs, temporary files, and other unwanted content. Example entries include:
### gradle ###
.gradle
/build/
!gradle/wrapper/gradle-wrapper.jar
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
rebel.xml
### maven ###
target/
*.war
*.ear
*.zip
*.tar
*.tar.gz
**/mvnw
**/mvnw.cmd
**/.mvn
### logs ####
/logs/
*.log
### system ignore ###
.DS_Store
Thumbs.dbDelete any existing .gitignore files in sub‑modules to avoid conflicts.
8. Commit the code using either the IDE’s Git integration or the command line:
git add .
git commit -m 'Initial PassJava setup'
git push origin masterFollowing these steps results in a fully initialized PassJava multi‑module Maven project ready for further development.
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.