I’ve got it to work as a standalone application.
buildscript {
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
classpath "io.spring.gradle:dependency-management-plugin:1.0.5.RELEASE"
}
ext {
a12exclusions = {
exclude group: "org.slf4j", module: "slf4j-log4j12"
exclude group: "org.apache.logging.log4j", module: "log4j-slf4j-impl"
exclude group: "ch.qos.logback", module: "logback-classic"
}
}
}
apply plugin: "java"
apply plugin: "idea"
apply plugin: "org.springframework.boot"
apply plugin: "io.spring.dependency-management"
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_11
dependencies {
compile group: "org.springframework.boot", name: "spring-boot-starter-web", version: "${springBootVersion}"
compile group: "com.mgmtp.a12.services", name: "rest-server-app", version: "${a12ServicesVersion}", a12exclusions
compile group: "com.mgmtp.a12", name: "melies-model", version: "${a12EngineVersion}", a12exclusions
compile group: "com.mgmtp.a12", name: "overview-model", version: "${a12EngineVersion}", a12exclusions
compile "org.apache.solr:solr-core:6.6.0"
compile group: "com.mgmtp.a12", name: "document-model", version: "${a12ValidationKernelVersion}", a12exclusions
compile group: "com.mgmtp.a12", name: "document-api", version: "${a12ValidationKernelVersion}", a12exclusions
compile group: "com.mgmtp.a12", name: "document-access", version: "${a12ValidationKernelVersion}", a12exclusions
compile group: "com.mgmtp.a12", name: "js-document-validation", version: "${a12ValidationKernelVersion}", a12exclusions
compile group: "javax.xml.bind", name: "jaxb-api", version: "${jaxbVersion}"
compile group: "javax.activation", name: "activation", version: "${activationVersion}"
compile group: "com.sun.xml.bind", name: "jaxb-impl", version: "${jaxbVersion}"
compile group: "com.sun.xml.bind", name: "jaxb-core", version: "${jaxbVersion}"
}
task start(type: Task) {
dependsOn(bootRun)
}
Note that setting an explicit solr version is required for some reason. Otherwise it will use solr 7.4 even if no dependencies seems to require it outside of A12
package com.mgmtp.workflow.platformserver;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class PlatformServer {
public static void main(final String[] args) {
SpringApplication.run(PlatformServer.class).start();
}
}
Note that you have to call the start method in order to trigger a Startup Event used by A12 to initially load the models.
spring.main.allow-bean-definition-overriding: true
server.port: 9090
Setting server port and allow bean overriding (if you are past java 9) and you are good to go.