java.net.URISyntaxException:索引 7 处的权限中存在非法字符

问题描述 投票:0回答:1

在 intelliJ 中使用 Maven 构建时出现以下错误。一直想通过多种方式来解决。尝试删除.m2存储库,更改intelliJ中的配置,包括/.m2/settings.xml中settings.xml中的配置。如果有人有解决方案,请告诉我。

at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:65)
Caused by: java.lang.IllegalArgumentException: Illegal character in authority at index 7: file://C:\Users\xxx\.m2\repository/com/oracle/database/jdbc/ojdbc8/23.5.0.24.07/ojdbc8-23.5.0.24.07.pom
        at java.base/java.net.URI.create(URI.java:906)
        at org.openrewrite.maven.internal.MavenPomDownloader.download(MavenPomDownloader.java:487)
        at org.openrewrite.maven.tree.ResolvedPom.resolveDependencies(ResolvedPom.java:579)
        at org.openrewrite.maven.tree.ResolvedPom.resolveDependencies(ResolvedPom.java:502)
        at org.openrewrite.maven.tree.MavenResolutionResult.resolveDependencies(MavenResolutionResult.java:179)
        at org.openrewrite.maven.MavenParser.parseInputs(MavenParser.java:124)
        at org.springframework.sbm.build.impl.RewriteMavenParser.parseInputs(RewriteMavenParser.java:92)
        at org.springframework.sbm.project.parser.MavenProjectParser.parse(MavenProjectParser.java:94)
        at org.springframework.sbm.project.parser.ProjectContextInitializer.initProjectContext(ProjectContextInitializer.java:52)
        at org.springframework.sbm.engine.commands.ScanCommand.execute(ScanCommand.java:70)
        at org.springframework.sbm.SpringBootMigratorRunner.run(SpringBootMigratorRunner.java:48)
        at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:762)
        ... 13 common frames omitted
Caused by: java.net.URISyntaxException: Illegal character in authority at index 7: file://C:\Users\xxx\.m2\repository/com/oracle/database/jdbc/ojdbc8/23.5.0.24.07/ojdbc8-23.5.0.24.07.pom
java spring-boot maven migration illegalargumentexception
1个回答
0
投票

如果没有 pom.xml 文件,就很难提供具体指导,但问题似乎可能与文件路径的声明方式有关 - 可能在配置文件、属性文件或 pom.xml 本身中。要查找相关位置,您可以使用

Ctrl + Shift + F.

搜索文件路径

当前文件路径:

file://C:\Users\xxx\.m2\repository/...

应更新为:

file:///C:/Users/xxx/.m2/repository/...

简单来说:将反斜杠“\”替换为正斜杠“/”。如果修复此问题后遇到其他与路径相关的错误,请验证您使用的路径是否正确。希望这能解决问题。

© www.soinside.com 2019 - 2024. All rights reserved.