[GRADLE-2686] codenarc plugin fails Created: 21/Feb/13  Updated: 24/Jan/17  Resolved: 24/Jan/17

Status: Resolved
Project: Gradle
Affects Version/s: 1.4
Fix Version/s: None

Type: Bug
Reporter: Christian Lipp Assignee: Unassigned
Resolution: Won't Fix Votes: 0


Excerp from the Gradle 1.4 release notes:
The default version of CodeNarc used for the 'codenarc' plugin has been updated from 0.16.1 to 0.18.

For Gradle 1.4 you will receive the following error if using the codenarc plugin inside an user extended build (buildSrc/gradle.build):

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not resolve all dependencies for configuration ':codenarc'.
    > Artifact 'junit:junit:4.8.2@jar' not found.

Shouldn't the plugin define it's own dependencies?

Comment by Christian Lipp [ 21/Feb/13 ]

The same occurs with the findbugs plugin:

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not resolve all dependencies for configuration ':XXX:findbugs'.
    > Artifact 'xerces:xercesImpl:2.6.2@jar' not found.
Comment by Peter Niederwieser [ 22/Feb/13 ]

Are you only getting this for buildSrc/?

PS: Please use http://forums.gradle.org for reporting problems.

Comment by Christian Lipp [ 22/Feb/13 ]

Sorry, next time.
Findbugs is on the regular project, codenarc only on buildSrc.

Comment by Peter Niederwieser [ 22/Feb/13 ]

If this happens even outside buildSrc/, the cause is likely related to the specifics of your build. Do you have a repository declared that contains the correct codenarc/findbugs version and their transitive dependencies? If necessary, you can also provide the dependencies manually by adding them to the codenarc/findbugs configuration. Another potential cause is that you use configurations.all.exclude .. somewhere in your build, which would also affect the codenarc and findbugs configurations.

If you need more help, please provide a reproducible example.

Comment by Christian Lipp [ 22/Feb/13 ]

I tried to provide a simpler sample and found the reason when doing this: When I use

repositories {

everything works. When I use

repositories {

standard dependencies are downloaded, but not plugin dependencies. There is no difference between buildSrc and regular projects.

Comment by Peter Niederwieser [ 22/Feb/13 ]

Sounds like a problem with the state of your local Maven repo. Or maybe some of the dependencies in your local Maven repo only have a POM but no Jar, in which case Gradle won't look for the Jar elsewhere unless you explicitly tell it to. Don't use `mavenLocal()` unless you absolutely must exchange artifacts with Maven builds. Otherwise there is absolutely no gain in doing so, and it risks to make your build irreproducible.

Comment by Christian Lipp [ 25/Feb/13 ]

Apologize again that I did not discuss this with you on the forums. I was pretty sure that we have a bug here because it works with Gradle 1.3 and stopped working with Gradle 1.4.
I used mavenLcal() only to save disk space, because I am moving from Maven to Gradle and I use the same libraries on different projects and I just wanted to save some disk space.
So I will remove mavenLocal() and everything will be fine.

However I still believe it is a bug, because Gradle should not stop looking for dependencies if one repository has an error. But this is your decision. Thanks and regards!

Comment by Benjamin Muschko [ 15/Nov/16 ]

As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub.

We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to.

Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:

  • Checking that your issues contain requisite context, impact, behaviors, and examples as described in our published guidelines.
  • Leave a comment on the JIRA issue or open a new GitHub issue confirming that the above is complete.

We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle!

Comment by Benjamin Muschko [ 24/Jan/17 ]

We have long upgraded to a newer version of CodeNarc in the meantime: 0.25.2. Please open issue on GitHub if you are still experiencing the issue.

Generated at Wed Jun 30 12:28:43 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.