Getting ERROR Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M7:test (default-test)on project : in Azure DevOps Pipeline

Viewed 45

Not able to trigger TestNG testcases in Azure DevOps pipeline it is failing with maven-surefire-plugin, how ever it is working in IntelliJ local

This is the error Message I'm getting when I trigger the pipeline



    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M7:test (default-test) on project community: 
    [ERROR] 
    [ERROR] Please refer to D:\a\1\s\target\surefire-reports for the individual test results.
    [ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
    [ERROR] Exception in provider
    [ERROR] org.apache.maven.surefire.booter.SurefireExecutionException: Exception in provider
    
        [ERROR] Caused by: org.testng.TestNGException: 
        [ERROR] Cannot find class in classpath: WfmsgFunctionalitiesSmokeTestcases.WfmsgSimpleLoginTest
        [ERROR]     at org.testng.xml.XmlClass.loadClass(XmlClass.java:81)
        [ERROR]     at org.testng.xml.XmlClass.init(XmlClass.java:73)
        [ERROR]     at org.testng.xml.XmlClass.<init>(XmlClass.java:59)
        [ERROR]     at org.testng.xml.TestNGContentHandler.startElement(TestNGContentHandler.java:548)
        [ERROR]     at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
        [ERROR]     at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:183)
        [ERROR]     at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.emptyElement(XMLDTDValidator.java:765)

This is my pipeline yaml that is used while creating maven pipeline

    trigger:
    - master
    
    pool:
      vmImage: windows-latest
    
    steps:
    - task: Maven@3
      inputs:
        mavenPomFile: 'pom.xml'
        goals: 'test'
        publishJUnitResults: true
        testResultsFiles: '**/surefire-reports/TEST-*.xml'
        javaHomeOption: 'JDKVersion'
        jdkVersionOption: 1.8
        jdkArchitectureOption: 'x64'
        mavenVersionOption: '-Xmx3072m'
        mavenAuthenticateFeed: false
        effectivePomSkip: false
        sonarQubeRunAnalysis: false
0 Answers
Related