From dbafed80b8c2ab3158807e11d185d82e0aa5bd15 Mon Sep 17 00:00:00 2001 From: Thomas Turrell-Croft Date: Mon, 24 Apr 2023 15:51:54 +0100 Subject: [PATCH 1/5] tidy dependancies --- samples/xapi-server/pom.xml | 17 ++--------------- xapi-model-spring-boot-autoconfigure/pom.xml | 8 ++++++-- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/samples/xapi-server/pom.xml b/samples/xapi-server/pom.xml index 62941fa9..21d7097c 100644 --- a/samples/xapi-server/pom.xml +++ b/samples/xapi-server/pom.xml @@ -11,26 +11,13 @@ Basic xAPI Statement Resource implementation - org.springframework.boot - spring-boot-starter-web - - - - org.springframework.boot - spring-boot-starter-validation + dev.learning.xapi + xapi-model-spring-boot-autoconfigure org.springframework.boot spring-boot-starter-data-jpa - - dev.learning.xapi - xapi-model - - - dev.learning.xapi - xapi-model-spring-boot-autoconfigure - com.h2database h2 diff --git a/xapi-model-spring-boot-autoconfigure/pom.xml b/xapi-model-spring-boot-autoconfigure/pom.xml index 17acb448..7ca7490d 100644 --- a/xapi-model-spring-boot-autoconfigure/pom.xml +++ b/xapi-model-spring-boot-autoconfigure/pom.xml @@ -12,8 +12,12 @@ - org.springframework - spring-web + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-validation org.springframework.boot From 372e5c10bf59344c6694a08a4151d32f2bd3aec5 Mon Sep 17 00:00:00 2001 From: Thomas Turrell-Croft Date: Mon, 24 Apr 2023 15:57:28 +0100 Subject: [PATCH 2/5] tip --- pom.xml | 4 ++-- samples/xapi-server/pom.xml | 2 +- .../pom.xml | 6 +++--- .../java/dev/learning/xapi/XapiModelAutoConfiguration.java | 0 ...ngframework.boot.autoconfigure.AutoConfiguration.imports | 0 5 files changed, 6 insertions(+), 6 deletions(-) rename {xapi-model-spring-boot-autoconfigure => xapi-model-spring-boot-starter}/pom.xml (87%) rename {xapi-model-spring-boot-autoconfigure => xapi-model-spring-boot-starter}/src/main/java/dev/learning/xapi/XapiModelAutoConfiguration.java (100%) rename {xapi-model-spring-boot-autoconfigure => xapi-model-spring-boot-starter}/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports (100%) diff --git a/pom.xml b/pom.xml index 07918958..257b88ab 100644 --- a/pom.xml +++ b/pom.xml @@ -81,7 +81,7 @@ xapi-model xapi-client samples - xapi-model-spring-boot-autoconfigure + xapi-model-spring-boot-starter @@ -266,7 +266,7 @@ dev.learning.xapi - xapi-model-spring-boot-autoconfigure + xapi-model-spring-boot-starter 1.1.5-SNAPSHOT diff --git a/samples/xapi-server/pom.xml b/samples/xapi-server/pom.xml index 21d7097c..b2b87972 100644 --- a/samples/xapi-server/pom.xml +++ b/samples/xapi-server/pom.xml @@ -12,7 +12,7 @@ dev.learning.xapi - xapi-model-spring-boot-autoconfigure + xapi-model-spring-boot-starter org.springframework.boot diff --git a/xapi-model-spring-boot-autoconfigure/pom.xml b/xapi-model-spring-boot-starter/pom.xml similarity index 87% rename from xapi-model-spring-boot-autoconfigure/pom.xml rename to xapi-model-spring-boot-starter/pom.xml index 7ca7490d..a1080a81 100644 --- a/xapi-model-spring-boot-autoconfigure/pom.xml +++ b/xapi-model-spring-boot-starter/pom.xml @@ -6,9 +6,9 @@ xapi-build 1.1.5-SNAPSHOT - xapi-model-spring-boot-autoconfigure - xAPI Spring Boot Autoconfigure - learning.dev Spring Boot Autoconfigure + xapi-model-spring-boot-starter + xAPI Spring Boot Starter + learning.dev Spring Boot Starter diff --git a/xapi-model-spring-boot-autoconfigure/src/main/java/dev/learning/xapi/XapiModelAutoConfiguration.java b/xapi-model-spring-boot-starter/src/main/java/dev/learning/xapi/XapiModelAutoConfiguration.java similarity index 100% rename from xapi-model-spring-boot-autoconfigure/src/main/java/dev/learning/xapi/XapiModelAutoConfiguration.java rename to xapi-model-spring-boot-starter/src/main/java/dev/learning/xapi/XapiModelAutoConfiguration.java diff --git a/xapi-model-spring-boot-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/xapi-model-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports similarity index 100% rename from xapi-model-spring-boot-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports rename to xapi-model-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports From 38c0b8e762db74dd76369e6738a9f26d4ebaefcb Mon Sep 17 00:00:00 2001 From: Thomas Turrell-Croft Date: Mon, 24 Apr 2023 15:59:56 +0100 Subject: [PATCH 3/5] tip --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c55dfc32..42aac33a 100644 --- a/README.md +++ b/README.md @@ -286,29 +286,29 @@ client.deleteState(r -> r.activityId("https://example.com/activity/1") The samples folder in this repository contains [sample applications](samples) that use the xAPI client. -## xAPI Model Spring Boot Autoconfigure +## xAPI Model Spring Boot Starter The xAPI specification has strict rules for API requests/responses formatting. The xAPI Model has inbuilt validation for all of these rules. However, if you plan to use the xAPI Model, you should keep in mind that some activity providers do not fully conform to these rules. In some cases it may be desirable to turn off some or all of the rules in order to be compatible with a wider range of xAPI activity providers. However, it should be noted that doing this is in violation of the xAPI specification. -The xAPI Model Spring Boot Autoconfigure package provides an easy way to turn on/off these validation rules. +The xAPI Model Spring Boot Starter package provides an easy way to turn on/off these validation rules. ### Getting started -To use the xAPI Model Spring Boot Autoconfigure include the appropriate XML in the `dependencies` section of your `pom.xml`, as shown in the following example: +To use the xAPI Model Spring Boot Starter include the appropriate XML in the `dependencies` section of your `pom.xml`, as shown in the following example: ``` dev.learning.xapi - xapi-model-spring-boot-autoconfigure + xapi-model-spring-boot-starter 1.1.5 ``` ### Configuration -The xAPI Model Spring Boot Autoconfigure has a Spring AutoConfiguration bean which picks up the following properties: +The xAPI Model Spring Boot Starter has a Spring AutoConfiguration bean which picks up the following properties: | Property | Description | | ----------------------------------------- | -------------------------------------------------------------------------- | From a77fdae7f7e3bd2ffd1358b1cfba2e67cf90d331 Mon Sep 17 00:00:00 2001 From: Thomas Turrell-Croft Date: Mon, 24 Apr 2023 16:05:04 +0100 Subject: [PATCH 4/5] move package --- .../{ => autoconfigure/model}/XapiModelAutoConfiguration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename xapi-model-spring-boot-starter/src/main/java/dev/learning/xapi/{ => autoconfigure/model}/XapiModelAutoConfiguration.java (99%) diff --git a/xapi-model-spring-boot-starter/src/main/java/dev/learning/xapi/XapiModelAutoConfiguration.java b/xapi-model-spring-boot-starter/src/main/java/dev/learning/xapi/autoconfigure/model/XapiModelAutoConfiguration.java similarity index 99% rename from xapi-model-spring-boot-starter/src/main/java/dev/learning/xapi/XapiModelAutoConfiguration.java rename to xapi-model-spring-boot-starter/src/main/java/dev/learning/xapi/autoconfigure/model/XapiModelAutoConfiguration.java index 5b2fd924..7b3e5bdc 100644 --- a/xapi-model-spring-boot-starter/src/main/java/dev/learning/xapi/XapiModelAutoConfiguration.java +++ b/xapi-model-spring-boot-starter/src/main/java/dev/learning/xapi/autoconfigure/model/XapiModelAutoConfiguration.java @@ -2,7 +2,7 @@ * Copyright 2016-2023 Berry Cloud Ltd. All rights reserved. */ -package dev.learning.xapi; +package dev.learning.xapi.autoconfigure.model; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.cfg.CoercionAction; From 31a8adae642a862808556de182c6314815e47d16 Mon Sep 17 00:00:00 2001 From: Thomas Turrell-Croft Date: Mon, 24 Apr 2023 16:12:56 +0100 Subject: [PATCH 5/5] tip --- ...springframework.boot.autoconfigure.AutoConfiguration.imports | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xapi-model-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/xapi-model-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 5c3edec2..5bb0e7e1 100644 --- a/xapi-model-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/xapi-model-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -1 +1 @@ -dev.learning.xapi.XapiModelAutoConfiguration +dev.learning.xapi.autoconfigure.model.XapiModelAutoConfiguration