Использование ObjectBox в качестве базы данных сервера с Spring Boot и Tomcat - PullRequest
0 голосов
/ 04 декабря 2018

Я пытаюсь использовать ObjectBox в качестве базы данных сервера с Spring Boot и Tomcat. Когда я использую встроенный tomcat-сервер Spring Boot, он работает нормально (работает напрямую из IntelliJ IDEA),

Но при развертыванииWAR-файл / разнесенный API для Tomcat, я получаю сообщение об ошибке «нет objectbox-jni-windows-x64 в java.library.path»

У меня установлен Microsoft Visual C ++ 2017

Можетпожалуйста, помогите мне успешно развернуть его?

Ниже приведен мой файл build.gradle:

buildscript {
    ext {
        kotlinVersion = '1.3.10'
        springBootVersion = '2.1.1.RELEASE'
        objectboxVersion = '2.2.0'
    }
    repositories {
        mavenCentral()
        maven { url "https://plugins.gradle.org/m2/" }
        jcenter()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
        classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}")
        classpath("org.jetbrains.kotlin:kotlin-allopen:${kotlinVersion}")
        classpath "io.objectbox:objectbox-gradle-plugin:$objectboxVersion"
        classpath "net.ltgt.gradle:gradle-apt-plugin:0.15"

    }
}
plugins {
    id 'java'
    id 'org.jetbrains.kotlin.jvm' version '1.3.10'
}

apply plugin: 'application'
apply plugin: 'kotlin'
apply plugin: 'kotlin-spring'
apply plugin: 'eclipse-wtp'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'war'
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'io.objectbox'
apply plugin: 'kotlin-kapt'
apply plugin: 'net.ltgt.apt-idea'

group = 'com.techontouch'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
mainClassName = "ScoresOnTouchApplicationKt"
compileKotlin {
    kotlinOptions {
        freeCompilerArgs = ["-Xjsr305=strict"]
        jvmTarget = "1.8"
    }
}
compileTestKotlin {
    kotlinOptions {
        freeCompilerArgs = ["-Xjsr305=strict"]
        jvmTarget = "1.8"
    }
}

repositories {
    mavenCentral()
    jcenter()
}

configurations {
    providedRuntime
}

dependencies {
    implementation('org.springframework.boot:spring-boot-starter-actuator')
    implementation('org.springframework.boot:spring-boot-starter-data-rest')
    implementation('org.springframework.boot:spring-boot-starter-web')
    implementation('com.fasterxml.jackson.module:jackson-module-kotlin')
    providedRuntime('org.springframework.boot:spring-boot-starter-tomcat')
    testImplementation('org.springframework.boot:spring-boot-starter-test')
    implementation "io.objectbox:objectbox-java:$objectboxVersion"
    implementation "io.objectbox:objectbox-kotlin:$objectboxVersion"
    kapt "io.objectbox:objectbox-processor:$objectboxVersion"
    implementation "io.objectbox:objectbox-linux:$objectboxVersion"
    implementation "io.objectbox:objectbox-macos:$objectboxVersion"
    implementation "io.objectbox:objectbox-windows:$objectboxVersion"
    implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
    implementation("org.jetbrains.kotlin:kotlin-reflect")
    compile('org.json:json:20180813')
    compile('com.google.code.gson:gson:2.8.5')
    compile('javax.xml.bind:jaxb-api:2.2.8')
    compile('io.springfox:springfox-swagger2:2.9.2')
    compile('io.springfox:springfox-swagger-ui:2.9.2')
    compile('org.antlr:antlr-complete:3.5.2')
}
// enable debug output for plugin
objectbox {
    debug = true
}
// enable debug output for annotation processor
tasks.withType(JavaCompile) {
    options.compilerArgs += ["-Aobjectbox.debug=true"]
}

Ссылка на GitHub: https://github.com/objectbox/objectbox-java/issues/170#issuecomment-444075662

...