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

Ignore fatal errors in POMs of transitive dependencies #106

Merged
merged 3 commits into from
Jun 6, 2016
Merged

Ignore fatal errors in POMs of transitive dependencies #106

merged 3 commits into from
Jun 6, 2016

Conversation

sschuberth
Copy link
Contributor

No description provided.

@hierynomus
Copy link
Owner

Thanks Sebastian,

Would it be an idea to make this configurable behaviour? I could imagine you want to be informed and "actively choose" to ignore those broken dependencies.

It might be an even better idea to explicitly be able to list those dependencies in the build.gradle file and link them either to the right license, or to the 'noLicense'.

@sschuberth
Copy link
Contributor Author

Hmm, I see several issues here. If the POM cannot be parsed as it's malformed, you actually don't know the license. Which is different from 'noLicense' because you cannot even tell that no license has been specified.

Prior to my commits, the behavior was that the task would throw an exception not write a results file. I don't think that's a feasible behavior, even if some one deliberately has not enabled to ignore malformed POMs. Of course I could introduce a property like ignore.malformed.poms which can be set to true or false, but how should the plugin behave in the case of false?

@hierynomus
Copy link
Owner

I think that an error from the build is exactly what you want. Suppose it is an internal artifact (not a public one) that has a malformed POM. Then instead of ignoring this you want to fix it.

Also even if the POM is malformed, you might actually know yourself which license it is, so then an explicit mapping of the artifact would be preferred instead of just assigning the empty license to it.

@sschuberth
Copy link
Contributor Author

Note that my fix only applies to malformed transitive dependencies. And these are not so likely to be internals ones, probably. For first-order dependencies already Gradle itself would choke on malformed POMs during dependency resolution. But anyway, I see your point, also I tend to disagree :-)

I'll see what I can do.

@sschuberth
Copy link
Contributor Author

@hierynomus I'll split the unrelated commits to other PRs so you can merge them right away.

@sschuberth
Copy link
Contributor Author

@hierynomus I've updated the PR, please have a look (and merge PR #107 first to get the tests working again).

@hierynomus
Copy link
Owner

Thanks!

@hierynomus hierynomus merged commit 01fc363 into hierynomus:master Jun 6, 2016
@sschuberth
Copy link
Contributor Author

@hierynomus Thanks for merging! Can I expect a new release with this included?

@hierynomus
Copy link
Owner

And it is there: 0.13.0 (https://plugins.gradle.org/plugin/com.github.hierynomus.license)

@sschuberth
Copy link
Contributor Author

Great, thanks! Unfortunately, I've discovered an issue due to the upgrade to the Android Gradle plugin. It breaks using your plugin in a project which depends on an older version of the Android Gradle plugin. I already have a fix and a PR is underway.

@sschuberth
Copy link
Contributor Author

@hierynomus See #109.

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