使用坐标导入jar包
1.在pom.xml中编写<dependencise>标签
2.在<dependencies>标签中,使用<dependency>引入坐标
3.定义坐标的groupId,artifactId,version
4.点击刷新按钮,是坐标生效
<!--导入mysql 驱动jar包--> <dependencies> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>8.0.25</version> </dependency> </dependencies>
导入各类jar包。(alt+insert)
<!--导入mysql 驱动jar包--> <dependencies> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>8.0.25</version> </dependency> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>1.1.12</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.13</version> <scope>test</scope> </dependency> </dependencies>
如果是第一次使用jar包,需要到官网上下载Maven Repository: mysql » mysql-connector-java (mvnrepository.com)
使用坐标导入jar包-自动导入
1.选择IDEA中File-->Settings
2.在弹出的面板中国找到Build Tools
3.选择Any changes,点击ok即可生效
使用坐标导入jar包-快捷方式
1.在pom.xml中,按alt + insert,选择Dependecy
2.在弹出的面板中搜索对应坐标,然后双击选中对应坐标
标签:依赖,java,管理,jar,connector,导入,坐标,mysql From: https://www.cnblogs.com/yzx-sir/p/17178754.html