github / github/codeql

Autobuild does not find maven build (pom.xml) files in subdirs

未关闭
#5,331 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
question
主要语言
CodeQL
星标
10.1k
派生
2.1k
平均合并
2 天 15 小时
30 天内合并 PR
141

描述

**Description of the issue**
I have a repo with multiple Java maven projects. The default codeql-analysis.yml file looks like this:
```
jobs:
...
steps:
...
- name: Autobuild
uses: github/codeql-action/autobuild@v1
...
```
Github's advanced security workflow reports that it cannot find a suitable source file to build when pom.xml files are not in the root of the repo: ```ERROR: Could not detect a suitable build command for the source checkout.```

Is that expected?

**Workaround**
I can change it to use the find utility to search for pom.xml files and run the package goal:
```
jobs:
...
steps:
...
- if: matrix.language != 'java'
name: Autobuild
uses: github/codeql-action/autobuild@v1

- if: matrix.language == 'java'
name: Build Java
run: |
find . -name pom.xml -exec mvn -f {} package \;
...
```

**My Ask**
If that is expected, then I'm asking for an enhancement request to the autobuilder to search for pom.xml files.

Either way, I request Github doc be updated to show a solution like above for this, IMO, very common scenario.

Thanks!

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。