I am currently addressing a version mismatch between Java and Extent in Azure DevOps,

Rajat Kumar 0 Reputation points
2024-01-08T06:49:24.9466667+00:00

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project JiviPipelineAzure: Compilation failure - Fatal error compiling: invalid target release: 11 -> [Help 1].

trigger:
- master

pool:
  vmImage: 'windows-latest'

stages:
- stage: Build
  jobs:
  - job: InstallJavaa
    steps:
    - task: UseJavaVersion@0
      inputs:
        versionSpec: '11'
        addToPath: true  # Add Java to the PATH environment variable

    - task: JavaToolInstaller@0
      inputs:
        versionSpec: '11'
        jdkArchitectureOption: 'x64'
        jdkSourceOption: 'PreInstalled'

  - job: MavenBuild
    steps:
    - checkout: self
    - task: Maven@4
      inputs:
        mavenPomFile: 'pom.xml'
        goals: 'clean test'
        options: '-e -X -Dsurefire.suiteXmlFiles=testng.xml'
        publishJUnitResults: true
        testResultsFiles: '**/surefire-reports/TEST-*.xml'
        javaHomeOption: 'JDKVersion'
        mavenVersionOption: 'Default'
        mavenAuthenticateFeed: false
        effectivePomSkip: false
        sonarQubeRunAnalysis: false

    - task: CopyFiles@2
      displayName: 'Copy ExtentReport Files'
      inputs:
        SourceFolder: '$(system.defaultworkingdirectory)'
        Contents: '**/ExtentReport/**'
        TargetFolder: '$(build.artifactstagingdirectory)'

    - task: CopyFiles@2 
      displayName: 'Copy Screenshots'
      inputs:
        SourceFolder: '$(system.defaultworkingdirectory)/ScreenShot'
        Contents: '**/*.png'
        TargetFolder: '$(build.artifactstagingdirectory)/ScreenShot'

    - task: CopyFiles@2
      displayName: 'Copy Emailable Report'
      inputs:
        SourceFolder: '$(system.defaultworkingdirectory)/target/surefire-reports'
        Contents: 'emailable-report.html'
        TargetFolder: '$(build.artifactstagingdirectory)/EmailableReport'

    - task: PublishBuildArtifacts@1
      displayName: 'Publish Artifact: drop'
      inputs:
        PathtoPublish: '$(build.artifactstagingdirectory)'

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
43,571 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Monalla-MSFT 13,066 Reputation points
    2024-01-09T01:59:37.41+00:00

    @Rajat Kumar - Welcome to Microsoft Q&A and thanks for reaching out.

    Devops is not currently supported here on Microsoft QnA.

    The Community Members and Engineers are actively answering questions in dedicated forums here. Please post your question in that forum:

    https://developercommunity.visualstudio.com/spaces/21/index.html

    https://azure.microsoft.com/en-in/support/devops/

    Hope this helps. and please feel free to reach out if you have any further questions.


    If the above response was helpful, please feel free to "Accept as Answer" and "Upvote" the same so it can be beneficial to the community.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.