Skip to content

Commit

Permalink
Merge pull request #191 from Open-MBEE/release/4.0.8
Browse files Browse the repository at this point in the history
Release/4.0.8
  • Loading branch information
HuiJun authored Jun 14, 2022
2 parents 415a597 + d9c935e commit fd2650b
Show file tree
Hide file tree
Showing 14 changed files with 82 additions and 41 deletions.
18 changes: 9 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
version: 2.1
orbs:
node: circleci/node@1.1.6
docker: circleci/docker@2.1.1
executors:
openjdk_executor:
docker:
- image: circleci/openjdk:11.0.8-jdk
environment:
_JAVA_OPTIONS: "-Xmx3g"
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
openjdk_executor:
docker:
- image: cimg/openjdk:17.0.3
environment:
_JAVA_OPTIONS: "-Xmx3g"
GRADLE_OPTS: "-Dorg.gradle.daemon=false"

jobs:
build_and_test:
executor:
name: node/default
name: docker/docker
working_directory: /home/circleci/mms
steps:
- checkout
Expand All @@ -23,7 +23,7 @@ jobs:
name: "Create and start all services from the docker-compose configuration"
command: |
cp example/src/main/resources/application.properties.example ./example/src/main/resources/application.properties
docker-compose up -d
docker-compose up --build -d
docker run --network container:mms curlimages/curl --retry 8 --retry-delay 10 --retry-max-time 90 --retry-connrefused http://mms:8080/healthcheck
- run:
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM openjdk:11-jdk-slim
FROM openjdk:17.0.2-slim as build
COPY . /mms
WORKDIR /mms
RUN ./gradlew --no-daemon bootJar
RUN ./gradlew --no-daemon bootJar --warning-mode all

RUN find . -type f -name example-*.jar -not -iname '*javadoc*' -not -iname '*sources*' -exec cp '{}' '/app.jar' ';'
ENV JDK_JAVA_OPTIONS "-XX:MaxRAMPercentage=90.0"
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ Docker
We suggest using Docker to set up PostgreSQL and Elasticsearch. Installation
instructions are found here: `Docker documentation <https://docs.docker.com/>`_

Java SE Development Kit 11
Java SE Development Kit 17
^^^^^^^^^^^^^^^^^^^^^^^^^^

Installation instructions: `JDK-11 download <https://www.oracle.com/java/technologies/javase-jdk11-downloads.html>`_
Installation instructions: `JDK-17 download <https://www.oracle.com/java/technologies/javase-jdk17-downloads.html>`_

Postgresql
^^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ description = 'Model Management System Reference Implementation'
ext {
commonDependencies = [
'swagger-annotations' : 'io.swagger.core.v3:swagger-annotations:2.1.2',
'hibernate-core' : 'org.hibernate:hibernate-core:5.4.14.Final',
'hibernate-core' : 'org.hibernate:hibernate-core:5.6.0.Final',
'servlet-api' : 'javax.servlet:javax.servlet-api:4.0.1',
'slf4j-api' : 'org.slf4j:slf4j-api:1.7.30',
'spring-boot' : "org.springframework.boot:spring-boot:$springBootVersion",
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ services:
- 9300:9300

minio:
image: minio/minio:latest
image: minio/minio:RELEASE.2022-05-26T05-48-41Z.hotfix.15f13935a
environment:
- "MINIO_ACCESS_KEY=admintest"
- "MINIO_SECRET_KEY=admintest"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ public BoolQueryBuilder addQueryForField(BoolQueryBuilder query, String field, O
}
break;
case MATCH:
query.must(QueryBuilders.matchQuery(field, value));
if (value instanceof List) {
query.must(QueryBuilders.matchQuery(field, ((List)value).get(0)));
} else {
query.must(QueryBuilders.matchQuery(field, value));
}
break;
default:
break;
Expand Down
3 changes: 3 additions & 0 deletions example/example.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,7 @@ configurations {
it.outgoing.artifact(bootJar)
}
}
bootJar {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
ext['elasticsearch.version'] = "$elasticVersion"
59 changes: 45 additions & 14 deletions example/search.postman_collection.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"info": {
"_postman_id": "1ca92623-8c37-47d1-8d35-5684f4a0cdb8",
"_postman_id": "34257752-6305-4dae-b6d8-b71fa98b9963",
"name": "search",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "7302261"
},
"item": [
{
Expand All @@ -11,7 +12,6 @@
{
"listen": "test",
"script": {
"id": "217210a9-1489-4057-b89f-bc0b44111569",
"exec": [
"",
"pm.test(\"Status code is 200\", function () {",
Expand Down Expand Up @@ -67,7 +67,6 @@
{
"listen": "test",
"script": {
"id": "10fb6974-d6a5-4c9f-a4d8-1fc0c6739c33",
"exec": [
"pm.test(\"response has org s\", function () {",
" var jsonData = pm.response.json();",
Expand Down Expand Up @@ -109,7 +108,6 @@
{
"listen": "test",
"script": {
"id": "db56bdc2-e7bb-49af-9a7e-93359c7c1fd5",
"exec": [
"pm.test(\"response has project ss\", function () {",
" var jsonData = pm.response.json();",
Expand Down Expand Up @@ -151,7 +149,6 @@
{
"listen": "test",
"script": {
"id": "f23976f1-afb8-495f-892a-dcbcc7360665",
"exec": [
"pm.test(\"response has elements\", function () {",
" var jsonData = pm.response.json();",
Expand Down Expand Up @@ -199,7 +196,6 @@
{
"listen": "test",
"script": {
"id": "4ea3441a-8a0f-421a-ba27-67ac1351775d",
"exec": [
"pm.test(\"response has 1 element\", function () {",
" var jsonData = pm.response.json();",
Expand Down Expand Up @@ -241,7 +237,6 @@
{
"listen": "test",
"script": {
"id": "4ea3441a-8a0f-421a-ba27-67ac1351775d",
"exec": [
"pm.test(\"response has 2 elements\", function () {",
" var jsonData = pm.response.json();",
Expand Down Expand Up @@ -288,7 +283,6 @@
{
"listen": "test",
"script": {
"id": "c59583b1-35e6-4c27-8aaf-b9dbc98c1b13",
"exec": [
"pm.test(\"response has 1 elements\", function () {",
" var jsonData = pm.response.json();",
Expand Down Expand Up @@ -337,7 +331,6 @@
{
"listen": "test",
"script": {
"id": "4ea3441a-8a0f-421a-ba27-67ac1351775d",
"exec": [
"pm.test(\"response has 0 elements\", function () {",
" var jsonData = pm.response.json();",
Expand Down Expand Up @@ -372,6 +365,47 @@
}
},
"response": []
},
{
"name": "search for name a",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"response has 1 element\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.elements.length).to.eql(1);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{host}}/projects/ss/refs/master/search?name=a",
"host": [
"{{host}}"
],
"path": [
"projects",
"ss",
"refs",
"master",
"search"
],
"query": [
{
"key": "name",
"value": "a"
}
]
}
},
"response": []
}
],
"auth": {
Expand All @@ -388,7 +422,6 @@
{
"listen": "prerequest",
"script": {
"id": "a38d93e6-1de5-4875-8f80-a5a6cec3dcd4",
"type": "text/javascript",
"exec": [
""
Expand All @@ -398,13 +431,11 @@
{
"listen": "test",
"script": {
"id": "0866a69c-ea90-48f6-bedf-269b559b40d8",
"type": "text/javascript",
"exec": [
""
]
}
}
],
"protocolProfileBehavior": {}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
@EnableGlobalMethodSecurity(prePostEnabled = true)
@EnableTransactionManagement
@EnableAsync
public class ExampleSecurityConfig extends WebSecurityConfigurerAdapter implements
WebMvcConfigurer {
public class ExampleSecurityConfig extends WebSecurityConfigurerAdapter implements WebMvcConfigurer {

@Autowired
AuthSecurityConfig authSecurityConfig;
Expand Down
4 changes: 3 additions & 1 deletion example/src/main/resources/application-test.properties
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spring.datasource.username=mmsuser
spring.datasource.password=test1234
spring.datasource.driver-class-name=org.postgresql.Driver
#spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.initialization-mode=always
spring.sql.init.mode=always

# The SQL dialect makes Hibernate generate better SQL for the chosen database
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQL10Dialect
Expand All @@ -44,6 +44,8 @@ spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
spring.jpa.open-in-view=false

spring.main.allow-bean-definition-overriding=true
spring.main.allow-circular-references=true
spring.mvc.pathmatch.matching-strategy=ant_path_matcher

#Configuration for Elasticsearch
elasticsearch.host=elasticsearch
Expand Down
2 changes: 2 additions & 0 deletions example/src/main/resources/application.properties.example
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
spring.jpa.open-in-view=false

spring.main.allow-bean-definition-overriding=true
spring.main.allow-circular-references=true
spring.mvc.pathmatch.matching-strategy=ant_path_matcher

#Configuration for Elasticsearch
elasticsearch.host=localhost
Expand Down
14 changes: 7 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
version=4.0.7
version=4.0.8
group=org.openmbee.mms

springBootVersion=2.2.6.RELEASE
springFrameworkVersion=5.2.5.RELEASE
springSecurityVersion=5.3.1.RELEASE
springDataVersion=2.2.6.RELEASE
jacksonVersion=2.10.3
elasticVersion=7.8.1
springBootVersion=2.6.7
springFrameworkVersion=5.3.20
springSecurityVersion=5.7.0
springDataVersion=2.7.0
jacksonVersion=2.13.3
elasticVersion=7.8.1
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit fd2650b

Please sign in to comment.