# Why my gradle build is using the wrong joda-time version lib?

**URL:** <https://discuss.gradle.org/t/why-my-gradle-build-is-using-the-wrong-joda-time-version-lib/4432>\
**Category:** Old Forum Archive\
**Created:** [March 28, 2012, 9:08am UTC](https://discuss.gradle.org/t/why-my-gradle-build-is-using-the-wrong-joda-time-version-lib/4432 "2012-03-28T09:08:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![barbieri\_matteo](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/barbieri_matteo/32/467_2.png) [@barbieri\_matteo](https://discuss.gradle.org/u/barbieri_matteo)\
**Post date:** [March 28, 2012, 9:08am UTC](https://discuss.gradle.org/t/why-my-gradle-build-is-using-the-wrong-joda-time-version-lib/4432/1 "2012-03-28T09:08:00Z")

</div>

Hi, my dependencies are:

```gradle
dependencies {
compile 'joda-time:joda-time:2.1',
            "org.constretto:constretto-api:${constrettoVersion}",
            "org.constretto:constretto-spring:${constrettoVersion}",
            "org.springframework:spring:${springVersion}",
            'cglib:cglib-nodep:2.1_3',
            'com.google.guava:guava:11.0.1',
            'com.googlecode.lambdaj:lambdaj:2.3.3',
            'org.hibernate:hibernate-core:3.3.2.GA',
            'org.hibernate:hibernate-entitymanager:3.3.2.GA',
            'org.hibernate:hibernate-annotations:3.3.1.GA',
            'org.hibernate:hibernate-commons-annotations:3.3.0.ga',
            'commons-collections:commons-collections:3.2.1',
            'commons-beanutils:commons-beanutils:1.8.3'
    runtime "org.constretto:constretto-core:${constrettoVersion}",
            "org.aspectj:aspectjweaver:1.6.6"
    ajc "org.aspectj:aspectjtools:1.6.6"

```

When I run my tests in IntelliJ (libs imported using ‘gradle idea’) everything is working fine, but from the ‘gradle test’ command I got some compilation error that suggests me it’s using a different joda-time version, since there are some constructor missing in older versions, checking joda-time javadocs I see that they are available from version 2.

I checked all my dependencies with ‘project-reports’ plugin, and I have only one joda-time version (2.1, the correct one). I removed all gradle, ivy and maven caches (in ~/.gradle ~/.ivy and ~/.m2) but I got the same error. What else can I check? What am I doing wrong? Thank you, bye

---

<div class="post-metadata">

**Author:** ![Peter\_Niederwieser](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Peter\_Niederwieser](https://discuss.gradle.org/u/Peter_Niederwieser)\
**Post date:** [March 28, 2012, 12:18pm UTC](https://discuss.gradle.org/t/why-my-gradle-build-is-using-the-wrong-joda-time-version-lib/4432/2 "2012-03-28T12:18:00Z")

</div>

Check the test task’s class path:

```gradle
task showTestTaskClasspath << {
  test.classpath.each { println it }
}

```

---

<div class="post-metadata">

**Author:** ![barbieri\_matteo](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/barbieri_matteo/32/467_2.png) [@barbieri\_matteo](https://discuss.gradle.org/u/barbieri_matteo)\
**Post date:** [March 28, 2012, 12:53pm UTC](https://discuss.gradle.org/t/why-my-gradle-build-is-using-the-wrong-joda-time-version-lib/4432/3 "2012-03-28T12:53:00Z")

</div>

Ok, I just found that I had jruby.jar in my classpath and it uses an older joda-time version… Thank you very much for your help. Bye
