caoheike
caoheike
采纳率29.3%
2017-08-03 09:57 阅读 1.4k

spring boot 启动问题

10

mvn spring-boot:run
出现以下异常

图片说明

求大神解决 我先cd到项目目录 可见pom.xml 然后执行的以上命令

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

5条回答 默认 最新

  • qq455276333 在路上的JavaCoder-尹骑 2017-08-03 10:38
     <build>
            <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <useSystemClassLoader>false</useSystemClassLoader>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    

    需要添加上面的插件

    点赞 1 评论 复制链接分享
  • littlebrain4solving littlebrain4solving 2017-08-03 13:36

    方便把你的代码放到某个git仓库吗?这样我可以进行git clone下来进行修改,改好之后通知你。

    点赞 评论 复制链接分享
  • littlebrain4solving littlebrain4solving 2017-08-03 13:40

    另外可以参考下面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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <groupId>com.github.caryyu</groupId>
        <artifactId>xxx</artifactId>
        <version>0.0.1</version>
        <packaging>jar</packaging>
        <name>xxx</name>
        <description>xxx project for Spring Boot</description>
    
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.4.2.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
    </properties>
    
    <repositories>
        <repository>
            <id>central</id>
            <name>Aliyun Central</name>
            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
        </repository>
    </repositories>
    
    <pluginRepositories>
        <pluginRepository>
            <id>central</id>
            <name>Aliyun Central</name>
            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
        </pluginRepository>
    </pluginRepositories>
    
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    
    <build>
        <finalName>${name}</finalName>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
    

    点赞 评论 复制链接分享
  • zy841958835 cloudyzhao 2017-08-04 00:34

    你本地仓库有木有下载好呀

    点赞 评论 复制链接分享
  • Jamie_Jiang 姜姜好呢 2017-08-04 01:39

相关推荐