1、删除service下的 src。

    2、添加模块类型是pom,
    节点后面添加 pom类型

    <artifactId>service</artifactId>
    <packaging>pom</packaging>

    3、添加项目需要的依赖 ,并把SpringClud的一些依赖注释掉,因为不用到,开发过程可能会出错。

    1. <!-- 注掉的依赖 -->
    2. <!-- <dependency>
    3. <groupId>org.springframework.cloud</groupId>
    4. <artifactId>spring-cloud-starter-netflix-ribbon</artifactId>
    5. </dependency>-->
    6. <!-- &lt;!&ndash;hystrix依赖,主要是用 @HystrixCommand &ndash;&gt;
    7. <dependency>
    8. <groupId>org.springframework.cloud</groupId>
    9. <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
    10. </dependency>-->
    11. <!--服务注册-->
    12. <!-- <dependency>
    13. <groupId>org.springframework.cloud</groupId>
    14. <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
    15. </dependency>-->
    16. <!--服务调用-->
    17. <!-- <dependency>
    18. <groupId>org.springframework.cloud</groupId>
    19. <artifactId>spring-cloud-starter-openfeign</artifactId>
    20. </dependency>-->
    1. <dependencies>
    2. <dependency>
    3. <groupId>org.springframework.cloud</groupId>
    4. <artifactId>spring-cloud-starter-netflix-ribbon</artifactId>
    5. </dependency>
    6. <!--hystrix依赖,主要是用 @HystrixCommand -->
    7. <dependency>
    8. <groupId>org.springframework.cloud</groupId>
    9. <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
    10. </dependency>
    11. <!--服务注册-->
    12. <dependency>
    13. <groupId>org.springframework.cloud</groupId>
    14. <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
    15. </dependency>
    16. <!--服务调用-->
    17. <dependency>
    18. <groupId>org.springframework.cloud</groupId>
    19. <artifactId>spring-cloud-starter-openfeign</artifactId>
    20. </dependency>
    21. <dependency>
    22. <groupId>org.springframework.boot</groupId>
    23. <artifactId>spring-boot-starter-web</artifactId>
    24. </dependency>
    25. <!--mybatis-plus-->
    26. <dependency>
    27. <groupId>com.baomidou</groupId>
    28. <artifactId>mybatis-plus-boot-starter</artifactId>
    29. </dependency>
    30. <!--mysql-->
    31. <dependency>
    32. <groupId>mysql</groupId>
    33. <artifactId>mysql-connector-java</artifactId>
    34. </dependency>
    35. <!-- velocity 模板引擎, Mybatis Plus 代码生成器需要 -->
    36. <dependency>
    37. <groupId>org.apache.velocity</groupId>
    38. <artifactId>velocity-engine-core</artifactId>
    39. </dependency>
    40. <!--swagger-->
    41. <dependency>
    42. <groupId>io.springfox</groupId>
    43. <artifactId>springfox-swagger2</artifactId>
    44. </dependency>
    45. <dependency>
    46. <groupId>io.springfox</groupId>
    47. <artifactId>springfox-swagger-ui</artifactId>
    48. </dependency>
    49. <!--lombok用来简化实体类:需要安装lombok插件-->
    50. <dependency>
    51. <groupId>org.projectlombok</groupId>
    52. <artifactId>lombok</artifactId>
    53. </dependency>
    54. <!--xls-->
    55. <dependency>
    56. <groupId>org.apache.poi</groupId>
    57. <artifactId>poi</artifactId>
    58. </dependency>
    59. <dependency>
    60. <groupId>org.apache.poi</groupId>
    61. <artifactId>poi-ooxml</artifactId>
    62. </dependency>
    63. <dependency>
    64. <groupId>commons-fileupload</groupId>
    65. <artifactId>commons-fileupload</artifactId>
    66. </dependency>
    67. <!--httpclient-->
    68. <dependency>
    69. <groupId>org.apache.httpcomponents</groupId>
    70. <artifactId>httpclient</artifactId>
    71. </dependency>
    72. <!--commons-io-->
    73. <dependency>
    74. <groupId>commons-io</groupId>
    75. <artifactId>commons-io</artifactId>
    76. </dependency>
    77. <!--gson-->
    78. <dependency>
    79. <groupId>com.google.code.gson</groupId>
    80. <artifactId>gson</artifactId>
    81. </dependency>
    82. <dependency>
    83. <groupId>junit</groupId>
    84. <artifactId>junit</artifactId>
    85. <version>4.12</version>
    86. </dependency>
    87. </dependencies>