本文最后更新于:4 年前

项目文件配置

Maven

conf/setting.xml配置

配置阿里云镜像

<mirror>  
		<id>alimaven</id>  
		<mirrorOf>central</mirrorOf>  
		<name>aliyun maven</name>  
		<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>  
</mirror>Copy

配置jdk编译

<profile>
	  <id>jdk-1.8</id>
	  <activation>
		<activeByDefault>true</activeByDefault>
		<jdk>1.8</jdk>
	  </activation>
	  <properties>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>
		<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
	  </properties>
	</profile>Copy

Idea

Setting配置Maven

在Plugins中安装插件

  1. lombok
  2. mybatisx

Vscode

安装插件(方便开发)

  1. Auto Close Tag
  2. Auto Rename Tag
  3. Chinese
  4. ESLint
  5. HTML CSS Support
  6. HTML Snippets
  7. JavaScript (ES6) code snippets
  8. Live Server
  9. open in browser
  10. Vetur
  11. vue2 snippets //vue的语法提示

git配置

右键打开git bash here

配置基本信息

git config --global user.name "名字"
git config --global user.email "邮箱"Copy

创建秘钥

ssh-keygen -t rsa -C "邮箱"Copy

创建项目微服务

新建一个Module 选择Spring Initializr

商品服务,仓储服务,订单服务,优惠券服务,用户服务

共同:

  1. 需要有web,springrouting/openfeign
  2. 每一个服务包名com.atguigu.gulimall.xxx(product/order/ware/coupon/member)
  3. 模块名 : gulimall-xxx

根目录创建pom.xml

输入以下内容聚合所有服务

<?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.atguigu.gulimall</groupId>
    <artifactId>gulimall</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>gulimall</name>
    <description>聚合服务</description>
    <packaging>pom</packaging>

    <modules>
        <module>gulimall-coupon</module>
        <module>gulimall-member</module>
        <module>gulimall-order</module>
        <module>gulimall-ware</module>
        <module>gulimall-product</module>
    </modules>

</project>Copy

可以使用service中的springboot操作

maven中添加新建的pom.xml

为了一起编译操作