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

downloadLicenses fails in gradle 3.4.1 #134

Closed
serba opened this issue Apr 4, 2017 · 5 comments

Comments

@serba
Copy link

commented Apr 4, 2017

We recently upgraded our project to gradle 3.4.1 and downloadLicenses started failing with the following exception:

Caused by: groovy.lang.MissingPropertyException: Could not get unknown property 'source' for object of type org.gradle.api.internal.artifacts.dependencies.DefaultSelfResolvingDependency.
	at org.gradle.internal.metaobject.AbstractDynamicObject.getMissingProperty(AbstractDynamicObject.java:88)
	at org.gradle.internal.metaobject.AbstractDynamicObject.getProperty(AbstractDynamicObject.java:62)
	at org.gradle.api.internal.artifacts.dependencies.DefaultSelfResolvingDependency_Decorated.getProperty(Unknown Source)
	at nl.javadude.gradle.plugins.license.LicenseResolver$_provideFileDependencies_closure8.doCall(LicenseResolver.groovy:164)
	at nl.javadude.gradle.plugins.license.LicenseResolver.provideFileDependencies(LicenseResolver.groovy:162)
	at nl.javadude.gradle.plugins.license.LicenseResolver$_provideLicenseMap4Dependencies_closure2.doCall(LicenseResolver.groovy:84)
	at nl.javadude.gradle.plugins.license.LicenseResolver.provideLicenseMap4Dependencies(LicenseResolver.groovy:48)
	at nl.javadude.gradle.plugins.license.LicenseResolver$provideLicenseMap4Dependencies.call(Unknown Source)
	at nl.javadude.gradle.plugins.license.DownloadLicenses$_downloadLicenses_closure1.doCall(DownloadLicenses.groovy:103)
	at nl.javadude.gradle.plugins.license.DownloadLicenses$_downloadLicenses_closure1.doCall(DownloadLicenses.groovy)
	at java_util_concurrent_Callable$call.call(Unknown Source)
	at nl.javadude.gradle.plugins.license.DownloadLicenses.downloadLicenses(DownloadLicenses.groovy:113)

I noticed that DefaultSelfResolvingDependency.java had getSource method in gradle 2.14 and it’s not there in gradle 3.4.1. It looks like that was changed in 3.3 (see gradle/gradle@9e20cfe).

Should license-gradle-plugin call FileCollectionDependency.files or even FileCollectionDependency.resolve instead of FileCollectionDependency.source in LicenseResolver.groovy#L164 ?

@yduman

This comment has been minimized.

Copy link

commented Apr 6, 2017

same issue here

@hierynomus

This comment has been minimized.

Copy link
Owner

commented Apr 6, 2017

Thanks for reporting this. I will have a look at this asap

ejohansson added a commit to ejohansson/license-gradle-plugin that referenced this issue Apr 8, 2017
Bugfix hierynomus#134
groovy.lang.MissingPropertyException: Could not get unknown property 'source' for object of type org.gradle.api.internal.artifacts.dependencies.DefaultSelfResolvingDependency.
@ejohansson

This comment has been minimized.

Copy link
Contributor

commented Apr 8, 2017

The proposed solution seems worked out for me.
Created a pull request #135

hierynomus added a commit that referenced this issue Apr 10, 2017
Bugfix #134 (#135)
groovy.lang.MissingPropertyException: Could not get unknown property 'source' for object of type org.gradle.api.internal.artifacts.dependencies.DefaultSelfResolvingDependency.
@hierynomus

This comment has been minimized.

Copy link
Owner

commented Apr 10, 2017

Thanks @ejohansson!
I've merged the PR, and will release a new version shortly (ie. this week)

@imrimt

This comment has been minimized.

Copy link

commented Oct 2, 2018

Running into this issue again when I have this line in my project

project.dependencies {
    compile files("path/to/resources")
}

I'm on Gradle 4.10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.