maven

Eclipse搭建SSM框架

亡梦爱人 提交于 2021-01-21 08:17:22
Eclipse搭建SSM框架 1、 window—preference:进行sever及maven配置; 2、 进行JDK及tomcat集成 配置及集成步骤详见网上案例; 3、 开始进行SSM框架搭建 File—new Project—maven 4、 填写项目的maven坐标 5、 添加pom.xml全局依赖jar包 6、 pom.xml加入Maven编译插件,并配置JDK和编码 7、 在src/main/resources目录下创建spring和mapping文件夹,根目录放jdbc和log4j日志配置文件; Spring:用于放入Spring配置文件; Mapping:用于放入MyBatis的映射文件 8、 在src/main/resources下创建MyBatis配置文件:mybatis-config.xml 9、 在src/main/resources/spring目录下创建配置文件:spring-mybatis.xml 配置声明了spring上下文的配置,还声明了spring与mybatis的配置 10、Spring与SpringMVC整合:spring-mvc.xml 11、配置WEB-INF下的web.xml文件 12、配置完成后创建对应接口进行测试。 来源: oschina 链接: https://my.oschina.net/u/4316069/blog

Surefire rerun failing tests not working

你。 提交于 2021-01-21 08:14:48
问题 I want to rerun a test that I know will fail cause I am trying to test the Surefire parameter for re-running the failing tests. I tried running Maven with these two commands neither of them works as expected -Dsurefire.rerunFailingTestsCount=2 -Dtest=TestThatFails test and -Dsurefire.rerunFailingTestsCount=2 -Dtest=TestThatFails surefire:test Here is part of pom.xml <dependency> <groupId>org.apache.maven.surefire</groupId> <artifactId>surefire-api</artifactId> <version>2.19.1</version> <

Surefire rerun failing tests not working

别来无恙 提交于 2021-01-21 08:14:05
问题 I want to rerun a test that I know will fail cause I am trying to test the Surefire parameter for re-running the failing tests. I tried running Maven with these two commands neither of them works as expected -Dsurefire.rerunFailingTestsCount=2 -Dtest=TestThatFails test and -Dsurefire.rerunFailingTestsCount=2 -Dtest=TestThatFails surefire:test Here is part of pom.xml <dependency> <groupId>org.apache.maven.surefire</groupId> <artifactId>surefire-api</artifactId> <version>2.19.1</version> <

SSM框架启动报 org.apache.bval.jsr303.ConfigurationImpl.getDefaultParameterNameProvider

情到浓时终转凉″ 提交于 2021-01-21 08:13:33
今天在做项目,在启动的时候报了一个错。错误信息是org.apache.bval.jsr303.ConfigurationImpl.getDefaultParameterNameProvider。 原因:使用了bval-jsr303.jar这个jar包。而Spring4.0之后不再支持这个jar包了。出现了该错误。 解决办法:把bval-jsr303这个jar换成hibernate-validator。Maven依赖如下: 删除该依赖 <dependency> <groupId>org.apache.bval</groupId> <artifactId>bval-jsr303</artifactId> <version>0.5</version> </dependency> 添加此依赖 <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> <version>5.2.4.Final</version> </dependency> 来源: oschina 链接: https://my.oschina.net/u/4276314/blog/3533093

如何优雅地终止一个线程?

牧云@^-^@ 提交于 2021-01-21 07:26:22
我们的系统肯定有些线程为了保证业务需要是要常驻后台的,一般它们不会自己终止,需要我们通过手动来终止它们。我们知道启动一个线程是start方法,自然有一个对应的终止线程的stop方法,通过stop方法可以很快速、方便地终止一个线程,我们来看看stop的源代码。 通过注解@Deprecated看出stop方法被标为废弃的方法,jdk在以后的版本中可能被移除,不建议大家使用这种API。 那为什么这么好的一个方法怎么不推荐使用,还要标注为废弃呢? 假设有这样的一个业务场景,一个线程正在处理一个复杂的业务流程,突然间线程被调用stop而意外终止,这个业务数据还有可能是一致的吗?这样是肯定会出问题的,stop会释放锁并强制终止线程,造成执行一半的线程终止,带来的后果也是可想而知的,这就是为什么jdk不推荐使用stop终止线程的方法的原因,因为它很暴力会带来数据不一致性的问题。 正因为stop方法太过暴力,所以一般不推荐使用,除非你非常清楚你自己的业务场景,用stop终止不会给你的业务带来影响。 说了这么多,那如何优雅地终止一个线程呢?看看下面的程序。 其实也不难,只需要添加一个变量,判断这个变量在某个值的时候就退出循环,这时候每个循环为一个整合不被强行终止就不会影响单个业务的执行结果。 推荐去我的博客阅读更多: 1. Java JVM、集合、多线程、新特性系列教程 2. Spring MVC

How to debug integration test in IntelliJ?

安稳与你 提交于 2021-01-21 07:14:55
问题 I have created run configuration in Maven Projects for mvn -Dit.test=PredictionWorkflowTest verify which looks like here and then set breakpoint inside PredictionWorkflowTest . Unfortunately, when I right click this configuration and select to debug it, tests passes as if no breakpoint were set. How to make breakpoints working? If I run test by clicking class itself, then breakpoints trigger, but integration conditions don't me (servers not starting). 回答1: Step 1: Add debug to maven run

How to debug integration test in IntelliJ?

半腔热情 提交于 2021-01-21 07:12:30
问题 I have created run configuration in Maven Projects for mvn -Dit.test=PredictionWorkflowTest verify which looks like here and then set breakpoint inside PredictionWorkflowTest . Unfortunately, when I right click this configuration and select to debug it, tests passes as if no breakpoint were set. How to make breakpoints working? If I run test by clicking class itself, then breakpoints trigger, but integration conditions don't me (servers not starting). 回答1: Step 1: Add debug to maven run

How to debug integration test in IntelliJ?

…衆ロ難τιáo~ 提交于 2021-01-21 07:11:39
问题 I have created run configuration in Maven Projects for mvn -Dit.test=PredictionWorkflowTest verify which looks like here and then set breakpoint inside PredictionWorkflowTest . Unfortunately, when I right click this configuration and select to debug it, tests passes as if no breakpoint were set. How to make breakpoints working? If I run test by clicking class itself, then breakpoints trigger, but integration conditions don't me (servers not starting). 回答1: Step 1: Add debug to maven run

How to debug integration test in IntelliJ?

眉间皱痕 提交于 2021-01-21 07:11:22
问题 I have created run configuration in Maven Projects for mvn -Dit.test=PredictionWorkflowTest verify which looks like here and then set breakpoint inside PredictionWorkflowTest . Unfortunately, when I right click this configuration and select to debug it, tests passes as if no breakpoint were set. How to make breakpoints working? If I run test by clicking class itself, then breakpoints trigger, but integration conditions don't me (servers not starting). 回答1: Step 1: Add debug to maven run

“The Bean Validation API is on the classpath but no implementation could be found” preventing startup

萝らか妹 提交于 2021-01-21 06:36:08
问题 I am using Spring Tool Suite to work with ReST services in Java. But at the very first point I am not able to start my first simple application. Please help. I am getting below error. [Using Java8, STS suite, Ubuntu 16.04, $Java_Home: /usr/lib/jvm/java-8-oracle . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot ::