【发布时间】:2020-08-14 13:40:04
【问题描述】:
我想创建部署 Java Azure Function 的管道,但失败了。请给我建议。 我以教程为基础,但我使用的是 Azure DevOps 的 Git Repo 而不是 GitHub。 https://docs.microsoft.com/en-us/azure/devops/pipelines/ecosystems/java-function?view=azure-devops
POM 文件位于 /pipelines-java-function-master/pom.xml 的 zip 文件中
我的错误是:
Starting: Maven
==============================================================================
Task : Maven
Description : Build, test, and deploy with Apache Maven
Version : 3.168.0
Author : Microsoft Corporation
Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/maven
==============================================================================
##[error] Unhandled: Not found mavenPOMFile: /home/vsts/work/1/s/pom.xml
Finishing: Maven
我的 YAML 是:
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
# at the top of your YAML file
# set some variables that you'll need when you deploy
variables:
# the name of the service connection that you created above
serviceConnectionToAzure: name-of-your-service-connection
# the name of your web app here is the same one you used above
# when you created the web app using the Azure CLI
appName: JavaFuncApp
# ...
# Maven
# Build your Java project and run tests with Apache Maven.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/java
steps:
- task: Maven@3
inputs:
mavenPomFile: 'pom.xml'
mavenOptions: '-Xmx3072m'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
jdkArchitectureOption: 'x64'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
goals: 'package'
# ...
# add these as the last steps
# to deploy to your app service
- task: CopyFiles@2
displayName: Copy Files
inputs:
SourceFolder: $(system.defaultworkingdirectory)/target/azure-functions/
Contents: '**'
TargetFolder: $(build.artifactstagingdirectory)
- task: PublishBuildArtifacts@1
displayName: Publish Artifact
inputs:
PathtoPublish: $(build.artifactstagingdirectory)
- task: AzureWebApp@1
inputs:
azureSubscription: 'connection-to-MyTestRG-rg'
appType: 'webApp'
appName: '$(appName)'
package: '$(System.DefaultWorkingDirectory)/pipelines-java-function-master.zip'
deploymentMethod: 'auto'
【问题讨论】:
-
请问这个周末后的状态如何?
标签: java azure-devops azure-functions