Table of contents
Problem Description
Today, when I was working on the dependencies of a project, the dependencies of easyexcel could not be downloaded, although my Maven configuration was fine.
-
rely:
-
Maven configuration:
I have switched several versions, but I can't download from the mirror, even if I turn on the accelerator, I can't download it from the default mirror.
solution
systemPath
This solution is relatively simple. If this solution reports an error, use the following solution
Since it is not possible to download the jar package from the Internet, I will import the jar package locally, and the steps are as follows:
-
https://mvnrepository.com/ website to download the required jar package
-
Create a new lib folder in the root directory of the project (of course, you can choose any name), and put the downloaded jar package into it
-
Open the pom.xml file and modify the <dependency> configuration as follows:
<dependency> <groupId>com.alibaba</groupId> <artifactId>3.0.5</artifactId> <version>${easyexcel.version}</version> <scope>system</scope> <systemPath>${project.basedir}/lib/easyexcel-3.0.5.jar</systemPath> </dependency>
-
Refresh Maven and successfully import
This solution may report: dependencyManagement.dependencies.dependency.systemPath' for com.alibaba:3.0.5:jar refers to a non-existing file,
then use mvn install
mvn install
-
https://mvnrepository.com/ website to download the required jar package
-
Install the local jar package to the Maven repository:
mvn install:install-file -Dfile=D:\Applications\MyRepository\easyexcel-3.0.5.jar
If an error is reported: Under normal circumstances, as long as the dependencies you downloaded are ok, you can directly use the above command. Just use the
following command:mvn install:install-file -Dfile=D:\Applications\MyRepository\easyexcel-3.0.5.jar -DgroupId=com.alibaba -DartifactId=easyexcel -Dversion=3.0.5 -Dpackaging=jar
Command description:
- -Dfile= jar local absolute path
- -DgroupId= groupId of the jar package
- -DartifactId= the artifactId of the jar package
- -Dversion= The version of the jar package
- -Dpackaging= Packaging method
-
Modify the <dependency> configuration:
<dependency> <groupId>com.alibaba</groupId> <artifactId>easyexcel</artifactId> <version>3.0.5</version> </dependency>
-
Refresh Maven