Here I am trying to write build stage for Jenkinsfile for making CI/CD pipeline for my spring boot project. When I am building the project I usually adding the mvn clean install both in my local commandline and planned to use in Jenkinsfile also. But later I added the JUnit as Test Driven Tool implementation and test cases with my spring boot code. And running the each test cases by choosing Junit test from right click option of project root folder.
My confusion is that, when I am writing the build stage how I can build that project including JUnit test running also ? Since mvn install not applying for Junit testing. SO How I can change project building method including Junit with Maven in project building ?
Would anyone help me to clarify the doubt please?