spring-boot-migrator icon indicating copy to clipboard operation
spring-boot-migrator copied to clipboard

Scan error - Illegal character in authority at index 7 for maven

Open nagarajgond opened this issue 1 year ago • 4 comments

Describe the bug Illegal character in authority at index 7: file://C:\Users\username.m2\repository thrown when scanning maven project.

SBM Version spring-boot-migrator v0.15.0 Java OpenJDK 17

SBM Application spring-boot-migrator scan

To Reproduce Steps to reproduce the behavior:

  1. scan maven project

Stacktrace scanning 'C:/user/workspace/proj1'

Checked preconditions for 'C:\user\workspace\proj1' [ok] Found pom.xml. [ok] 'sbm.gitSupportEnabled' is 'true', changes will be committed to branch [ftr-proj] after each recipe. [ok] Required Java version (17) was found. [ok] Found required source dir 'src/main/java'.

Maven 0% │████████▌ │ 1/4 (0:00:00 / 0:00:00) Illegal character in authority at index 7: file://C:\Users\user.m2\repository Details of the error have been omitted. You can use the stacktrace command to print the full stacktrace. Maven 100% │██████████████████████████████████│ 8/8 (0:00:01 / 0:00:00) migrator:> stacktrace java.lang.IllegalArgumentException: Illegal character in authority at index 7: file://C:\Users\user.m2\repository at java.base/java.net.URI.create(URI.java:906) at org.openrewrite.maven.internal.MavenPomDownloader.downloadMetadata(MavenPomDownloader.java:211) at org.openrewrite.maven.internal.MavenPomDownloader.datedSnapshotVersion(MavenPomDownloader.java:579) at org.openrewrite.maven.internal.MavenPomDownloader.download(MavenPomDownloader.java:477) 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.shell.ScanShellCommand.scan(ScanShellCommand.java:67) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

Example Source code to replicate the issue (Optional) It would help us immensely if we were to have an example test source code or a snippet where you can see this problem, you could attach a zip file along with this issue.

Although this section is optional, it would speed up our process of providing a fix. P.S. Please remove any sensitive data and do not upload any proprietary source.

Desktop (please complete the following information):

  • OS: Windows
  • Version 11

Additional context Add any other context about the problem here.

nagarajgond avatar Feb 03 '24 17:02 nagarajgond

same error: Maven 0% │██████████████████████████████████│ 1/1 (0:00:00 / 0:00:00) Illegal character in authority at index 7: file://C:\Users\removed_my_username.m2\repository/org/springframework/boot/spring-boot-starter-parent/3.2.2/spring-boot-starter-parent-3.2.2.pom on windows 10 , spring boot migrator version 0.15.0

bvanhaute avatar Feb 29 '24 17:02 bvanhaute

same issue: Caused by: java.net.URISyntaxException: Illegal character in authority at index 7: file://C:\Users\my_username.m2\repository/maven/maven-parent/5.11.20/maven-parent-5.11.20.pom at java.base/java.net.URI$Parser.fail(URI.java:2976) at java.base/java.net.URI$Parser.parseAuthority(URI.java:3310) at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3221) at java.base/java.net.URI$Parser.parse(URI.java:3177) at java.base/java.net.URI.(URI.java:623) at java.base/java.net.URI.create(URI.java:904)

Windows 10 Entreprise JDK 17 Maven 3.8.7

FredyDevJava avatar Mar 05 '24 16:03 FredyDevJava