mvn spring-boot:run运行不了的解决办法

1)由于maven缺少对应包

修改maven 文件夹中的settings.xml ,增加下面语句
    
    <profile>    
        <id>jdk-1.8</id>    
        <activation>    
            <activeByDefault>true</activeByDefault>    
            <jdk>1.8</jdk>    
        </activation>    
    <properties>    
    <maven.compiler.source>1.8</maven.compiler.source>    
    <maven.compiler.target>1.8</maven.compiler.target>    
    <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>    
    </properties>    
    </profile>
    
    <profile>
    <repositories>
    <repository>
        <id>spring-releases</id>
        <url>https://repo.spring.io/libs-release</url>
    </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
        <id>spring-releases</id>
        <url>https://repo.spring.io/libs-release</url>
        </pluginRepository>
    </pluginRepositories>
    </profile>

2.在命令行运行 mvn spring-boot:run 时,确认在你项目所在的,并包含了该pom.xml的文件夹下。

时间: 2024-07-31 13:06:23

mvn spring-boot:run运行不了的解决办法的相关文章

spring boot中log4j冲突问题和解决办法

Spring Boot中自带了log4j日志管理.写法应该是: private static final Logger logger = Logger.getLogger(XXX.class); 而不是: private Logger logger = LoggerFactory.getLogger(XXX.class); 这两个类属于的包不同,前者属于log4j-over-slf4j-1.7.25.jar:后者属于slf4j-api-1.7.25.jar.两个jar包都属于org.slf4j下

Spring Boot @Transactional 不回滚的解决办法

当抛出编译时异常时,事务不回滚,Employee成功插入数据. 1 @Transactional 2 public Employee saveEmployee() throws Exception { 3 Employee employee = new Employee(); 4 employee.setName("zz"); 5 employee.setAge(60); 6 employeeMapper.insert(employee); 7 8 if (employee.getAg

PHP运行错最有效解决办法Fatal error: Out of memory (allocated 786432) (tried to allocate 98304 bytes) in H:\freehost\zhengbao2\web\includes\lib_common.php on line 744

原文 PHP运行错最有效解决办法Fatal error: Out of memory (allocated 6029312) Fatal error: Out of memory (allocated 786432) (tried to allocate 98304 bytes) in H:\freehost\zhengbao2\web\includes\lib_common.php on line 744疑问:786432 是指786432bytes?即:768MB 98304 bytes=9

Spring Boot 6-SpringBoot运行原理实现

Spring Boot自动配置实战 1.新建Spring-boot-starter-hello项目. 2.新建HelloService.java package com.tzp.helloworld.helloservice; public class HelloService { private String msg; public String sayHello() { return "=======>>" + msg; } public String getMsg()

Spring Boot定时任务运行一段时间后自动关闭的解决办法

用Spring Boot默认支持的 Scheduler来运行定时任务,有时在服务器运行一段时间后会自动关闭.原因:Schedule默认是单线程运行定时任务的,即使是多个不同的定时任务,默认也是单线程运行.当线程挂掉时,定时任务也随之终止. 解决方法: 一.改为多线程执行定时任务: 加一个配置类,实现SchedulingConfigurer接口,重写configureTasks方法即可: import org.springframework.context.annotation.Configura

Spring Boot 6-SpringBoot运行原理

springboot运行原理springboot为我们做了自动配置.主要是spring-boot-autoconfigure.jar 关于springboot的原理,我们还是回归到@SpringbootApplication注解.他的核心功能主要由@EnableAutoConfiguration提供. @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @Documented @Inherited @AutoConfigur

cocos2d-x 3.6运行cocos run出现Ndk build failed解决办法

我运行cocos run -p android编译成安卓APK的时候提示:jni/../../Classes/AppDelegate.cpp:67: error: undefined reference to 'GameMain::c reateScene()', 最后出现错误提示:Ndk build failed!,其中GameMain是我自己写的代码,. 后来找到了原因,有两种解决办法: 第一种方法:在\proj.android\jni下面的Android.mk的文件里面,在LOCAL_SR

Spring Boot微服务如何集成fescar解决分布式事务?

什么是fescar? 关于fescar的详细介绍,请参阅fescar wiki. 传统的2PC提交协议,会持有一个全局性的锁,所有局部事务预提交成功后一起提交,或有一个局部事务预提交失败后一起回滚,最后释放全局锁.锁持有的时间较长,会对并发造成较大的影响,死锁的风险也较高. fescar的创新之处在于,每个局部事务执行完立即提交,释放本地锁:它会去解析你代码中的sql,从数据库中获得事务提交前的事务资源即数据,存放到undo_log中,全局事务协调器在回滚的时候直接使用undo_log中的数据覆

Learn Rails5.2- ActiveRecord: Migration , spring的使用(不兼容的解决办法)

偶然一次: 运行rails generate停止不动,网上查找答案,可能是bundle update 之后 spring 版本变化了,和正在运行的 spring 实例不兼容. Spring导致的同样的原因: rails g migration后,窗口显示了生成迁移文件,但文件树结构上没有显示这个文件. rails console停止不动,打不开控制台. 解决办法: 关闭spring, spring stop ??,如果谷歌上查找问题,中文描述问题找不到好的结果,改用英文描述问题,然后搜索. ht