자바 7과 파이프라인으로 애플리케이션 컴파일

6469 단어 javacidevopsazure
Puede que no sea el caso para la mayoría de los proyectos, pero si tu aplicación dependse de un S.O. de 32비트; es imposible actualizar la versión de Java.

Ello no impide automatizar la construcción, mediante un Pipeline de Azure.


Los aspectos a tener en cuenta:
  • Proveer las herramientas necesarias
  • JDK 1.7
  • 개미 1.19

  • 컴파일 이전 구성 설치

  • 추천할 만한 것은 전체 소스 코드에 이진법을 포함하지 않는 것입니다. Por esa razón (y facilidad al usar GIT) se creo un repositorio que contiene los archivos necesarios.

    https://gitlab.com/edgar.gs/posunificado-build-java7.git

    azure-pipeline.yml 문서 형식:

    # Ant
    # Build your Java projects and run tests with Apache Ant.
    # Add steps that save build artifacts and more:
    # https://docs.microsoft.com/azure/devops/pipelines/languages/java
    
    trigger:
    - master
    
    pool:
      vmImage: windows-latest
    
    steps:
    - script: |
        git clone https://gitlab.com/edgar.gs/posunificado-build-java7.git
    - task: CopyFiles@2
      inputs:
        SourceFolder: 'posunificado-build-java7/build/jre7/lib/'
        Contents: '*.jar'
        TargetFolder: 'C:\jre7\lib'    
    - task: JavaToolInstaller@0
      inputs:
        versionSpec: '7'
        jdkArchitectureOption: 'x86'
        jdkSourceOption: LocalStorage
        jdkFile: 'posunificado-build-java7/build/jdk1.7.0_65.7z'
        jdkDestinationDirectory: '$(agent.toolsDirectory)/jdk7'
        cleanDestinationDirectory: false
    - task: ExtractFiles@1
      inputs:
        archiveFilePatterns: 'posunificado-build-java7\build\apache-ant-1.9.16-bin.zip'
        #destinationFolder:
        cleanDestinationFolder: false
        overwriteExistingFiles: false    
    - task: Ant@1
      inputs:
        antHomeDirectory: 'apache-ant-1.9.16'
        workingDirectory: ''
        buildFile: 'fps-app-ws-posunificado/build-azure.xml'
        javaHomeOption: 'JDKVersion'
        jdkVersionOption: '1.7'
        jdkArchitectureOption: 'x86'
        publishJUnitResults: false
        #testResultsFiles: '**/TEST-*.xml'
    - task: CopyFiles@2
      inputs:
        contents: 'fps-app-ws-posunificado/deploy/**'
        targetFolder: $(Build.ArtifactStagingDirectory)
    - task: PublishBuildArtifacts@1
      inputs:
        pathToPublish: $(Build.ArtifactStagingDirectory)
        artifactName: MyBuildOutputs
    



    Se puede observar la ejecución en el siguiente video:




    문서화



    https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/tool/java-tool-installer?view=azure-devops
    https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/ant?view=azure-devops

    좋은 웹페이지 즐겨찾기