环境版本:
- 基于java 1.8
- Spring cloud 版本 :Greenwich.SR2
- Spring boot 版本 : 2.1.7.RELEASE
- 数据库DM7(达梦数据库)
处理过程中出现的错误:
- eureka正常启动 无法访问eureka注册中心(404)
- 生产端发布启动报错(无法启动子系统,bean生成报错等)
处理过程:
1,修改spring-boot-starter-web
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
原jar包时pom此处为:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
2,修改maven plugins
修改为
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<!-- 是否注释由是否有导入外部jar决定 -->
<!--<configuration>-->
<!--<!–<failOnMissingWebXml>false</failOnMissingWebXml>–>-->
<!--<webResources>-->
<!--<resource>-->
<!--<directory>/src/main/resources/lib</directory>-->
<!--<targetPath>WEB-INF/lib/</targetPath>-->
<!--<includes>-->
<!--<include>**/*.jar</include>-->
<!--</includes>-->
<!--</resource>-->
<!--</webResources>-->
<!--</configuration>-->
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
</build>
原jar包时为
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<executable>true</executable>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
</plugins>
</build>