2

I am facing issue with Jenkins build using maven release build. The reason is for test case is failing. I am trying to skip the test cases but, its failing.

Screen shot of my Jenkins setting:-

enter image description here

Log :-

    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.

Is there anything I am missing, please suggest. Any advice would be helpful. Please help me on this.

JDGuide
  • 6,239
  • 12
  • 46
  • 64

3 Answers3

7

The parameter is -DskipTests=true. You didn't provide a value...

Slav
  • 27,057
  • 11
  • 80
  • 104
  • Thanks Slav, I have tried this option with -Darguments='-DskipTests=true' . But its not working. – JDGuide Dec 19 '14 at 04:52
  • ... Where did you come up with `-Darguments`?? Put the line from my answer, in whole and as is, into your two "goals and options" fields. – Slav Dec 19 '14 at 05:41
  • Still its not working @Slav. I have used this commond -Dresume=false release:prepare release:perform -DskipTests=true – JDGuide Dec 19 '14 at 09:07
  • 1
    You do not need to provide a value, "-DskipTests" is equivalent to "-DskipTests=true". "-Darguments" is necessary as it is a forked process. See this answer: http://stackoverflow.com/a/8685252/99231 – Bryji Jun 12 '15 at 13:06
4

The command line you are (were ?) looking for is :

release:prepare release:perform "-Darguments=-DskipTests=true" (compile tests, non execution)

or

release:prepare release:perform "-Darguments=-Dmaven.test.skip=true" (do not even compile tests)

This plugin forks Maven (at least to run the tests), so you have to use

"-Darguments=-DskipTests=true -Dproperty1=value -Dproperty2=anothervalue" 

to pass arguments to the forked process.

CSchulz
  • 10,882
  • 11
  • 60
  • 114
Olivier
  • 3,465
  • 2
  • 23
  • 26
0

This worked for me.

--batch-mode  -DskipTests -Darguments=-DskipTests  release:prepare
Andre
  • 390
  • 3
  • 8