【问题标题】:Github Actions: The goal you specified requires a project to execute but there is no POM in this directoryGithub Actions:你指定的目标需要一个项目来执行但是这个目录下没有POM
【发布时间】:2022-07-19 04:47:46
【问题描述】:

我正在尝试使用 Java 11 在 Azure App Service 中托管我的 Spring Boot Web 应用程序,当我将其部署到 github 操作时,为了托管它,它给了我以下信息:

Run mvn clean install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.063 s
[INFO] Finished at: 2022-03-28T13:26:23Z
[INFO] ------------------------------------------------------------------------
Error:  The goal you specified requires a project to execute but there is no POM in this directory (/home/runner/work/deskmate/deskmate). 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.

这里是:(/home/runner/work/deskmate/deskmate) 那不是我的任何目录。我的 pom.xml 与我的项目在同一个目录中,在根级别。

pom.xml 本身:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.6.5</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>deskmate</groupId>
    <artifactId>deskmate</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>deskmate</name>
    <description>Desk booking app for Consid</description>
    <properties>
        <java.version>11</java.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                        </exclude>
                    </excludes>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

问题: 如何将 Github Actions 或 Azure App Service 指向正确的 pom.xml 路径? 我在哪里做(PowerShell、IntelliJ 终端?在 Github Actions 的某个地方?)

【问题讨论】:

    标签: java spring-boot github azure-web-app-service


    【解决方案1】:

    我找到了一个简单的解决方案!只需使用 GitHub Actions 中的 Checkout 步骤即可。

    将此添加到您的步骤中:

    - name: Standard Checkout
      uses: actions/checkout@v2
    

    【讨论】:

      猜你喜欢
      • 2013-04-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-02
      • 1970-01-01
      • 2012-12-02
      • 2013-10-18
      • 2021-08-05
      相关资源
      最近更新 更多