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

Scanner fails to fully resolve properties before downloading

Open nt-gt opened this issue 2 years ago • 2 comments

Describe the bug A clear and concise description of what the bug is.

When scanning in my project, I get the following error:

Illegal character in path at index 88: file:/C:/Users/<user>/.m2/repository/org/dcsa/shared-kernel/dcsa-shared-kernel-parent/0.1.0${dcsa.shared-kernel.tag}-SNAPSHOT/dcsa-shared-kernel-parent-0.1.0${dcsa.shared-kernel.tag}-SNAPSHOT.pom Details of the error have been omitted. You can use the stacktrace command to print the full stacktrace.

As far as I can gather, this happens because the migrator does not fully resolve properties before downloading. I was able to work around this problem by manually expanding the properties temporarily:

$ git show
commit d35137be9e8da564685a593b5afc254dc4754604 (HEAD -> next-phase)
Author: Niels Thykier <[email protected]>
Date:   Tue Jan 3 09:50:51 2023 +0100

    test migrator
   
diff --git a/pom.xml b/pom.xml
index 38da62f..8b76210 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,8 +29,7 @@
                <dcsa.shared-kernel.version>0.1.0</dcsa.shared-kernel.version>
                <dcsa.shared-kernel.tag/>
                <dcsa.shared-kernel.artifacttype>-SNAPSHOT</dcsa.shared-kernel.artifacttype>
-               <shared-kernel.version>${dcsa.shared-kernel.version}${dcsa.shared-kernel.tag}${dcsa.shared-kernel.artifacttype}
-               </shared-kernel.version>
+               <shared-kernel.version>${dcsa.shared-kernel.version}</shared-kernel.version>
                <!-- End: Define Shared kernel version -->
                <testcontainers.version>1.17.3</testcontainers.version>
                <testcontainers.keycloak.version>2.2.2</testcontainers.keycloak.version>

I then ran into the scanner failing to resolve my dependencies, which maven has no issues with (but does require auth from my .m2/settings.xml to access a github repository). Not sure what happened there, but I parked the migrator at that point.

To Reproduce Steps to reproduce the behavior:

Have a project where a dependency uses a property that itself depends on another property (see my git diff above for a more concrete example).

Expected behavior A clear and concise description of what you expected to happen.

Given maven resolves this property fully before downloading, I expected the migrator to do so as well.

Screenshots If applicable, add screenshots to help explain your problem.

Stacktrace If applicable, add the (sanitized) stacktrace here.

The stacktrace is not applicable, the stacktrace is triggered by the partial resolved property creating an invalid URL. But the stacktrace is not the root cause, so I have omitted it.

Desktop (please complete the following information):

  • OS: Windows
  • Version: 10
  • Spring-boot-migrator downloaded from: https://github.com/spring-projects-experimental/spring-boot-migrator/releases/tag/0.13.0

Additional context Add any other context about the problem here.

nt-gt avatar Jan 03 '23 09:01 nt-gt