草庐IT

boot-args

全部标签

Spring boot starter parent 2.0.0 未找到依赖项

我决定将我的spring-boot-starter-parent更新到2.0.0.M1版本,以便与SpringCore5.0.0.RC1一起使用。但是,我在从Spring里程碑存储库下载依赖项时遇到问题。我的pom.xml4.0.0com.test.testapplicationapplication1.0-SNAPSHOTjarorg.springframework.bootspring-boot-starter-parent2.0.0.M1repository.spring.milestoneSpringMilestoneRepositoryhttp://repo.spring.i

Spring boot starter parent 2.0.0 未找到依赖项

我决定将我的spring-boot-starter-parent更新到2.0.0.M1版本,以便与SpringCore5.0.0.RC1一起使用。但是,我在从Spring里程碑存储库下载依赖项时遇到问题。我的pom.xml4.0.0com.test.testapplicationapplication1.0-SNAPSHOTjarorg.springframework.bootspring-boot-starter-parent2.0.0.M1repository.spring.milestoneSpringMilestoneRepositoryhttp://repo.spring.i

java - Spring - 属性 'name' 不允许出现在元素 'constructor-arg' 中

我在我的程序中使用hsqldb作为数据库。我想在spring中注入(inject)构造函数值。这是我的bean:我的构造函数看起来像这样:publicConnectionManager(Stringurl,Stringuser,Stringpassword){if(url==null||user==null||password==null){thrownewNullPointerException("Paramaetercannotbenull!");}this.url=url;this.user=user;this.password=password;}但是,当我想执行我得到的代码时

java - Spring - 属性 'name' 不允许出现在元素 'constructor-arg' 中

我在我的程序中使用hsqldb作为数据库。我想在spring中注入(inject)构造函数值。这是我的bean:我的构造函数看起来像这样:publicConnectionManager(Stringurl,Stringuser,Stringpassword){if(url==null||user==null||password==null){thrownewNullPointerException("Paramaetercannotbenull!");}this.url=url;this.user=user;this.password=password;}但是,当我想执行我得到的代码时

java - 我如何在 Spring Boot/MVC 中创建错误处理程序(404、500...)

几个小时以来,我试图在SpringBoot/MVC中创建一个custom全局错误处理程序。看了很多文章,一无所获。这是我的错误类:我尝试创建一个这样的类@ControllerpublicclassErrorPagesController{@RequestMapping("/404")@ResponseStatus(HttpStatus.NOT_FOUND)publicStringnotFound(){return"/error/404";}@RequestMapping("/403")@ResponseStatus(HttpStatus.FORBIDDEN)publicStringfo

java - 我如何在 Spring Boot/MVC 中创建错误处理程序(404、500...)

几个小时以来,我试图在SpringBoot/MVC中创建一个custom全局错误处理程序。看了很多文章,一无所获。这是我的错误类:我尝试创建一个这样的类@ControllerpublicclassErrorPagesController{@RequestMapping("/404")@ResponseStatus(HttpStatus.NOT_FOUND)publicStringnotFound(){return"/error/404";}@RequestMapping("/403")@ResponseStatus(HttpStatus.FORBIDDEN)publicStringfo

java - 如何在spring-boot中禁用控制台日志记录?

我正在使用spring-boot的默认日志记录配置。如何防止控制台输出,同时保持日志记录到使用logging.file=myfile.log配置的日志文件中?我的目标是没有控制台窗口输出,而只记录到该文件。无需创建特定的logback.xml配置。因为我使用spring-boot不必自己配置日志记录。 最佳答案 事实证明,如果我将以下属性设置为空,控制台日志记录将被禁用:logging.pattern.console=或者用xml注释一下-->-->--> 关于java-如何在sprin

java - 如何在spring-boot中禁用控制台日志记录?

我正在使用spring-boot的默认日志记录配置。如何防止控制台输出,同时保持日志记录到使用logging.file=myfile.log配置的日志文件中?我的目标是没有控制台窗口输出,而只记录到该文件。无需创建特定的logback.xml配置。因为我使用spring-boot不必自己配置日志记录。 最佳答案 事实证明,如果我将以下属性设置为空,控制台日志记录将被禁用:logging.pattern.console=或者用xml注释一下-->-->--> 关于java-如何在sprin

spring - 如何在 Spring boot 1.4.0 中为 @DataJpaTest 排除/禁用特定的自动配置?

我使用Spring的@DataJpaTest进行测试,然后将H2作为内存数据库中的describedhere使用.我也在使用Flyway进行生产。但是,一旦测试开始,FLyway就会启动并读取SQL文件。我怎样才能排除FlywayAutoConfiguration并按照描述保留其余部分hereinspringdocumentation为了让Hibernate为我在H2中创建表?@RunWith(SpringRunner.class)@DataJpaTestpublicclassMyRepositoryTest{@AutowiredprivateTestEntityManagerenti

spring - 如何在 Spring boot 1.4.0 中为 @DataJpaTest 排除/禁用特定的自动配置?

我使用Spring的@DataJpaTest进行测试,然后将H2作为内存数据库中的describedhere使用.我也在使用Flyway进行生产。但是,一旦测试开始,FLyway就会启动并读取SQL文件。我怎样才能排除FlywayAutoConfiguration并按照描述保留其余部分hereinspringdocumentation为了让Hibernate为我在H2中创建表?@RunWith(SpringRunner.class)@DataJpaTestpublicclassMyRepositoryTest{@AutowiredprivateTestEntityManagerenti