- 错误1:
maven打包报错
- 错误还原:使用maven打包项目时报错如下
| [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources) on project helloworld: Input length = 1 -> [Help 1] |
| [ERROR] |
| [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. |
| [ERROR] Re-run Maven using the -X switch to enable full debug logging. |
| [ERROR] |
| [ERROR] For more information about the errors and possible solutions, please read the following articles: |
| [ERROR] [Help 1] http: |
| |
| <plugin> |
| <groupId>org.springframework.boot</groupId> |
| <artifactId>spring-boot-maven-plugin</artifactId> |
| </plugin> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-resources-plugin</artifactId> |
| <version>3.1.0</version> |
| </plugin> |
| # 参考:https://blog.csdn.net/weixin_45406850/article/details/117856833 |
| # 解决方案:settings.xml中标签是否一一对应 |
| <localRepository>E:\apache-maven-3.6.3\repo</localRepository> |
| <mirrors> |
| <mirror> |
| <id>alimaven</id> |
| <mirrorOf>central</mirrorOf> |
| <name>aliyun maven</name> |
| <url>http://maven.aliyun.com/nexus/content/groups/public/</url> |
| </mirror> |
| </mirrors> |
| <profiles> |
| <profile> |
| <id>alibaba</id> |
| <activation> |
| <activeByDefault>true</activeByDefault> |
| <jdk>11</jdk> |
| </activation> |
| <properties> |
| <maven.compiler.source>11</maven.compiler.source> |
| <maven.compiler.target>11</maven.compiler.target> |
| <maven.compiler.compilerVersion>11</maven.compiler.compilerVersion> |
| </properties> |
| </profile> |
| </profiles> |
- 错误3:
maven拉取依赖失败,本地仓库中只能下载 .lastUpdate后缀的文件
| 错误原因:由于我本地安装了jdk8和jdk14,所以当切换jdk的时候;maven的setting.xml中也需重新配置jdk的版本 |
| 解决方案:写一个脚本删除所有 .lastUpdate后缀的文件,重新配置setting.xml后重新拉去依赖 |
| 脚本:clearLastUpdated.bat |
| |
| @echo off |
| |
| |
| set REPOSITORY_PATH=C:\Users\LENOVO\.m2\repository |
| |
| for /f "delims=" %%i in ('dir /b /s "%REPOSITORY_PATH%\*lastUpdated*"') do ( |
| echo %%i |
| del /s /q "%%i" |
| ) |
| |
| pause |
| |
| # 执行完脚本后,重写配置setting.xml,重新拉取依赖 |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
2021-07-22 ubuntu入门