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

improve error handling when a url/homepage is invalid #145

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

raboof
Copy link

@raboof raboof commented Nov 11, 2024

Since #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 #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 (see #92 for that aspect).

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.
Copy link
Contributor

@mdedetrich mdedetrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

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

Successfully merging this pull request may close these issues.

2 participants