xmolecules / jmolecules-examples Goto Github PK
View Code? Open in Web Editor NEWExample projects for jMolecules
License: Apache License 2.0
Example projects for jMolecules
License: Apache License 2.0
Just want using gradle kotlin to run the example but not working
error logs
2022-07-16 23:05:52.505 INFO 10203 --- [ main] com.snacks.ApplicationKt : Started ApplicationKt in 2.37 seconds (JVM running for 2.533)
Exception in thread "main" org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.snacks.OrderRepository' available
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:351)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:342)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1172)
at com.snacks.ApplicationKt.main(Application.kt:17)
build.gradle.kts configs below
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
buildscript {
dependencies {
classpath(platform("org.jmolecules:jmolecules-bom:2022.2.0"))
classpath("org.jmolecules.integrations:jmolecules-bytebuddy")
classpath("org.jmolecules.integrations:jmolecules-spring")
classpath("org.jmolecules.integrations:jmolecules-jpa")
}
}
plugins {
id("org.springframework.boot") version "2.7.0"
id("io.spring.dependency-management") version "1.0.11.RELEASE"
kotlin("jvm") version "1.6.21"
id("org.jetbrains.kotlinx.kover") version "0.5.1"
kotlin("plugin.spring") version "1.6.21"
kotlin("plugin.jpa") version "1.6.21"
id("net.bytebuddy.byte-buddy-gradle-plugin") version "1.12.12"
idea
}
group = "com.example"
version = "0.0.1-SNAPSHOT"
java.sourceCompatibility = JavaVersion.VERSION_17
repositories {
mavenCentral()
}
dependencies {
implementation(platform("org.jmolecules:jmolecules-bom:2022.2.0"))
implementation("net.bytebuddy:byte-buddy-gradle-plugin:1.12.10")
implementation("org.jmolecules.integrations:jmolecules-bytebuddy")
implementation("org.jmolecules.integrations:jmolecules-spring")
implementation("org.jmolecules.integrations:jmolecules-jpa")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("org.springframework.session:spring-session-jdbc")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.jmolecules:kmolecules-ddd")
implementation("org.springdoc:springdoc-openapi-ui:1.6.9")
implementation("org.springdoc:springdoc-openapi-kotlin:1.6.9")
implementation("com.vladmihalcea:hibernate-types-55:2.16.2")
implementation("org.projectlombok:lombok")
runtimeOnly("mysql:mysql-connector-java:8.0.29")
implementation("com.h2database:h2:2.1.212")
testImplementation("org.mockito.kotlin:mockito-kotlin:4.0.0")
testImplementation("org.springframework.boot:spring-boot-starter-test")
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "17"
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
tasks {
byteBuddy {
transformation {
plugin = org.jmolecules.bytebuddy.JMoleculesPlugin::class.java
}
}
compileKotlin {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "17"
}
}
test {
extensions.configure(kotlinx.kover.api.KoverTaskExtension::class) {
isEnabled = true
binaryReportFile.set(file("$buildDir/kover/test.exec"))
}
useJUnitPlatform()
// testLogging {
// events("passed", "skipped", "failed")
// }
finalizedBy(koverHtmlReport)
}
koverHtmlReport {
isEnabled = true
htmlReportDir.set(layout.buildDirectory.dir("reports/kover/html"))
}
}
kotlin application
@SpringBootApplication
open class Application
fun main(args: Array<String>) {
val context = runApplication<Application>(*args)
val repository = context.getBean(OrderRepository::class.java)
val order = repository.save(Order())
}
@Table(name = "KotlinOrder")
open class Order : AggregateRoot<Order, Order.OrderIdentifier> {
override val id = OrderIdentifier(UUID.randomUUID())
data class OrderIdentifier(val id: UUID) : Identifier
}
interface OrderRepository : CrudRepository<Order, Order.OrderIdentifier>
The links to the limited external examples are broken: 404.
Will this repo contain example applications or a collection of links to example applications?
If the latter, it'd be awesome to include: lnurl-auth-example-application
https://github.com/theborakompanioni/bitcoin-spring-boot-starter/tree/master/examples/incubator/lnurl-auth-example-application
I am still learning about ddd, so maybe the code is not exemplary/best practice.
Thank you. Have a nice day.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.