跳至主要內容

创建和添加模块

悟空项目实战passjava面试刷题项目约 504 字大约 2 分钟...

文档在线地址:www.passjava.cnopen in new window

PassJava 初始化项目和添加微服务

1.GitHub上创建一个空的仓库

mark
mark

2.从GitHub上引入空的项目

mark
mark
mark
mark

3.添加内容服务

passjava-content

mark
mark
mark
mark
序号字段内容
1groupcom.jackson0714.passjava
2Artifactpassjava-content
3Namepassjava-content
4Description佳必过-内容服务
5Packagecom.jackson0714.passjava.content
  • 添加依赖组件SpringWeb, OpenFeign
mark
mark
mark
mark

3.添加其他微服务

序号服务描述服务名
1内容微服务passjava-content
2会员微服务passjava-member
3题目微服务passjava-question
4学习微服务passjava-study
5渠道微服务passjava-channel
mark
mark

4.PassJava-Platform添加Pom.xml文件

mark
mark
<?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>
        <module>passjava-study</module>
        <module>passjava-channel</module>
    </modules>
</project>

5.添加根目录Maven 配置

mark
mark
mark
mark

Maven操作根项目就可以了,试下clean

mark
mark
mark
mark

6. 配置.gitignore文件

提交代码时,忽略某些文件

### gradle ###
.gradle
/build/
!gradle/wrapper/gradle-wrapper.jar

### STS ###
.settings/
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
bin/

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
rebel.xml

### NetBeans ###
nbproject/private/
build/
nbbuild/
dist/
nbdist/
.nb-gradle/

### maven ###
target/
*.war
*.ear
*.zip
*.tar
*.tar.gz
**/mvnw
**/mvnw.cmd
**/.mvn

### logs ####
/logs/
*.log

### temp ignore ###
*.cache
*.diff
*.patch
*.tmp
*.java~
*.properties~
*.xml~

### system ignore ###
.DS_Store
Thumbs.db
Servers
.metadata
upload
gen_code

### database ###

db/db_back_dir/

### redis ###
/redis/

删除子项目的.gitignore文件

mark
mark

7.提交代码

可以用IDEA的git工具提交,也可以用git bash命令行提交

git add .
git commit -m 'xxx'
git push origin master

公众号

mark
mark
评论
  • 按正序
  • 按倒序
  • 按热度
Powered by Waline v3.3.0