Azure DevOps管道中的Maven生成错误

时间:2019-02-14 15:07:58

标签: java azure maven azure-devops azure-pipelines

我尝试在Azure DevOps中创建管道。我正在使用Java和Maven,这是一个非常基础的项目,只是一个类/一个方法和测试。

我使用了Azure DevOps提供的maven管道模板,但遇到编译错误:

[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] Source option 5 is no longer supported. Use 6 or later.
[ERROR] Target option 1.5 is no longer supported. Use 1.6 or later.
[INFO] 2 errors 
[INFO] -------------------------------------------------------------

我不知道什么是SourceTarget。我查看了pom.xml文件和azure-pipelines.yml文件,但没有看到关于SourceTarget的信息。

它是什么,如何将其更改为61.6

此外,我对Azure DevOps Pipeline还是陌生的,这是我与Maven合作的第一个项目。

告诉我是否需要查看我的pom.xml文件或我的azure-pipelines.yml文件以获取其他信息,但是有很基本的要求,我什么都没做(pom.xml文件是自动生成的通过IntelliJ)

非常感谢。

1 个答案:

答案 0 :(得分:1)

请尝试在pom.xml文件中添加关注脚本。

<properties> 
<maven.compiler.source>1.6</maven.compiler.source> 
<maven.compiler.target>1.6</maven.compiler.target> 
</properties>

有关更多信息,请参阅此issue