IDEA项⽬的依赖(l⽂件)导⼊问题及解决前⾔
IDEA新建项⽬和l⽂件被修改时,右下⾓都会出现 Maven projects need to be imported(项⽬需要导⼊依赖)
如下,点击 Import Changes导⼊后,有时会⼀直处于加载中或导⼊失败
解决⽅法
第⼀种⽅法:
右击l⽂件,选择Maven中的Reimport重新导⼊项⽬依赖,⼀般这种⽅法都解决不了上⾯的问题,可直接看下⾯的⽅法
第⼆种⽅法:
点击 File 选择 Settings… 直接搜索 Maven,在搜索结果中 Maven home directory:默认为Bundled(Maven 3),点击选择IDEA⾃带的Maven,再点击应⽤–>OK,重新导⼊(第⼀种⽅法)即可
第三种⽅法:
若第⼆种⽅法还不能解决项⽬的依赖导⼊问题,则需要使⽤国内的Maven类库,IDEA的Maven类库默认都是使⽤国外的,⼀些地区由于墙的原因加载会很慢或者加载不了,此时可以导⼊阿⾥云的 Maven 类库(⼀个l⽂件)来使⽤,我就是⽤这个⽅法才解决的
<project xmlns="/POM/4.0.0" xmlns:xsi="/2001/XMLSchema-instance"
xsi:schemaLocation="/POM/4.0.0 /maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId&l.kuyu.salesreport</groupId>
<artifactId>salesreport-server</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>salesreport-server</name>
<url></url>
<!-- 刚开始的时候,我很不习惯,也不太理解为什么要⽤下⾯的标签,后来才觉得,代码就该这样。。。修改的时候也会特别的⽅便 -->
<properties>
<aspectj.version>1.8.9</aspectj.version>
<java.version>1.8</java.version>
<junit.version>4.12</junit.version>
<logback.version>1.1.7</logback.version>
<logback-ext-spring.version>0.1.4</logback-ext-spring.version>
<mysql.driver.version>5.1.38</mysql.driver.version>
<slf4j.version>1.7.21</slf4j.version>
<spring.version>4.2.5.RELEASE</spring.version>
<jackson.version>2.5.2</jackson.version>
<mybatis.version>3.4.0</mybatis.version>
<mybatis.spring.version>1.3.0</mybatis.spring.version>
<mybatis-plus.version>1.2.16</mybatis-plus.version>
<fastjson.version>1.2.11</fastjson.version>
<shiro.version>1.2.6</shiro.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<l>${basedir}/l</l>
</properties>
<dependencies>
<!-- junit 此处是单元测试的依赖-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junitperf</groupId>
<artifactId>junitperf</artifactId>
<version>1.8</version>
<scope>test</scope>
</dependency>
<!-- spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.version}</version>
</dependency>
eclipse导入整个项目
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-oxm</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
</dependency>
<!-- freemark  根据项⽬需要,简单的web项⽬的话此处是不需要的-->  <dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>[2.3.19,2.4)</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>org.apachemons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.2</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<!-- logback begin -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>${logback.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
</dependency>
<!-- logback end -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${aspectj.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.driver.version}</version>
</dependency>
<dependency>
<groupId&batis</groupId>
<artifactId>mybatis</artifactId>
<version>${mybatis.version}</version>
</dependency>
<dependency>
<groupId&batis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>${mybatis.spring.version}</version>  </dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus</artifactId>
<version>${mybatis-plus.version}</version>
</dependency>
<dependency>
<groupId>com.</groupId>  <artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.</groupId>  <artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.mangofactory</groupId>
<artifactId>swagger-springmvc</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>com.</groupId>  <artifactId>jackson-annotations</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.0.18</version>
</dependency>

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。