Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/2.7.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
puneetbehl committed Jul 3, 2020
2 parents 0d8ba0d + 7f4b8d9 commit 44a5cc3
Show file tree
Hide file tree
Showing 55 changed files with 1,526 additions and 959 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*.iws
.gradle
build/
out/

libs

Expand All @@ -30,6 +31,11 @@ plugin.xml
test/reports
data/

# 'local' elasticsearch
**/elastic/**
gradle/tools/elastic-*
*.part

#Elasticserch plugin binaries
src/integration-test/resources/elasticsearch/plugins

Expand Down
10 changes: 9 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
language: groovy
jdk:
- openjdk8
services:
- docker
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
before_install:
- cat /etc/hosts
- sudo hostname "$(hostname | cut -c1-63)"
- sed -e "s/^\\(127\\.0\\.0\\.1.*\\)/\\1 $(hostname | cut -c1-63)/" /etc/hosts | sudo
tee /etc/hosts
- cat /etc/hosts
- docker pull docker.elastic.co/elasticsearch/elasticsearch:7.7.1
- docker run -d --name elasticsearch -p 9200:9200 -p 9300:9300 -e "cluster.name=elasticsearch" -e "discovery.type=single-node" elasticsearch:7.7.1
before_script:
- rm -rf target
script: travis_wait 60 ./travis-build.sh
script: ./travis-build.sh
env:
global:
- GIT_NAME="Puneet Behl"
Expand Down
15 changes: 12 additions & 3 deletions README.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Edit your project's +build.gradle+ file, by adding the plugin's dependency decla
----
dependencies {
...
compile "org.grails.plugins:elasticsearch:2.4.2"
compile "org.grails.plugins:elasticsearch:3.0.0.M1"
...
}
Expand All @@ -33,11 +33,20 @@ dependencies {

=== Versioning

In order to simply the versioning, with v2.5.0 the Elasticsearch Grails plugin is using Semantic Versioning 2.0.0. To understand what that means, please see the specification [documentation](https://semver.org/).
In order to simply the versioning, with v3.0.0.M1 the Elasticsearch Grails plugin is using Semantic Versioning 2.0.0. To understand what that means, please see the specification [documentation](https://semver.org/).

|===
|Plugin Version | Grails Version | Elasticsearch Version


|3.0.0
|4.0.x
|7.3.0

|2.7.0
|3.3.x
|7.3.0

|2.5.0
|3.3.x
|5.5.3
Expand Down Expand Up @@ -156,4 +165,4 @@ limitations under the License.
\\_)--\ \ \--\
jgs )--\""` )--\"`
`""` `""`
----
----
56 changes: 24 additions & 32 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ buildscript {
grailsVersion = project.grailsVersion
gormVersion = project.gormVersion
elasticsearchVersion = project.elasticsearchVersion
elasticsearchAttachmentsVersion = project.elasticsearchAttachmentsVersion
}
repositories {
mavenLocal()
Expand All @@ -13,14 +12,14 @@ buildscript {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.3'
classpath 'org.ajoberstar:gradle-git:1.4.2'
classpath "org.grails.plugins:hibernate5:7.0.0"
classpath "org.grails.plugins:hibernate5:${gormVersion-".RELEASE"}"
}
}

plugins {
id "com.jfrog.bintray" version "1.2"
id "com.jfrog.bintray" version "1.8.4"
id 'com.jfrog.artifactory' version '4.16.0'
id "de.undercouch.download" version "3.2.0"
id "de.undercouch.download" version "4.0.0"
}

version "3.0.0.BUILD-SNAPSHOT"
Expand All @@ -35,7 +34,6 @@ apply plugin: 'maven-publish'

ext {
elasticsearchVersion = project.elasticsearchVersion
elasticsearchAttachmentsVersion = project.elasticsearchAttachmentsVersion
}

sourceCompatibility = 1.8
Expand Down Expand Up @@ -73,10 +71,11 @@ groovydoc {
sourcesJar {
exclude "test/**"
exclude "test/**/**"

classifier = 'sources'
}

dependencies {
developmentOnly("org.springframework.boot:spring-boot-devtools")
provided 'org.springframework.boot:spring-boot-starter-logging'
provided "org.springframework.boot:spring-boot-starter-actuator"
provided "org.springframework.boot:spring-boot-autoconfigure"
Expand All @@ -96,7 +95,9 @@ dependencies {
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.7'

compile "org.elasticsearch:elasticsearch:${elasticsearchVersion}"
compile group: 'org.elasticsearch.client', name: 'transport', version: elasticsearchVersion
compile group: 'org.elasticsearch.client', name: 'elasticsearch-rest-client', version: elasticsearchVersion
compile group: 'org.elasticsearch.client', name: 'elasticsearch-rest-high-level-client', version: elasticsearchVersion
compile group: 'org.locationtech.spatial4j', name: 'spatial4j', version: '0.6'

console "org.grails:grails-console"

Expand All @@ -111,43 +112,33 @@ dependencies {
testCompile 'com.vividsolutions:jts:1.13'
testCompile 'com.googlecode.json-simple:json-simple:1.1.1'

//compile "org.elasticsearch.plugin:mapper-attachments:${elasticsearchAttachmentsVersion}"
compile fileTree(dir: "libs/elasticsearch", include: '*.jar')
}

task("downloadAttachmentsPlugin", type: de.undercouch.gradle.tasks.download.Download) {
src "https://artifacts.elastic.co/downloads/elasticsearch-plugins/mapper-attachments/mapper-attachments-${elasticsearchVersion}.zip"
dest "libs/mapper-attachments-${elasticsearchVersion}.zip"
overwrite true
onlyIfNewer true
}

task("downloadAndUnzipAttachmentsPlugin", dependsOn: downloadAttachmentsPlugin) {
doLast {
copy {
from zipTree(downloadAttachmentsPlugin.dest)
into 'libs/'
}
delete 'libs/elasticsearch/commons-codec-1.10.jar'
}
}

compileJava{
dependsOn downloadAndUnzipAttachmentsPlugin
}

task cleanLibsDir(type: Delete) {
delete fileTree(dir: 'libs')
}

check.finalizedBy("cleanDataDir")
clean.finalizedBy("cleanDataDir", "cleanLibsDir")


task cleanDataDir(type: Delete) {
delete fileTree(dir: 'data')
}

tasks.withType(Test) {
afterTest { desc, result ->
logger.quiet " -- Executed test ${desc.name} [${desc.className}] with result: ${result.resultType}"
}
testLogging {
events "passed", "skipped", "failed"//, "standardOut"
showExceptions true
exceptionFormat "full"
showCauses true
showStackTraces true
}
}

bootRun {
jvmArgs('-Dspring.output.ansi.enabled=always')
sourceResources sourceSets.main
Expand All @@ -164,14 +155,15 @@ grailsPublish {
license {
name = 'Apache-2.0'
}
title = "Elasticserach"
title = "Elasticsearch Grails Plugin"
//rep = "grails-plugins"
desc = "An Elasticsearch plugin for Grails"
developers = [
noam: 'Noam Y. Tenne',
macrcos: 'Marcos Carceles',
puneet: 'Puneet Behl',
james: 'James Kleeh'
james: 'James Kleeh',
cgoit: 'Carsten Götzinger'
]
}

5 changes: 2 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
grailsVersion=4.0.0
gormVersion=7.0.2
elasticsearchVersion=5.5.3
elasticsearchAttachmentsVersion=5.5.3
gormVersion=7.0.2.RELEASE
elasticsearchVersion=7.3.0
13 changes: 10 additions & 3 deletions grails-app/conf/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,11 @@ grails:
elasticSearch:
date:
formats: ["yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"]
client.hosts:
- {host: localhost, port: 9300}
client:
connectTimeout: 2
socketTimeout: 30
hosts:
- {host: localhost, port: 9200}
defaultExcludedProperties: ['password']
disableAutoIndex: false
index:
Expand All @@ -112,7 +115,11 @@ environments:
elasticSearch:
client:
mode: local
hosts:
- {host: 127.0.0.1, port: 9200}
transport.sniff: false
username:
password:
datastoreImpl: hibernateDatastore
index:
store.type: simplefs
Expand Down Expand Up @@ -152,4 +159,4 @@ dataSource:
driverClassName: org.h2.Driver
username: sa
password:
url: jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
url: jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
3 changes: 3 additions & 0 deletions grails-app/domain/test/AbstractImage.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ package test

abstract class AbstractImage {
String name
String type
int size

static constraints = {
name nullable: true
type nullable: true
}

static mapping = {
Expand Down
5 changes: 5 additions & 0 deletions grails-app/domain/test/Building.groovy
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
package test

import java.time.LocalDate
import java.time.LocalDateTime

class Building {

String name
Date date = new Date()
LocalDate localDate = LocalDate.now()
LocalDateTime localDateTime = LocalDateTime.now()
GeoPoint location

static constraints = {
Expand Down
27 changes: 27 additions & 0 deletions grails-app/domain/test/Dates.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package test

import java.time.LocalDate
import java.time.LocalDateTime
import java.time.OffsetDateTime
import java.time.OffsetTime
import java.time.ZoneId
import java.time.ZonedDateTime

class Dates {

String name
Date date = new Date()
LocalDate localDate = LocalDate.now()
LocalDateTime localDateTime = LocalDateTime.now()
ZonedDateTime zonedDateTime = ZonedDateTime.now()
OffsetDateTime offsetDateTime = OffsetDateTime.now()
OffsetTime offsetTime = OffsetTime.now()

static constraints = {
name nullable: true
}

static searchable = {

}
}
2 changes: 1 addition & 1 deletion grails-app/domain/test/Department.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Department {
}

static searchable = {
store parent: true, component: true
store join: true
}

static mapping = {
Expand Down
5 changes: 3 additions & 2 deletions grails-app/domain/test/Photo.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ class Photo extends AbstractImage {
}

static searchable = {
url index: "not_analyzed"
name fielddata: true
url index: true
}


public String toString() {
String toString() {
return "Photo{" +
"id=" + id +
",url='" + url + '\'' +
Expand Down
2 changes: 1 addition & 1 deletion grails-app/domain/test/Store.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Store {
autoImport(false)
}

public String toString() {
String toString() {
name
}
}
1 change: 0 additions & 1 deletion grails-app/domain/test/all/Post.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class Post {
String body

static searchable = {
all = [analyzer: 'repl_analyzer']
subject analyzer: 'test_analyzer'
body analyzer: 'test_analyzer'
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import grails.plugins.elasticsearch.ElasticSearchBootStrapHelper
package grails.plugins.elasticsearch

class ElasticsearchBootStrap {

Expand Down
Loading

0 comments on commit 44a5cc3

Please sign in to comment.