Home  >  Article  >  Java  >  How Springboot integrates Dubbo projects and environment construction

How Springboot integrates Dubbo projects and environment construction

WBOY
WBOYforward
2023-05-17 09:59:41726browse

1. Use IDEA to create a new Maven project

How Springboot integrates Dubbo projects and environment construction

New project

After selecting Maven, click next

How Springboot integrates Dubbo projects and environment construction

Select project type

How Springboot integrates Dubbo projects and environment construction

Configure the Maven coordinates of the project

How Springboot integrates Dubbo projects and environment construction

Set the project name and save location

Modify the project's pom.xml file



 4.0.0

 com.boot
 boot-dubbo
 1.0-SNAPSHOT

 
 pom

2. Create a sub-module project of boot-dubbo

To create the Dubbo service interface project, we build the project under the boot-dubbo project we just created and manage it as a sub-module project of boot-dubbo.
Click on the newly created project we just created to create a new sub-module project of boot-dubbo

How Springboot integrates Dubbo projects and environment construction

The sub-module project of the new project

How Springboot integrates Dubbo projects and environment construction

Click next after selecting Maven

How Springboot integrates Dubbo projects and environment construction

Configure module parameters

How Springboot integrates Dubbo projects and environment construction

Complete the creation of project sub-modules

Similarly, we continue with our second step and create two sub-module projects, boot-dubbo-provider and boot-dubbo-consumer, again.

After the creation is completed, our overall project structure diagram is as shown below:

How Springboot integrates Dubbo projects and environment construction

Project completion structure diagram

At this point, our preparations for creating the project have been completed.

3. Define the pom.xml file of each project

Open the pom.xml file of our top-level project boot-dubbo



 4.0.0

 com.boot
 boot-dubbo
 1.0-SNAPSHOT
 
 
  boot-dubbo-api
  boot-dubbo-provider
  boot-dubbo-consumer
 

 
 pom

 
 
  org.springframework.boot
  spring-boot-starter-parent
  1.5.7.RELEASE
 

 
 
  UTF-8
  1.8
  2.5.5
  0.10
  1.16.18
  1.5.7.RELEASE
 

 
 
  
   
   
    org.springframework.boot
    spring-boot-starter
    ${spring-boot.version}
   

   
   
    org.springframework.boot
    spring-boot-starter-web
    ${spring-boot.version}
   

   
   
    org.projectlombok
    lombok
    ${lombok.version}
    provided
   

   
   
    com.alibaba
    dubbo
    ${dubbo.version}
   

   
   
    com.101tec
    zkclient
    ${zkclient.version}
   
  
 

boot -dubbo-api pom.xml file



 
  boot-dubbo
  com.boot
  1.0-SNAPSHOT
 
 4.0.0

 boot-dubbo-api
 
  
   org.projectlombok
   lombok
   provided
  
 

boot-dubbo-provider pom.xml file



 
  boot-dubbo
  com.boot
  1.0-SNAPSHOT
 
 4.0.0
 boot-dubbo-provider
 
  
   com.boot
   boot-dubbo-api
   1.0-SNAPSHOT
  
  
   org.springframework.boot
   spring-boot-starter
  
  
   com.alibaba
   dubbo
  
  
   com.101tec
   zkclient
  
 
 
  
   
    org.springframework.boot
    spring-boot-maven-plugin
   
  
 

boot-dubbo-consumer pom.xml file



 
  boot-dubbo
  com.boot
  1.0-SNAPSHOT
 
 4.0.0
 boot-dubbo-consumer
 
  
   com.boot
   boot-dubbo-api
   1.0-SNAPSHOT
  
  
   org.springframework.boot
   spring-boot-starter
  
  
   org.springframework.boot
   spring-boot-starter-web
  
  
   com.alibaba
   dubbo
  
  
   com.101tec
   zkclient
  
 
 
  
   
    org.springframework.boot
    spring-boot-maven-plugin
   
  
 

The above is the detailed content of How Springboot integrates Dubbo projects and environment construction. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete