我正面临着使用maven发布版本构建Jenkins的问题。原因是测试用例失败了。我试图跳过测试用例,但是它失败了。
我Jenkins设置的屏幕截图: -
日志: -
ationTest): org.springframework.mock.jndi.SimpleNamingContext cannot be cast to org.apache.commons.dbcp.BasicDataSource
testReadNotCancelled(uk.com.xxx.yyy.sdp.bizservice.user.domain.dao.UserDaoIntegrationTest): org.springframework.mock.jndi.SimpleNamingContext cannot be cast to org.apache.commons.dbcp.BasicDataSource
testReadNotCancelledNullReturn(uk.com.xxx.yyy.sdp.bizservice.user.domain.dao.UserDaoIntegrationTest): org.springframework.mock.jndi.SimpleNamingContext cannot be cast to org.apache.commons.dbcp.BasicDataSource
testSaveUserPasswordReset(uk.com.xxx.yyy.sdp.bizservice.user.domain.dao.UserDaoIntegrationTest): org.springframework.mock.jndi.SimpleNamingContext cannot be cast to org.apache.commons.dbcp.BasicDataSource
testSaveUserPasswordChange(uk.com.xxx.yyy.sdp.bizservice.user.domain.dao.UserDaoIntegrationTest): org.springframework.mock.jndi.SimpleNamingContext cannot be cast to org.apache.commons.dbcp.BasicDataSource
Tests run: 232, Failures: 1, Errors: 135, Skipped: 3
[ERROR] There are test failures.
我有什么遗漏,请建议。 任何意见将是有益的。请帮帮我。
答案 0 :(得分:5)
参数为-DskipTests=true
。你没有提供价值......
答案 1 :(得分:4)
您正在寻找的命令行是:
release:prepare release:perform "-Darguments=-DskipTests=true" (compile tests, non execution)
或
release:prepare release:perform "-Darguments=-Dmaven.test.skip=true" (do not even compile tests)
这个插件分支Maven(至少要运行测试),所以你必须使用
"-Darguments=-DskipTests=true -Dproperty1=value -Dproperty2=anothervalue"
将参数传递给分叉进程。
答案 2 :(得分:0)
这对我有用。
--batch-mode -DskipTests -Darguments=-DskipTests release:prepare