无法启动maven服务-找不到类#



好的。。。作为一名开发人员,我有生以来第一次不知道如何修复这个错误。

我对Maven命令和Intellij有问题。

(重要(

本地项目上的所有maven命令都不起作用,并返回错误:

cannot find or load main class #, java.lang.ClassNotFoundException: #

"#"在错误消息上。

我的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.3.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>garantia.safra</groupId>
<artifactId>gateway</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>gateway</name>
<description>description</description>
<properties>
<java.version>11</java.version>
<start-class>garantia.safra.gateway.GatewayApplication</start-class>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwd</artifactId>
<version>0.9.1</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>

</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

我试图删除.m2/存储库文件夹,但没有成功。

我尝试过"设置>构建、执行、部署>生成工具>maven>Importing",并将导入设置为"projectJDK",但不起作用。(我使用的是JDK 11,它以前也工作过(

我试图通过Intellij(远程和本地(更新maven存储库,现在我在远程存储库中出现错误(找不到任何导入的包类(

我所做的唯一一件事解决了这个问题,就是将项目重新创建为一个新项目,并添加所有的类和pom.xml,但当我添加配置文件时,它又坏了。

我使用的是来自生产(.maven/jvm.config(的代理

# -Dhttp.proxyHost=<proxy_host>
# -Dhttp.proxyPort=<proxy_port>
# -Dhttps.proxyHost=<proxy_host>
# -Dhttps.proxyPort=<proxy_port>

但是所有的台词都被评论了,对吗?

和application.properties:

server.address=0.0.0.0

所以。。。这是一个非常棘手的问题,我缺乏想法。也许我会尝试重新创建这个项目,并重新导入每个文件,看看哪个是坏的,但如果有人以前有这个问题并修复了它……怎么做?

清空或删除.maven/jvm.config文件,直接加载并添加到命令行,不支持注释语法。

最新更新