ajout spring boot configuration => non encore fonctionnel
This commit is contained in:
parent
9650ba55e9
commit
fade6220fa
11 changed files with 342 additions and 1 deletions
|
|
@ -0,0 +1,19 @@
|
||||||
|
/target
|
||||||
|
/local
|
||||||
|
*.tlog
|
||||||
|
|
||||||
|
# Eclipse, Netbeans and IntelliJ files
|
||||||
|
/.*
|
||||||
|
!.gitignore
|
||||||
|
/nbproject
|
||||||
|
/*.ipr
|
||||||
|
/*.iws
|
||||||
|
*.iml
|
||||||
|
.classpath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.idea
|
||||||
|
target
|
||||||
|
|
||||||
|
# Repository wide ignore mac DS_Store files
|
||||||
|
.DS_Store
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<artifactId>drools-framework-kie-server-parent</artifactId>
|
||||||
|
<groupId>com.pymmasoftware.jbpm</groupId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
<artifactId>Chtijbug-kie-server-spring-boot-autoconfiguration-drools</artifactId>
|
||||||
|
<name>Chtijbug KIE :: Spring :: Boot :: KIE Server Auto Configuration :: Drools</name>
|
||||||
|
<description>Chtijbug drools KIE Server SpringBoot Auto Configuration</description>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot</artifactId>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<artifactId>commons-logging</artifactId>
|
||||||
|
<groupId>commons-logging</groupId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-autoconfigure</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.kie.server</groupId>
|
||||||
|
<artifactId>kie-server-api</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.kie.server</groupId>
|
||||||
|
<artifactId>kie-server-services-common</artifactId>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>aopalliance</groupId>
|
||||||
|
<artifactId>aopalliance</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jboss.spec.javax.ws.rs</groupId>
|
||||||
|
<artifactId>jboss-jaxrs-api_2.0_spec</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-context</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.kie</groupId>
|
||||||
|
<artifactId>kie-server-spring-boot-autoconfiguration</artifactId>
|
||||||
|
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- chtijbug drools kie server dependencies -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.pymmasoftware.jbpm</groupId>
|
||||||
|
<artifactId>drools-framework-kie-server-services-drools</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.pymmasoftware.jbpm</groupId>
|
||||||
|
<artifactId>drools-framework-kie-server-rest-drools</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2017 Red Hat, Inc. and/or its affiliates.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.chtijbug.kieserver.springboot.autoconfiguration;
|
||||||
|
|
||||||
|
import org.kie.server.services.api.KieServerExtension;
|
||||||
|
import org.kie.server.services.drools.DroolsKieServerExtension;
|
||||||
|
import org.kie.server.services.impl.KieServerImpl;
|
||||||
|
import org.kie.server.springboot.autoconfiguration.KieServerProperties;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@ConditionalOnClass({KieServerImpl.class})
|
||||||
|
@EnableConfigurationProperties(KieServerProperties.class)
|
||||||
|
public class ChtijbugDroolsKieServerAutoConfiguration {
|
||||||
|
|
||||||
|
private KieServerProperties properties;
|
||||||
|
|
||||||
|
public ChtijbugDroolsKieServerAutoConfiguration(KieServerProperties properties) {
|
||||||
|
this.properties = properties;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
@ConditionalOnMissingBean(name = "droolsServerExtension")
|
||||||
|
@ConditionalOnProperty(name = "kieserver.pymmadrools.enabled")
|
||||||
|
public KieServerExtension droolsServerExtension() {
|
||||||
|
|
||||||
|
return new DroolsKieServerExtension();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
org.springframework.boot.autoconfigure.EnableAutoConfiguration=org.chtijbug.kieserver.springboot.autoconfiguration.ChtijbugDroolsKieServerAutoConfiguration
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
KIE Server with all capabilities
|
||||||
|
========================================
|
||||||
|
|
||||||
|
KIE Server SpringBoot sample application that uses Spring Security for securing access to KIE Server resources.
|
||||||
|
This is a complete (fully featured KIE Server - includes all capabilities) KIE Server that can be used to leverage
|
||||||
|
business process management, rules management and planning solutions in single runtime.
|
||||||
|
|
||||||
|
How to configure it
|
||||||
|
------------------------------
|
||||||
|
|
||||||
|
Complete configuration is via application.properties of the projects.
|
||||||
|
Users can decide which KIE Server extensions should be activated via following properties:
|
||||||
|
|
||||||
|
```
|
||||||
|
kieserver.drools.enabled=true
|
||||||
|
kieserver.dmn.enabled=true
|
||||||
|
kieserver.jbpm.enabled=true
|
||||||
|
kieserver.jbpmui.enabled=true
|
||||||
|
kieserver.casemgmt.enabled=true
|
||||||
|
kieserver.optaplanner.enabled=true
|
||||||
|
```
|
||||||
|
|
||||||
|
How to run it
|
||||||
|
------------------------------
|
||||||
|
|
||||||
|
You can run the application by simply starting
|
||||||
|
|
||||||
|
```
|
||||||
|
mvn clean spring-boot:run
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<artifactId>drools-framework-kie-server-parent</artifactId>
|
||||||
|
<groupId>com.pymmasoftware.jbpm</groupId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
<artifactId>drools-framework-kie-server-spring-boot</artifactId>
|
||||||
|
|
||||||
|
<name>KIE Server :: Spring :: Boot :: Sample</name>
|
||||||
|
<description>KIE Server SpringBoot Sample (includes all KIE Server capabilities)</description>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<start-class>org.chtijbug.kieserver.springboot.server.KieServerApplication</start-class>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.pymmasoftware.jbpm</groupId>
|
||||||
|
<artifactId>Chtijbug-kie-server-spring-boot-autoconfiguration-drools</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-security</artifactId>
|
||||||
|
<version>${spring.boot.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-beanutils</groupId>
|
||||||
|
<artifactId>commons-beanutils</artifactId>
|
||||||
|
<version>1.9.3</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
|
||||||
|
</project>
|
||||||
|
|
@ -0,0 +1,53 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2017 Red Hat, Inc. and/or its affiliates.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.chtijbug.kieserver.springboot.server;
|
||||||
|
|
||||||
|
import org.kie.server.services.api.KieServer;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.CommandLineRunner;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.jms.JmsAutoConfiguration;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
|
||||||
|
|
||||||
|
@SpringBootApplication(exclude = JmsAutoConfiguration.class)
|
||||||
|
|
||||||
|
public class KieServerApplication {
|
||||||
|
|
||||||
|
private static final Logger LOGGER = LoggerFactory.getLogger(KieServerApplication.class);
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(KieServerApplication.class, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
CommandLineRunner deployAndValidate() {
|
||||||
|
return new CommandLineRunner() {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private KieServer kieServer;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run(String... strings) throws Exception {
|
||||||
|
LOGGER.info("KieServer {} started", kieServer);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
#
|
||||||
|
# https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#common-application-properties
|
||||||
|
#
|
||||||
|
#server configuration
|
||||||
|
server.address=localhost
|
||||||
|
server.port=8090
|
||||||
|
#jbpm configuration
|
||||||
|
jbpm.executor.enabled=false
|
||||||
|
#jbpm.executor.retries=5
|
||||||
|
#jbpm.executor.interval=0
|
||||||
|
#jbpm.executor.threadPoolSize=1
|
||||||
|
#jbpm.executor.timeUnit=SECONDS
|
||||||
|
kieserver.restContextPath=/rest
|
||||||
|
kieserver.location=http://${server.address}:${server.port}${kieserver.restContextPath}/server
|
||||||
|
#kieserver.controllers=
|
||||||
|
org.kie.server.controller=http://localhost:8080/kie-wb/rest/controller
|
||||||
|
kieserver.drools.enabled=false
|
||||||
|
kieserver.dmn.enabled=false
|
||||||
|
kieserver.jbpm.enabled=false
|
||||||
|
kieserver.jbpmui.enabled=false
|
||||||
|
kieserver.casemgmt.enabled=false
|
||||||
|
kieserver.optaplanner.enabled=false
|
||||||
|
kieserver.pymmadrools.enabled=true
|
||||||
|
# only required for jBPM
|
||||||
|
#data source configuration
|
||||||
|
|
@ -15,6 +15,8 @@
|
||||||
<module>drools-framework-kie-server-rest-drools</module>
|
<module>drools-framework-kie-server-rest-drools</module>
|
||||||
<module>drools-framework-kie-server-client-connector</module>
|
<module>drools-framework-kie-server-client-connector</module>
|
||||||
<module>drools-framework-kie-server-extension-interface</module>
|
<module>drools-framework-kie-server-extension-interface</module>
|
||||||
|
<module>drools-framework-kie-server-spring-boot-autoconfiguration-drools</module>
|
||||||
|
<module>drools-framework-kie-server-spring-boot</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
@ -9,6 +9,6 @@
|
||||||
</content>
|
</content>
|
||||||
<orderEntry type="inheritedJdk" />
|
<orderEntry type="inheritedJdk" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
<orderEntry type="module" module-name="kie-server (1) (org.kie.server)" />
|
<orderEntry type="library" name="Maven: org.kie.server:kie-server:war:ee7:7.10.0.Final" level="project" />
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
||||||
50
pom.xml
50
pom.xml
|
|
@ -23,6 +23,8 @@
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<jbpm.version>7.10.0.Final</jbpm.version>
|
<jbpm.version>7.10.0.Final</jbpm.version>
|
||||||
|
<spring.boot.version>1.5.9.Release</spring.boot.version>
|
||||||
|
<spring.version>4.3.3.Release</spring.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
@ -228,6 +230,54 @@
|
||||||
<artifactId>javax.ws.rs-api</artifactId>
|
<artifactId>javax.ws.rs-api</artifactId>
|
||||||
<version>2.0</version>
|
<version>2.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot</artifactId>
|
||||||
|
<version>${spring.boot.version}</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<artifactId>commons-logging</artifactId>
|
||||||
|
<groupId>commons-logging</groupId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-autoconfigure</artifactId>
|
||||||
|
<version>${spring.boot.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.kie.server</groupId>
|
||||||
|
<artifactId>kie-server-api</artifactId>
|
||||||
|
<version>${jbpm.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.kie.server</groupId>
|
||||||
|
<artifactId>kie-server-services-common</artifactId>
|
||||||
|
<version>${jbpm.version}</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>aopalliance</groupId>
|
||||||
|
<artifactId>aopalliance</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jboss.spec.javax.ws.rs</groupId>
|
||||||
|
<artifactId>jboss-jaxrs-api_2.0_spec</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-context</artifactId>
|
||||||
|
<version>${spring.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.kie</groupId>
|
||||||
|
<artifactId>kie-server-spring-boot-autoconfiguration</artifactId>
|
||||||
|
<version>${jbpm.version}</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
editor.link_modal.header
Reference in a new issue