Maven Wrapper 生命周期失败

Maven Wrapper Lifecycle failing

当我尝试使用 Intellij 的终端进行 maven 构建时出现以下错误。

只是不确定要做什么或有什么问题。相同的配置适用于早期的 springboot 项目。

错误信息:

D:\springboot\api\streetapiservice>mvnw clean install
The system cannot find the path specified.
'B' is not recognized as an internal or external command,
operable program or batch file.
The directory name is invalid.
Exception calling "DownloadFile" with "2" argument(s): "An exception occurred during a WebClient request."
At line:1 char:282
+ ... pe]::Tls12; $webclient.DownloadFile('https://repo.maven.apache.org/ma ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : WebException
 
Error: Could not find or load main class org.apache.maven.wrapper.MavenWrapperMain

POM 文件 下面是 pom 文件——我已经删除了一些依赖项。这是使用 spring starter 创建的。

<?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.5.2</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

    <groupId>com.api</groupId>
    <artifactId>streetapiservice</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>streetapiservice</name>
    <description>Api for handling calls street api</description>

    <properties>
        <java.version>1.8</java.version>
        <sonar-maven-plugin.version>3.7.0.1746</sonar-maven-plugin.version>
        <mock-sever-netty-version>3.10.8</mock-sever-netty-version>
        <apache-http-version>4.4.1</apache-http-version>
    </properties>

    <dependencies>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <includeSystemScope>true</includeSystemScope>
                </configuration>
            </plugin>
            
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.19.1</version>
                <dependencies>
                    <dependency>
                        <groupId>org.junit.platform</groupId>
                        <artifactId>junit-platform-surefire-provider</artifactId>
                        <version>1.0.1</version>
                    </dependency>
                </dependencies>
            </plugin>

            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.7.9</version>
                <executions>
                    <execution>
                        <id>default-prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>default-report</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>

  • 当我尝试通过 git bash 运行 相同的代码时,它 运行 很好。
  • 问题似乎与 IDE
  • 有关
  • 重新导入项目解决了问题