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

Error: Could not get unknown property 'groovy' #13

Closed
sebastianhaeni opened this issue Feb 12, 2019 · 1 comment
Closed

Error: Could not get unknown property 'groovy' #13

sebastianhaeni opened this issue Feb 12, 2019 · 1 comment
Labels

Comments

@sebastianhaeni
Copy link

I'm getting the following error in our project:

Could not get unknown property 'groovy' for source set 'main' of type org.gradle.api.internal.tasks.DefaultSourceSet.

groovy.lang.MissingPropertyException: Could not get unknown property 'groovy' for source set 'main' of type org.gradle.api.internal.tasks.DefaultSourceSet.
    at org.gradle.internal.metaobject.AbstractDynamicObject.getMissingProperty(AbstractDynamicObject.java:83)
    at org.gradle.internal.metaobject.AbstractDynamicObject.getProperty(AbstractDynamicObject.java:61)
    at org.gradle.api.internal.tasks.DefaultSourceSet_Decorated.getProperty(Unknown Source)
    at ru.vyarus.gradle.plugin.quality.report.ReportUtils.extractJavaPackage(ReportUtils.groovy:33)
    at ru.vyarus.gradle.plugin.quality.report.ReportUtils$extractJavaPackage$0.call(Unknown Source)
    at ru.vyarus.gradle.plugin.quality.report.PmdReporter$_report_closure1$_closure2.doCall(PmdReporter.groovy:33)
    at ru.vyarus.gradle.plugin.quality.report.PmdReporter$_report_closure1.doCall(PmdReporter.groovy:30)
    at ru.vyarus.gradle.plugin.quality.report.PmdReporter.report(PmdReporter.groovy:19)
    at ru.vyarus.gradle.plugin.quality.QualityPlugin$_applyReporter_closure10.doCall(QualityPlugin.groovy:321)

It seems to be related to this project. And it's correct that there is no groovy source set.

I'm guessing with a simple check, if groovy exists, on this line would fix the bug:

String root = search(project.sourceSets[type].java.srcDirs) ?: search(project.sourceSets[type].groovy.srcDirs)

@xvik xvik added the bug label Feb 12, 2019
@xvik xvik closed this as completed in 8c39ffd Feb 16, 2019
@xvik
Copy link
Owner

xvik commented Feb 16, 2019

New version released

It now uses sourceSets.allJava to check all java-related sources and avoid direct groovy source reference.

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

No branches or pull requests

2 participants