{"action":"created","issue":{"url":"https://api.github.com/repos/gradle/gradle/issues/2025","repository_url":"https://api.github.com/repos/gradle/gradle","labels_url":"https://api.github.com/repos/gradle/gradle/issues/2025/labels{/name}","comments_url":"https://api.github.com/repos/gradle/gradle/issues/2025/comments","events_url":"https://api.github.com/repos/gradle/gradle/issues/2025/events","html_url":"https://github.com/gradle/gradle/issues/2025","id":228242562,"number":2025,"title":"Gradle CodeNarcPlugin : codenarcClasspath property not available","user":{"login":"sdelamo","id":864788,"avatar_url":"https://avatars2.githubusercontent.com/u/864788?v=3","gravatar_id":"","url":"https://api.github.com/users/sdelamo","html_url":"https://github.com/sdelamo","followers_url":"https://api.github.com/users/sdelamo/followers","following_url":"https://api.github.com/users/sdelamo/following{/other_user}","gists_url":"https://api.github.com/users/sdelamo/gists{/gist_id}","starred_url":"https://api.github.com/users/sdelamo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdelamo/subscriptions","organizations_url":"https://api.github.com/users/sdelamo/orgs","repos_url":"https://api.github.com/users/sdelamo/repos","events_url":"https://api.github.com/users/sdelamo/events{/privacy}","received_events_url":"https://api.github.com/users/sdelamo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-05-12T09:51:25Z","updated_at":"2017-05-12T12:30:03Z","closed_at":null,"body":"I am trying to add a Custom Codenarc Rule to `codenarcMain` task.\r\n\r\nI am unable to supply the rule jar to the codenarc classpath. \r\n\r\nThe Gradle API Docs [talk about codenarcClasspath](https://docs.gradle.org/current/dsl/org.gradle.api.plugins.quality.CodeNarc.html#org.gradle.api.plugins.quality.CodeNarc:codenarcClasspath)):  \r\n\r\nI've tried to add a Jar file with a custom rule to the class path as follows: \r\n\r\n```\r\napply plugin: 'codenarc' \r\n\r\ncodenarc {\r\n    toolVersion = '0.27.0' \r\n    configFile = file(\"${rootProject.projectDir}/config/codenarc/rules.groovy\") \r\n    reportFormat = 'html' \r\n    ignoreFailures = true\r\n\tcodenarcClasspath += file(\"${rootProject.projectDir}/codenarc-rule/build/libs/codenarc-rule.jar\") \r\n}\r\n```\r\n\r\nApparently `codenarcClasspath`property is not accesible\r\n```\r\n$ ./gradlew app:codenarcMain\r\nCannot resolve reloading agent JAR: Could not resolve all dependencies for configuration ':app:agent'.\r\n\r\nFAILURE: Build failed with an exception.\r\n\r\n* Where:\r\nScript '/Users/sdelamo/git/grailsguides/grails-codenarc/complete/gradle/codenarc.gradle' line: 11\r\n\r\n* What went wrong:\r\nA problem occurred evaluating script.\r\n> Could not get unknown property 'codenarcClasspath' for object of type org.gradle.api.plugins.quality.CodeNarcExtension.\r\n\r\n* Try:\r\nRun with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.\r\n\r\nBUILD FAILED\r\n```\r\n\r\nAny idea how can I pass a custom rule Jar to codenarcMain?"},"comment":{"url":"https://api.github.com/repos/gradle/gradle/issues/comments/301063662","html_url":"https://github.com/gradle/gradle/issues/2025#issuecomment-301063662","issue_url":"https://api.github.com/repos/gradle/gradle/issues/2025","id":301063662,"user":{"login":"bmuschko","id":440872,"avatar_url":"https://avatars1.githubusercontent.com/u/440872?v=3","gravatar_id":"","url":"https://api.github.com/users/bmuschko","html_url":"https://github.com/bmuschko","followers_url":"https://api.github.com/users/bmuschko/followers","following_url":"https://api.github.com/users/bmuschko/following{/other_user}","gists_url":"https://api.github.com/users/bmuschko/gists{/gist_id}","starred_url":"https://api.github.com/users/bmuschko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmuschko/subscriptions","organizations_url":"https://api.github.com/users/bmuschko/orgs","repos_url":"https://api.github.com/users/bmuschko/repos","events_url":"https://api.github.com/users/bmuschko/events{/privacy}","received_events_url":"https://api.github.com/users/bmuschko/received_events","type":"User","site_admin":false},"created_at":"2017-05-12T12:30:03Z","updated_at":"2017-05-12T12:30:03Z","body":"@jlstrater is right. You'll need to set the property on the task.\r\n\r\n```\r\ntasks.withType(CodeNarc) {\r\n    codenarcClasspath = ...\r\n}\r\n```"}}
{"actor":{"display_login":"bmuschko"}}