Elasticsearch Grails plugin não funciona offline
22/02/2013 12:52
Fala pessoal, eu acabei de adicionar o ":elasticsearch:0.18.7.1-SNAPSHOT" no meu projeto (Grails 2.1.1).
O plugin funciona corretamente quando tenho acesso a internet, mas quando estou offline ele reclama da inexistência do mesmo.
Segue meu arquivo config:
grails.servlet.version = "2.5" // Change depending on target container compliance (2.5 or 3.0)
grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
grails.project.target.level = 1.6
grails.project.source.level = 1.6
grails.server.port.http=8080
grails.project.plugins.dir="plugins"
//grails.project.war.file = "target/${appName}-${appVersion}.war"
grails.project.dependency.resolution = {
cacheDir "target/ivy-cache"
// inherit Grails' default dependencies
inherits("global") {
// specify dependency exclusions here; for example, uncomment this to disable ehcache:
// excludes 'ehcache'
}
log "error" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
checksums true // Whether to verify checksums on resolve
repositories {
inherits true // Whether to inherit repository definitions from plugins
grailsPlugins()
grailsHome()
grailsCentral()
mavenLocal()
mavenCentral()
mavenRepo "http://oss.sonatype.org/content/repositories/releases/"
// uncomment these (or add new ones) to enable remote dependency resolution from public Maven repositories
//mavenRepo "http://snapshots.repository.codehaus.org"
//mavenRepo "http://repository.codehaus.org"
//mavenRepo "http://download.java.net/maven/2/"
//mavenRepo "http://repository.jboss.com/maven2/"
}
dependencies {
compile 'org.imgscalr:imgscalr-lib:4.2'
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
// runtime 'mysql:mysql-connector-java:5.1.20'
}
plugins {
runtime ":hibernate:$grailsVersion"
//runtime ":database-migration:1.1"
runtime ":jquery:1.8.3"
runtime ":resources:1.2.RC2"
compile ":cache:1.0.1"
// Uncomment these (or add new ones) to enable additional resources capabilities
compile ":cache-headers:1.1.5"
runtime ":zipped-resources:1.0"
runtime ":cached-resources:1.0"
runtime ":mongodb:1.1.0.GA"
//runtime ":yui-minify-resources:0.1.4"
build ":tomcat:$grailsVersion"
compile ":spring-security-core:1.2.7.3"
compile ":mail:1.0.1"
compile ":quartz:1.0-RC5"
compile ":elasticsearch:0.18.7.1-SNAPSHOT"
}
}
Vejam que eu estou usando cacheDir "target/ivy-cache" , dessa maneira meus plugins funcionam corretamente e conseguem acessar suas dependências mesmo sem internet, mas o elasticsearch plugin não.
Eu já deletei a ivy-cache e a pasta classes que estão no diretório target, forçando o download dos plugins novamente, mas mesmo assim quando executo o projeto offline ele não consegue especificamente adquirir o elasticsearch.
Segue o BuildConfig.groovy do plugin:
grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
grails.project.docs.output.dir = 'docs' // for the gh-pages branch
//grails.tomcat.jvmArgs = ["-Xmx1024m","-Xms512m", "-agentpath:C:\Program Files (x86)\YourKit Java Profiler 9.0.9\bin\win64\yjpagent.dll=sampling,onexit=snapshot"]
//grails.project.war.file = "target/${appName}-${appVersion}.war"
grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits("global") {
// uncomment to disable ehcache
// excludes 'ehcache'
}
log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
repositories {
grailsPlugins()
grailsHome()
grailsCentral()
// uncomment the below to enable remote dependency resolution
// from public Maven repositories
// mavenLocal()
mavenCentral()
//mavenRepo "http://snapshots.repository.codehaus.org"
//mavenRepo "http://repository.codehaus.org"
//mavenRepo "http://download.java.net/maven/2/"
//mavenRepo "http://repository.jboss.com/maven2/"
mavenRepo "http://oss.sonatype.org/content/repositories/releases/"
}
dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
runtime "org.elasticsearch:elasticsearch:0.20.2"
runtime "org.elasticsearch:elasticsearch-lang-groovy:1.2.0"
runtime 'com.spatial4j:spatial4j:0.3'
}
plugins {
runtime ":hibernate:$grailsVersion"
build (":release:latest.integration", ":rest-client-builder:latest.integration") {
export = false
}
test (":spock:0.6") {
export = false
}
}
}
Acho que adicionar um grails.project.work.dir = 'target' no source do plugin seria o ideal.
Tags:
elasticsearch, ivy-cache, cacheDir, offline