Grails JAR file not found in lib directory

I have a Java class that is in src/javathat references classes from an external JAR. I copied the JAR file to a directory lib. When I launch the application using grails run-app, I get an error that it cannot find the imported class.

What is the right place to host the JAR for your Grails project? Is there a special command to get Grails to recognize newly added JAR files?

I am running Grails 2.0.0 with Java 1.6.0_29 on OS X.

Subsequent actions: JARs are set from Apache HttpComponents . More specific:

commons-codec-1.4.jar
commons-logging-1.1.1.jar
httpclient-4.1.2.jar
httpclient-cache-4.1.2.jar
httpcore-4.1.2.jar
httpmime-4.1.2.jar

The class files in them are compiled in Java 1.3, which should not be a problem.

~/temp/org/apache/http $ file HttpResponse.class 
HttpResponse.class: compiled Java class data, version 47.0 (Java 1.3)
+5
source share
3

jar - "BuildConfig.groovy". , , .. :

dependencies {        
        build 'org.apache.httpcomponents:httpcore:4.1.2' 
        build 'org.apache.httpcomponents:httpclient:4.1.2' 
        runtime 'org.apache.httpcomponents:httpcore:4.1.2'
        runtime 'org.apache.httpcomponents:httpclient:4.1.2'
} 

, mavenCentral() Buildconfig.groovy, .

. " " .

+5

, grails clean, grails run-app, .

+13

jar lib,

grails compile --refresh-dependencies

Grails .

+6

All Articles