gpt4 book ai didi

java - Maven-Spring-boot-Eclipse 构建成功,但未安装软件包(Lombok)

转载 作者:行者123 更新时间:2023-12-02 08:39:23 25 4
gpt4 key购买 nike

场景:
我在新计算机上安装了 Eclipse,并使用了旧版本的工作区>

我收到一条关于不存在项目的恼人消息 - 因此通过我看到的一个解决方案,我已从工作区中删除了 .metadata 文件夹。 >>

从那时起,我尝试构建我的项目(到目前为止一直运行良好),ma​​ven 使用“Build Success”运行该过程,但尚未安装任何包,并按顺序进行我遇到很多编译错误。

我的 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>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.3.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.lingar</groupId>
<artifactId>SocialEventsTrying1</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>SocialEventsTrying1</name>
<description>Demo project for Spring Boot</description>

<properties>
<java.version>1.8</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-data-rest</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<!-- Use MySQL Connector-J -->

<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.47</version><!-- this version solve the time issue -->
</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>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<!-- tag::frontend-maven-plugin[] -->

<!-- end::frontend-maven-plugin[] -->
</plugins>
</build>


</project>

Maven 控制台日志:

[INFO] Scanning for projects...
[INFO]
[INFO] -------------------< com.lingar:SocialEventsTrying1 >-------------------
[INFO] Building SocialEventsTrying1 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ SocialEventsTrying1 ---
[INFO] Deleting C:\izhar\files\eclipse-workspaces\Spring-Hibernate\HibernateStudying\target
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ SocialEventsTrying1 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 59 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ SocialEventsTrying1 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 31 source files to C:\izhar\files\eclipse-workspaces\Spring-Hibernate\HibernateStudying\target\classes
[INFO] /C:/izhar/files/eclipse-workspaces/Spring-Hibernate/HibernateStudying/src/main/java/com/lingar/SocialEvents/tutorial/services/TutorialService.java: C:\izhar\files\eclipse-workspaces\Spring-Hibernate\HibernateStudying\src\main\java\com\lingar\SocialEvents\tutorial\services\TutorialService.java uses or overrides a deprecated API.
[INFO] /C:/izhar/files/eclipse-workspaces/Spring-Hibernate/HibernateStudying/src/main/java/com/lingar/SocialEvents/tutorial/services/TutorialService.java: Recompile with -Xlint:deprecation for details.
[INFO] /C:/izhar/files/eclipse-workspaces/Spring-Hibernate/HibernateStudying/src/main/java/com/lingar/SocialEvents/tutorial/services/TutorialService.java: C:\izhar\files\eclipse-workspaces\Spring-Hibernate\HibernateStudying\src\main\java\com\lingar\SocialEvents\tutorial\services\TutorialService.java uses unchecked or unsafe operations.
[INFO] /C:/izhar/files/eclipse-workspaces/Spring-Hibernate/HibernateStudying/src/main/java/com/lingar/SocialEvents/tutorial/services/TutorialService.java: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ SocialEventsTrying1 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\izhar\files\eclipse-workspaces\Spring-Hibernate\HibernateStudying\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ SocialEventsTrying1 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to C:\izhar\files\eclipse-workspaces\Spring-Hibernate\HibernateStudying\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ SocialEventsTrying1 ---
[INFO]
[INFO] --- maven-jar-plugin:3.1.1:jar (default-jar) @ SocialEventsTrying1 ---
[INFO] Building jar: C:\izhar\files\eclipse-workspaces\Spring-Hibernate\HibernateStudying\target\SocialEventsTrying1-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- spring-boot-maven-plugin:2.1.3.RELEASE:repackage (repackage) @ SocialEventsTrying1 ---
[INFO] Replacing main artifact with repackaged archive
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ SocialEventsTrying1 ---
[INFO] Installing C:\izhar\files\eclipse-workspaces\Spring-Hibernate\HibernateStudying\target\SocialEventsTrying1-0.0.1-SNAPSHOT.jar to C:\Users\Lingar\.m2\repository\com\lingar\SocialEventsTrying1\0.0.1-SNAPSHOT\SocialEventsTrying1-0.0.1-SNAPSHOT.jar
[INFO] Installing C:\izhar\files\eclipse-workspaces\Spring-Hibernate\HibernateStudying\pom.xml to C:\Users\Lingar\.m2\repository\com\lingar\SocialEventsTrying1\0.0.1-SNAPSHOT\SocialEventsTrying1-0.0.1-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 20.691 s
[INFO] Finished at: 2020-04-28T10:21:26+03:00
[INFO] ------------------------------------------------------------------------

Eclipse 版本:

面向企业 Java 开发人员的 Eclipse IDE。

版本:2020-03 (4.15.0)

顺便说一句 -它也发生在其他项目和其他工作空间中,不仅限于此,所以这是普遍问题。 (我还尝试创建新的工作区并将项目导入到那里 - 没有解决)。

最佳答案

转到您的项目文件夹 -> 打开终端/cmd -> 执行 mvn clean

现在进入 eclipse,按 ctrl+f5(maven update)然后执行。

然后再次构建您的项目。并检查错误是否仍然存在。

这将解决您无法下载所需 jar 的问题。

关于java - Maven-Spring-boot-Eclipse 构建成功,但未安装软件包(Lombok),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61474886/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com