shimh-develop / blog-vue-springboot

基于Vue+SpringBoot构建的博客项目
1.93k stars 552 forks source link

项目打包问题 #1

Closed yehongwei closed 6 years ago

yehongwei commented 6 years ago

这个项目在执行maven install的时候报错,怎么打包呢? 在Springboot打包的时候,可以自动启动前端webpack打包并把前端打包后的文件拷贝到Springboot里面来吗?

shimh-develop commented 6 years ago

1 什么错,install的时候勾选 skip Tests 试一下; 2 两个没有什么关系吧,除非自己写一个?没必要啊

yehongwei commented 6 years ago

deleteTest(com.shimh.service.UserServiceTest) Time elapsed: 0.008 sec <<< ERROR! org.springframework.dao.EmptyResultDataAccessException: No class com.shimh.entity.User entity with id 3 exists! at org.springframework.data.jpa.repository.support.SimpleJpaRepository.delete(SimpleJpaRepository.java:154) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:520) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:505) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:477) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:56) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:133) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor.invoke(SurroundingTransactionDetectorMethodInterceptor.java:57) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213) at com.sun.proxy.$Proxy118.delete(Unknown Source) at com.shimh.service.impl.UserServiceImpl.deleteUserById(UserServiceImpl.java:69) at com.shimh.service.UserServiceTest.deleteTest(UserServiceTest.java:71)

2018-03-02 16:57:00.695 INFO org.springframework.context.support.AbstractApplicationContext 984 doClose - Closing org.springframework.web.context.support.GenericWebApplicationContext@61e94def: startup date [Fri Mar 02 16:56:06 CST 2018]; root of context hierarchy

Results :

Failed tests: UserControllerTest.deleteTest:98 Status expected:<200> but was:<500> UserControllerTest.saveUserTest:50 Status expected:<200> but was:<500> UserControllerTest.updateUserTest:87 Status expected:<200> but was:<500> Tests in error: RedisManagerTest.deleteTest:32 » RedisConnectionFailure Cannot get Jedis conne... RedisManagerTest.getTest:25 » RedisConnectionFailure Cannot get Jedis connecti... UserServiceTest.deleteTest:71 » EmptyResultDataAccess No class com.shimh.entit... UserServiceTest.saveUserTest:42 » DataIntegrityViolation could not execute sta... UserServiceTest.updateUserTest:65 » NullPointer

Tests run: 33, Failures: 3, Errors: 5, Skipped: 0

[INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE

Skip Test之后就正常了。

shimh-develop commented 6 years ago

TestCase不规范,哈哈