mvn clean包错误,声称我的目录中没有pom,当我有pom时

pieyvz9o  于 2021-06-30  发布在  Java
关注(0)|答案(1)|浏览(337)

你好,我正在尝试使用mvn clean包,按照我的教授的指示,创建一个jar,但是在第一步,事情对我来说并不顺利。
我在终端中得到的错误如下。
我有点困惑,为什么它说没有pom,因为javafx应用程序正在运行,其他所有涉及pom.xml的东西都在运行,所以很明显这里有一个正在工作的pom.xml存在,而不仅仅是一个pom存在,什么都没有。

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.090 s
[INFO] Finished at: 2020-12-22T04:33:14-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (C:\Users\Huzaifa\Documents\CST 3613 Application Deve
lopment with Databases\Connect4). 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

C:\Users\Huzaifa\Documents\CST 3613 Application Development with Databases\Connect4>

我的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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.example</groupId>
    <artifactId>Connect4</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <maven.compiler.source>14</maven.compiler.source>
        <maven.compiler.target>14</maven.compiler.target>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-controls</artifactId>
            <version>11</version>
        </dependency>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-fxml</artifactId>
            <version>11</version>
        </dependency>
    </dependencies>

    <build>
        <!--<finalName>boulet-jean-abc123</finalName>-->
        <finalName>Anas-Huzaifa-connect4</finalName>
        <resources>
            <resource>
                <directory>src/main/java</directory>
                <filtering>true</filtering>
                <includes>
                    <include>**/*.java</include>
                    <include>**/*.fxml</include>
                    <include>**/*.css</include>
                    <include>**/*.jpg</include>
                    <include>**/*.csv</include>
                </includes>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>**/*.csv</include>
                </includes>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <addResources>false</addResources>
                    <folders>
                        <folder>src/main/resources</folder>
                    </folders>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version>
                <configuration>
                    <source>11</source>
                    <target>11</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addClasspath>true</addClasspath>
                            <mainClass>edu.citytech.edu.citytech.connect4.Connect4Main</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

我试过重新加载,重新制作这个项目,我也重新安装了maven,清除了缓存,然后做了一些事情,但我不明白为什么这样做行不通。
谢谢您!

rlcwz9us

rlcwz9us1#

您检查了pom.xml的路径和执行的路径了吗 mvn clean ? 还要注意文件路径中的空格。

相关问题