使用IntelliJ IDEA Ultimate 2018.1创建Spring项目,无法下载指定jar包求助
Hey there, I’ve run into similar Maven download headaches before, so let’s walk through some practical fixes to get your Spring project up and running smoothly:
Switch to a faster Maven mirror (like Alibaba’s)
The default Maven Central repo can be slow or blocked in some regions. Here’s how to set up an Alibaba mirror:- Open IntelliJ’s settings:
File > Settings(orIntelliJ IDEA > Preferenceson Mac) - Navigate to
Build, Execution, Deployment > Build Tools > Maven > Repositories - If you don’t have a custom
settings.xml, create one in your local Maven repo folder (usually~/.m2/on Mac/Linux,C:\Users\[YourName]\.m2\on Windows) - Add this mirror configuration to
settings.xml:<mirrors> <mirror> <id>aliyunmaven</id> <mirrorOf>central</mirrorOf> <url>https://maven.aliyun.com/repository/public</url> </mirror> </mirrors> - Back in IntelliJ, go to
Build, Execution, Deployment > Build Tools > Mavenand set theUser settings fileto point to your newly editedsettings.xml - Restart IntelliJ and try creating the project again
- Open IntelliJ’s settings:
Manually download and place the jar
If the mirror still doesn’t work, grab the jar directly:- Search for
spring-aop-4.3.18.RELEASE.jarin the Maven Central repository - Download the jar file
- Navigate to your local Maven repo path:
~/.m2/repository/org/springframework/spring-aop/4.3.18.RELEASE/(create the folder if it doesn’t exist) - Place the downloaded jar into this folder, then retry the project creation
- Search for
Clear corrupted Maven cache files
Sometimes partial downloads leave corrupted.lastUpdatedfiles that block re-downloads:- Find the
spring-aop/4.3.18.RELEASEfolder in your local Maven repo - Delete all files ending with
.lastUpdated(and any incomplete jar files) - Go back to IntelliJ, open the Maven tool window, and click the
Reload All Maven Projectsbutton (the circular arrow icon)
- Find the
Try a different Spring version
If 4.3.18 is giving persistent issues, pick a nearby stable version (like 4.3.19.RELEASE or 4.3.17.RELEASE) when selecting dependencies in the project setup wizard—this might bypass the problematic version’s download issuesCheck Maven permissions and configuration
Make sure:- IntelliJ has write access to your local Maven repo folder (run IntelliJ as administrator on Windows, or check folder permissions on Mac/Linux)
- You’re using a valid Maven installation (either IntelliJ’s built-in one or a local version you’ve installed)
Hope one of these gets you past the download error! Let me know if you need more details on any step.
内容的提问来源于stack exchange,提问作者Victory

