Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URISyntaxException errors for invalid URLs #144

Open
raboof opened this issue Nov 11, 2024 · 3 comments
Open

URISyntaxException errors for invalid URLs #144

raboof opened this issue Nov 11, 2024 · 3 comments

Comments

@raboof
Copy link

raboof commented Nov 11, 2024

Since the update from 1.6.1 to 1.7.0, several Pekko builds fail with:

[error] 	at java.base/java.net.URI$Parser.fail(URI.java:2913)
[error] 	at java.base/java.net.URI$Parser.checkChars(URI.java:3084)
[error] 	at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3166)
[error] 	at java.base/java.net.URI$Parser.parse(URI.java:3114)
[error] 	at java.base/java.net.URI.<init>(URI.java:600)
[error] 	at sbtlicensereport.license.LicenseReport$.$anonfun$pickLicenseForDep$2(LicenseReport.scala:183)
[error] 	at scala.Option.map(Option.scala:230)
[error] 	at sbtlicensereport.license.LicenseReport$.pickLicenseForDep(LicenseReport.scala:183)
[error] 	at sbtlicensereport.license.LicenseReport$.$anonfun$getLicenses$1(LicenseReport.scala:220)
[error] 	at scala.collection.TraversableLike.$anonfun$flatMap$1(TraversableLike.scala:293)
[error] 	at scala.collection.Iterator.foreach(Iterator.scala:943)
[error] 	at scala.collection.Iterator.foreach$(Iterator.scala:943)
[error] 	at scala.collection.AbstractIterator.foreach(Iterator.scala:1431)
[error] 	at scala.collection.IterableLike.foreach(IterableLike.scala:74)
[error] 	at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
[error] 	at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
[error] 	at scala.collection.TraversableLike.flatMap(TraversableLike.scala:293)
[error] 	at scala.collection.TraversableLike.flatMap$(TraversableLike.scala:290)
[error] 	at scala.collection.AbstractTraversable.flatMap(Traversable.scala:108)
[error] 	at sbtlicensereport.license.LicenseReport$.getLicenses(LicenseReport.scala:219)
[error] 	at sbtlicensereport.license.LicenseReport$.makeReport(LicenseReport.scala:233)
[error] 	at sbtlicensereport.SbtLicenseReport$.$anonfun$projectSettings$2(SbtLicenseReport.scala:97)
[error] 	at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error] 	at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:63)
[error] 	at sbt.std.Transform$$anon$4.work(Transform.scala:69)
[error] 	at sbt.Execute.$anonfun$submit$2(Execute.scala:283)
[error] 	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:24)
[error] 	at sbt.Execute.work(Execute.scala:292)
[error] 	at sbt.Execute.$anonfun$submit$1(Execute.scala:283)
[error] 	at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
[error] 	at sbt.CompletionService$$anon$2.call(CompletionService.scala:65)
[error] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] 	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
[error] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[error] 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[error] 	at java.base/java.lang.Thread.run(Thread.java:829)
[error] java.net.URISyntaxException: Illegal character in path at index 27: [https://github.com/rnorth/${project.artifactId}](https://github.com/rnorth/$%7Bproject.artifactId%7D)
[error] 	at java.base/java.net.URI$Parser.fail(URI.java:2913)
[error] 	at java.base/java.net.URI$Parser.checkChars(URI.java:3084)
error] 	at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3166)
[error] 	at java.base/java.net.URI$Parser.parse(URI.java:3114)
[error] 	at java.base/java.net.URI.<init>(URI.java:600)
[error] 	at sbtlicensereport.license.LicenseReport$.$anonfun$pickLicenseForDep$2(LicenseReport.scala:183)
[error] 	at scala.Option.map(Option.scala:230)
[error] 	at sbtlicensereport.license.LicenseReport$.pickLicenseForDep(LicenseReport.scala:183)
[error] 	at sbtlicensereport.license.LicenseReport$.$anonfun$getLicenses$1(LicenseReport.scala:220)
[error] 	at scala.collection.TraversableLike.$anonfun$flatMap$1(TraversableLike.scala:293)
[error] 	at scala.collection.Iterator.foreach(Iterator.scala:943)
[error] 	at scala.collection.Iterator.foreach$(Iterator.scala:943)
[error] 	at scala.collection.AbstractIterator.foreach(Iterator.scala:1431)
[error] 	at scala.collection.IterableLike.foreach(IterableLike.scala:74)
[error] 	at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
[error] 	at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
[error] 	at scala.collection.TraversableLike.flatMap(TraversableLike.scala:293)
[error] 	at scala.collection.TraversableLike.flatMap$(TraversableLike.scala:290)
[error] 	at scala.collection.AbstractTraversable.flatMap(Traversable.scala:108)
[error] 	at sbtlicensereport.license.LicenseReport$.getLicenses(LicenseReport.scala:219)
error] 	at sbtlicensereport.license.LicenseReport$.makeReport(LicenseReport.scala:233)
[error] 	at sbtlicensereport.SbtLicenseReport$.$anonfun$projectSettings$2(SbtLicenseReport.scala:97)
[error] 	at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error] 	at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:63)
[error] 	at sbt.std.Transform$$anon$4.work(Transform.scala:69)
[error] 	at sbt.Execute.$anonfun$submit$2(Execute.scala:283)
[error] 	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:24)
[error] 	at sbt.Execute.work(Execute.scala:292)
[error] 	at sbt.Execute.$anonfun$submit$1(Execute.scala:283)
[error] 	at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
[error] 	at sbt.CompletionService$$anon$2.call(CompletionService.scala:65)
[error] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] 	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
[error] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[error] 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[error] 	at java.base/java.lang.Thread.run(Thread.java:829)

This sounds somewhat similar to #92, except #92 already appeared in 1.6.1.

Let's first see if this issue still appears after #143

raboof added a commit to raboof/sbt-license-report that referenced this issue Nov 11, 2024
Since sbt#134, encountering an 'invalid' URI such as `https://github.com/rnorth/${project.artifactId}`
from https://github.com/rnorth/duct-tape would throw an error and fail
the entire job. As the user of the plugin likely doesn't have direct
influence over the `pom.xml` of the dependencies, it would be better to
emit a warning. With this change, it becomes:

```
sbt-license-report: dependency [org.rnorth.duct-tape:duct-tape:1.0.8] has malformed homepage url [https://github.com/rnorth/${project.artifactId}]
```

This improves the situation described in sbt#144.

I'm not sure it is a full fix, because I'm not sure
`https://github.com/rnorth/${project.artifactId}` is actually invalid
here: I haven't checked whether maven placeholders are allowed here, and
if so, whose responsibility it is to make sure they get resolved.
@raboof
Copy link
Author

raboof commented Nov 11, 2024

Let's first see if this issue still appears after #143

(it does, #145 reduces it to a warning)

@haveo
Copy link

haveo commented Nov 15, 2024

I assume coursier just doesn't do variable resolution on "info" fields when technically it should.

@raboof
Copy link
Author

raboof commented Nov 18, 2024

Possibly, I don't know how responsibilities are distributed for this. See also #92.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants