Eclipse中通过Maven添加依赖自动提示配置

在Eclipse中集成Maven的一个好处就是添加jar包的时候,不需要自己打开浏览器,然后再网上下载;直接在eclipse中就可以添加你想要的jar文件,非常方便。

但是集成了maven之后的eclipse不会自动搜索依赖,会出现如下信息:


解决的办法如下:

1、首先选在window下的preferences,然后选择Maven,出现如下面板:


勾选途中红框中的选项。

2、然后选择Window中的show view,选择other。点开Maven,选择“Maven Respositories”。出现如下面板:


点开"Global Respositories",在central上点击右键选择“rebuild index”更新索引。此过程需要网络。如果网速慢,可能比较耗时。

3、最后就可以使用maven的自动搜索结果了。为开发节省了不少时间。

  • 4
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
Eclipse 使用 Maven 启动 Spring Boot 有两种方式:通过 Maven 插件启动或者通过 Eclipse 插件启动。 1. 通过 Maven 插件启动: 步骤如下: 1. 在项目的 pom.xml 文件添加 Spring Boot Maven 插件: ```xml <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> ``` 2. 在 Maven 的 Profiles 添加 Spring Boot 启动配置: ```xml <profiles> <profile> <id>spring-boot</id> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <executions> <execution> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </profile> </profiles> ``` 3. 保存 pom.xml 文件并使用 Maven 命令启动 Spring Boot 应用程序: ```bash mvn spring-boot:run ``` 2. 通过 Eclipse 插件启动: 步骤如下: 1. 安装 Spring Tool Suite 插件。 2. 在项目的 pom.xml 文件添加 Spring Boot Starter Parent 依赖。 3. 右键点击 pom.xml 文件,选择 Run As -> Maven build。 4. 在 Goals 输入 `spring-boot:run`,然后点击 Run 按钮。 5. 等待应用程序启动完成后,使用浏览器访问 http://localhost:8080 即可访问应用程序。 注意:在使用 Eclipse 插件启动 Spring Boot 应用程序时,Eclipse自动检测项目是否引入了 Spring Boot 相关依赖,如果没有则会提示你手动添加依赖。同时,Eclipse 也会自动配置应用程序的端口号和上下文路径等参数,无需手动配置

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

杨景文Blog

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值