我正在尝试运行github action并构建tibco bw 6应用程序并部署TEA,这是我的github action yaml
这是第一个管道
name: Tibco Workflow
on:
pull_request:
branches: [ development ]
jobs:
Run-PSScriptAnalyzer-on-Windows:
name: Run PSScriptAnalyzer on Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Install PSScriptAnalyzer module
shell: pwsh
run: |
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module PSScriptAnalyzer -ErrorAction Stop
- name: Get list of rules
shell: pwsh
run: |
Get-ScriptAnalyzerRule
build:
needs: Run-PSScriptAnalyzer-on-Windows
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'adopt'
cache: maven
- name: Build BW6 Application
run: mvn clean install
但它抛出下面的错误:
Error: The goal you specified requires a project to execute but there is no POM in this directory (D:\a\ee.entEvent.eventMsg.vendorNetcool\ee.entEvent.eventMsg.vendorNetcool). Please verify you invoked Maven from the correct directory. -> [Help 1]
Error:
Error: To see the full stack trace of the errors, re-run Maven with the -e switch.
Error: Re-run Maven using the -X switch to enable full debug logging.
Error:
Error: For more information about the errors and possible solutions, please read the following articles:
Error: [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException
Error: Process completed with exit code 1.
Github runner是一个github托管的windows服务器,此路径((D:\a\ee.entEvent.eventMsg.vendorNetcool\ee.entEvent.eventMsg.vendorNetcool)甚至不存在于服务器中,不确定github action是否在任何特定的地方克隆了repo内容(例如jenkins将repo内容存储在/home/jenkins/workspace中)
1条答案
按热度按时间gpfsuwkq1#
您的
pom.xml
是否在仓库根目录下?路径为默认工作目录。
在不指定任何其他
working-directory:
(可以为整个工作流、每个作业或每个步骤设置)的情况下,步骤将在windows-latest
运行器上执行的文件夹 * 应该 * 类似于D:\a\<reponame>\<reponame>
。因此,如果存储库名为
ee.entEvent.eventMsg.vendorNetcool
,则D:\a\ee.entEvent.eventMsg.vendorNetcool\ee.entEvent.eventMsg.vendorNetcool
将是默认的working-directory
,并且存在于存储库的运行器上我想,如果您的存储库被这样命名,您就不会那么倾向于说它不应该存在。但如果没有任何其他片段,这就是为什么它报告的位置运行。
你必须有一个
pom.xml
* 某处 *,虽然;actions/setup-java@v2
上的cache: maven
选项将导致该步骤失败,并显示不同的消息,如果pom.xml
不存在于它运行的任何嵌套文件夹中的某个地方,但这就是它所需要的,它可以找到**/pom.xml
,不一定在根文件夹中。在
pom.xml
所在的文件夹中运行mvn
。尽管java安装程序对任何
**/pom.xml
文件都很满意,但mvn ...
调用需要从pom.xml
所在的位置运行。您可以通过将working-directory:
设置为,e.例如,the/path/to/the/pom
。