简体   繁体   中英

Github Actions: The goal you specified requires a project to execute but there is no POM in this directory

I am trying to host my Spring Boot web app in Azure App Service, with Java 11 and when I deploy it to github actions, in order to host it, it gives me the following:

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.

This right here: (/home/runner/work/deskmate/deskmate) That's not any of my directories. I have my pom.xml in the same directory as I have my project, at root level. 在此处输入图像描述

The pom.xml itself:

<?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>

Questions: How do I point Github Actions or Azure App Service to the right pom.xml path? And where do I do it (PowerShell, IntelliJ terminal? Inside Github Actions somewhere?)

I found a simple solution! Just use the Checkout step in your GitHub Actions, that's it.

Add this in your steps:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM