I am trying to build a Jenkins Pipeline for my Spring Boot (Maven) project. It is all working fine. However, i am trying to run my Karate Framework related tests under my project. However my Karate tests are not written in src
directory of the project.
Here is the project, that I am trying to build: https://github.com/shah-smit/spring-boot-karate-contract-testing
Here is my Jenkins File, that can be also found in the above repo:
pipeline{
agent any
stages {
stage('Compile Stage'){
steps {
withMaven(maven: 'maven_3_6_3'){
sh 'mvn clean compile'
}
}
}
stage('Testing Stage'){
steps {
withMaven(maven: 'maven_3_6_3'){
sh 'mvn test'
}
}
}
stage('Package Stage'){
steps {
withMaven(maven: 'maven_3_6_3'){
sh 'mvn package'
}
}
}
}
}
Here is my pom.xml
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
<configuration>
<excludes>
<exclude>karate/**/*.java</exclude>
</excludes>
<includes>
<include>com/**/*.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>