github action throwing error at building mavenized tibco bw6 application

mwg9r5ms  于 2023-04-29  发布在  Maven
关注(0)|答案(1)|浏览(159)

我正在尝试运行github action并构建tibco bw 6应用程序并部署TEA,这是我的github action yaml

这是第一个管道

  1. name: Tibco Workflow
  2. on:
  3. pull_request:
  4. branches: [ development ]
  5. jobs:
  6. Run-PSScriptAnalyzer-on-Windows:
  7. name: Run PSScriptAnalyzer on Windows
  8. runs-on: windows-latest
  9. steps:
  10. - uses: actions/checkout@v3
  11. - name: Install PSScriptAnalyzer module
  12. shell: pwsh
  13. run: |
  14. Set-PSRepository PSGallery -InstallationPolicy Trusted
  15. Install-Module PSScriptAnalyzer -ErrorAction Stop
  16. - name: Get list of rules
  17. shell: pwsh
  18. run: |
  19. Get-ScriptAnalyzerRule
  20. build:
  21. needs: Run-PSScriptAnalyzer-on-Windows
  22. runs-on: windows-latest
  23. steps:
  24. - name: Checkout repository
  25. uses: actions/checkout@v2
  26. - name: Set up JDK
  27. uses: actions/setup-java@v2
  28. with:
  29. java-version: 11
  30. distribution: 'adopt'
  31. cache: maven
  32. - name: Build BW6 Application
  33. run: mvn clean install

但它抛出下面的错误:

  1. 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]
  2. Error:
  3. Error: To see the full stack trace of the errors, re-run Maven with the -e switch.
  4. Error: Re-run Maven using the -X switch to enable full debug logging.
  5. Error:
  6. Error: For more information about the errors and possible solutions, please read the following articles:
  7. Error: [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException
  8. 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中)

gpfsuwkq

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

展开查看全部

相关问题