From 3e98642356ad9310cee56cc5f871492abfa0ecea Mon Sep 17 00:00:00 2001 From: mohamed-ennahdi Date: Sun, 3 Nov 2024 13:49:48 +0000 Subject: [PATCH] Discrepancy resolution + POM version property (#10) --- objectmorph-app/pom.xml | 4 +-- .../app/logic/ObjectmorphComponent.java | 20 ++++++++++++++ .../app/logic/ObjectmorphSingleton.java | 22 ---------------- .../app/service/ObjectmorphService.java | 7 +++-- objectmorph-logic/pom.xml | 2 +- objectmorph-renderer/pom.xml | 4 +-- pom.xml | 3 ++- release.properties | 26 ------------------- 8 files changed, 30 insertions(+), 58 deletions(-) create mode 100644 objectmorph-app/src/main/java/com/github/mohamedennahdi/objectmorph/app/logic/ObjectmorphComponent.java delete mode 100644 objectmorph-app/src/main/java/com/github/mohamedennahdi/objectmorph/app/logic/ObjectmorphSingleton.java delete mode 100644 release.properties diff --git a/objectmorph-app/pom.xml b/objectmorph-app/pom.xml index bbdc8bc..578c116 100644 --- a/objectmorph-app/pom.xml +++ b/objectmorph-app/pom.xml @@ -3,7 +3,7 @@ com.github.mohamed-ennahdi objectmorph - 0.0.3-SNAPSHOT + ${objectmorph.parent.version} objectmorph-app @@ -26,7 +26,7 @@ com.github.mohamed-ennahdi objectmorph-renderer - 0.0.1 + ${objectmorph.parent.version} org.springdoc diff --git a/objectmorph-app/src/main/java/com/github/mohamedennahdi/objectmorph/app/logic/ObjectmorphComponent.java b/objectmorph-app/src/main/java/com/github/mohamedennahdi/objectmorph/app/logic/ObjectmorphComponent.java new file mode 100644 index 0000000..2197f26 --- /dev/null +++ b/objectmorph-app/src/main/java/com/github/mohamedennahdi/objectmorph/app/logic/ObjectmorphComponent.java @@ -0,0 +1,20 @@ +package com.github.mohamedennahdi.objectmorph.app.logic; + +import java.io.File; + +import org.springframework.stereotype.Component; + +import com.github.mohamedennahdi.objectmorph.renderer.HTMLGenerator; + +@Component +public class ObjectmorphComponent { + + HTMLGenerator htmlGenerator; + + private ObjectmorphComponent() {} + + public HTMLGenerator getHtmlGenerator(File... files) { + htmlGenerator = new HTMLGenerator(files); + return htmlGenerator; + } +} diff --git a/objectmorph-app/src/main/java/com/github/mohamedennahdi/objectmorph/app/logic/ObjectmorphSingleton.java b/objectmorph-app/src/main/java/com/github/mohamedennahdi/objectmorph/app/logic/ObjectmorphSingleton.java deleted file mode 100644 index 8a442ad..0000000 --- a/objectmorph-app/src/main/java/com/github/mohamedennahdi/objectmorph/app/logic/ObjectmorphSingleton.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.github.mohamedennahdi.objectmorph.app.logic; - -import java.io.File; - -import org.springframework.stereotype.Component; - -import com.github.mohamedennahdi.objectmorph.renderer.HTMLGenerator; - -@Component -public class ObjectmorphSingleton { - - static HTMLGenerator INSTANCE; - - private ObjectmorphSingleton() {} - - public static HTMLGenerator getHtmlGenerator(File... files) { - if (INSTANCE == null) { - INSTANCE = new HTMLGenerator(files); - } - return INSTANCE; - } -} diff --git a/objectmorph-app/src/main/java/com/github/mohamedennahdi/objectmorph/app/service/ObjectmorphService.java b/objectmorph-app/src/main/java/com/github/mohamedennahdi/objectmorph/app/service/ObjectmorphService.java index 52a7548..91f4ed6 100644 --- a/objectmorph-app/src/main/java/com/github/mohamedennahdi/objectmorph/app/service/ObjectmorphService.java +++ b/objectmorph-app/src/main/java/com/github/mohamedennahdi/objectmorph/app/service/ObjectmorphService.java @@ -1,7 +1,6 @@ package com.github.mohamedennahdi.objectmorph.app.service; import java.io.File; -import java.io.FileNotFoundException; import java.io.IOException; import java.net.URISyntaxException; import java.nio.charset.StandardCharsets; @@ -15,16 +14,16 @@ import org.apache.commons.io.FileUtils; import org.springframework.stereotype.Service; -import com.github.mohamedennahdi.objectmorph.app.logic.ObjectmorphSingleton; +import com.github.mohamedennahdi.objectmorph.app.logic.ObjectmorphComponent; import lombok.extern.slf4j.Slf4j; @Slf4j @Service public class ObjectmorphService { - ObjectmorphSingleton objectmorphLogic; + ObjectmorphComponent objectmorphLogic; - public ObjectmorphService(ObjectmorphSingleton objectmorphLogic) { + public ObjectmorphService(ObjectmorphComponent objectmorphLogic) { this.objectmorphLogic = objectmorphLogic; } diff --git a/objectmorph-logic/pom.xml b/objectmorph-logic/pom.xml index bcea87b..4d5ee87 100644 --- a/objectmorph-logic/pom.xml +++ b/objectmorph-logic/pom.xml @@ -3,7 +3,7 @@ com.github.mohamed-ennahdi objectmorph - 0.0.3-SNAPSHOT + ${objectmorph.parent.version} objectmorph-logic diff --git a/objectmorph-renderer/pom.xml b/objectmorph-renderer/pom.xml index 35c47f2..941f596 100644 --- a/objectmorph-renderer/pom.xml +++ b/objectmorph-renderer/pom.xml @@ -3,7 +3,7 @@ com.github.mohamed-ennahdi objectmorph - 0.0.3-SNAPSHOT + ${objectmorph.parent.version} objectmorph-renderer @@ -15,7 +15,7 @@ com.github.mohamed-ennahdi objectmorph-logic - 0.0.1 + ${objectmorph.parent.version} com.j2html diff --git a/pom.xml b/pom.xml index 6f4350f..fd7990a 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.github.mohamed-ennahdi objectmorph - 0.0.3-SNAPSHOT + ${objectmorph.parent.version} pom objectmorph-app @@ -11,6 +11,7 @@ UTF-8 + 0.0.3-SNAPSHOT scm:git:https://github.com/mohamed-ennahdi/objectmorph.git diff --git a/release.properties b/release.properties deleted file mode 100644 index 1303063..0000000 --- a/release.properties +++ /dev/null @@ -1,26 +0,0 @@ -#release configuration -#Wed Oct 30 19:34:33 UTC 2024 -completedPhase=scm-check-modifications -exec.pomFileName=pom.xml -exec.snapshotReleasePluginAllowed=false -pinExternals=false -preparationGoals=clean verify -project.scm.com.github.mohamed-ennahdi\:objectmorph-app.empty=true -project.scm.com.github.mohamed-ennahdi\:objectmorph-logic.empty=true -project.scm.com.github.mohamed-ennahdi\:objectmorph-renderer.empty=true -project.scm.com.github.mohamed-ennahdi\:objectmorph.connection=scm\:git\:https\://github.com/mohamed-ennahdi/objectmorph.git -project.scm.com.github.mohamed-ennahdi\:objectmorph.developerConnection=scm\:git\:https\://github.com/mohamed-ennahdi/objectmorph.git -project.scm.com.github.mohamed-ennahdi\:objectmorph.tag=HEAD -project.scm.com.github.mohamed-ennahdi\:objectmorph.url=https\://github.com/mohamed-ennahdi/objectmorph -projectVersionPolicyConfig=${projectVersionPolicyConfig}\n -projectVersionPolicyId=default -pushChanges=true -releaseStrategyId=default -remoteTagging=true -scm.branchCommitComment=@{prefix} prepare branch @{releaseLabel} -scm.commentPrefix=[maven-release-plugin] -scm.developmentCommitComment=@{prefix} prepare for next development iteration -scm.releaseCommitComment=@{prefix} prepare release @{releaseLabel} -scm.rollbackCommitComment=@{prefix} rollback the release of @{releaseLabel} -scm.tagNameFormat=@{project.artifactId}-@{project.version} -scm.url=scm\:git\:https\://github.com/mohamed-ennahdi/objectmorph.git