1

i'm trying to use org.apache.commons.lang.RandomStringUtils in a Griffon application (Griffon 1.5) .. I included it in the BuildConfig shown below ..

dependencies {
    // specify dependencies here under either 'build', 'compile', 'runtime' or 'test' scopes eg.

    // runtime 'mysql:mysql-connector-java:5.1.5'
       build 'org.apache.commons:commons-lang3:3.0'

}

It gets downloaded correctly from maven central I get a class not found exception when I run my application .. What am I doing wrong ?? (I tried changing it to runtime / compile .. that didn't work either .. and I inserted the jar manually in the library folder .. no joy )

Thanks

Andres Almiray
  • 3,236
  • 18
  • 28
user3914455
  • 257
  • 1
  • 10

2 Answers2

1

This is expected behavior. If you don't apply java plugin, your gradle project does not have a concept of runtime / compile configurations, e.g. those are just names. When you do apply the java plugin then 'compile' and 'runtime' (and others) dependencies mean stuff that needs to be on the classpath. ... groovy/scala plugin apply java plugin behind the hood so it should all good. Tooling Api is not bound to the java nature of the project. However, the jar dependencies, classpath, source and test compilation units, etc, all that make only sense if the java-related plugin is applied. So if you ask tooling api to provide Idea model of the non-java project you'll get a project, modules but not dependencies, source trees, etc.

arjun kori
  • 1,090
  • 2
  • 14
  • 32
1

The compile scope is the one you need. build is only used for the build scripts themselves.

Andres Almiray
  • 3,236
  • 18
  • 28