Twitter11
2021-09-24 17:17
采纳率: 100%
浏览 26
已结题

springboot项目启动报错

本地建个demo,导入公司jar,一直跑不起来
控制台贴图:

img

pom文件:

<?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>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.5.5</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.zc</groupId>
    <artifactId>tomodemo</artifactId>
    <version>1.0.0</version>
    <name>tomodemo</name>
    <description>Demo project for Spring Boot</description>
    <properties>
        <java.version>1.8</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <tomo-dependencies.version>1.0.0</tomo-dependencies.version>
        <maven.resources.overwrite>true</maven.resources.overwrite>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.tomo.cloud.common</groupId>
                <artifactId>tomo-dependencies</artifactId>
                <version>${tomo-dependencies.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.tomo.cloud.common</groupId>
            <artifactId>tomo-common-boot-starter</artifactId>
            <version>1.0.0</version>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>

<!--        <dependency>-->
<!--            <groupId>org.springframework</groupId>-->
<!--            <artifactId>spring-core</artifactId>-->
<!--            <version>5.3.6</version>-->
<!--        </dependency>-->

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <id>nexus-releases</id>
            <name>nexus</name>
            <url>此处省略</url>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>
    </repositories>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>



  • 好问题 提建议
  • 收藏

3条回答 默认 最新

  • kk1924 2021-09-24 17:19
    已采纳

    估计是包冲突了,
    你看看依赖树

    已采纳该答案
    评论
    解决 无用 1
    打赏 举报
  • 两个猕猴桃 2021-09-24 18:09

    加入

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
      <version>2.3.3.RELEASE</version>
    </dependency>
    
    
    评论
    解决 无用
    打赏 举报
  • Twitter11 2021-09-26 10:00

    已经解决,公司jar继承了大部分依赖,有些不用,再排除些依赖就好啦

    
    ```xml
        <parent>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-parent</artifactId>
            <version>2.5.5</version>
            <relativePath/> <!-- lookup parent from repository -->
        </parent>
    
    

    这个不用的

    ```

    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题