Skip to content

Commit

Permalink
Fixed gradle scripts.
Browse files Browse the repository at this point in the history
Fixed dependencies.
Removed extra libraries from versions catalog.
Upgrade libs.
  • Loading branch information
altro3 committed Jan 30, 2024
1 parent 024966a commit e910ed1
Show file tree
Hide file tree
Showing 14 changed files with 54 additions and 54 deletions.
12 changes: 3 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
projectVersion=5.5.0-SNAPSHOT
projectGroup=io.micronaut.spring

micronautDocsVersion=2.0.0
micronautVersion=4.0.0-SNAPSHOT
micronautTestVersion=4.0.0-SNAPSHOT
groovyVersion=4.0.6
spockVersion=2.3-groovy-4.0

title=Micronaut for Spring
projectDesc=Extensions to integrate Micronaut and Spring
projectUrl=https://micronaut.io
githubSlug=micronaut-projects/micronaut-spring
developers=Graeme Rocher

springbootapi=https://docs.spring.io/spring-boot/docs/current/api
springdataapi=https://docs.spring.io/spring-data/data-commons/docs/current/api/
micronautcache=https://micronaut-projects.github.io/micronaut-cache/latest/api/io/micronaut/cache/
springdataapi=https://docs.spring.io/spring-data/data-commons/docs/current/api
micronautcache=https://micronaut-projects.github.io/micronaut-cache/latest/api
micronautspringapi=https://micronaut-projects.github.io/micronaut-spring/latest/api
micronautdataapi=https://micronaut-projects.github.io/micronaut-data/latest/api/io/micronaut/
micronautdataapi=https://micronaut-projects.github.io/micronaut-data/latest/api
29 changes: 10 additions & 19 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,29 @@
managed-spring-boot = "3.2.2"
managed-spring = "6.1.3"

junit = "5.9.1"
servlet-api = "6.0.0"
micronaut = "4.3.1"
micronaut-docs = "2.0.0"
micronaut-test = "4.0.0"
groovy = "4.0.15"
spock = "2.3-groovy-4.0"
groovy = "4.0.17"
h2 = '2.2.224'
jakarta-annotation = '2.1.1'

micronaut = "4.3.1"
micronaut-docs = "2.0.0"
micronaut-test = "4.2.0"
micronaut-cache = "4.2.1"
micronaut-views = "5.1.0"
micronaut-validation = "4.3.0"
micronaut-servlet = "4.5.0"

[libraries]
# Core
# Micronaut
micronaut-core = { module = 'io.micronaut:micronaut-core-bom', version.ref = 'micronaut' }
micronaut-cache = { module = "io.micronaut.cache:micronaut-cache-bom", version.ref = "micronaut-cache" }
micronaut-views = { module = "io.micronaut.views:micronaut-views-bom", version.ref = "micronaut-views" }
micronaut-validation = { module = "io.micronaut.validation:micronaut-validation-bom", version.ref = "micronaut-validation" }
micronaut-servlet = { module = "io.micronaut.servlet:micronaut-servlet-bom", version.ref = "micronaut-servlet" }

managed-spring-boot = { module = 'org.springframework.boot:spring-boot', version.ref = 'managed-spring-boot' }
managed-spring-boot-starter = { module = 'org.springframework.boot:spring-boot-starter', version.ref = 'managed-spring-boot' }
managed-spring-boot-starter-web = { module = 'org.springframework.boot:spring-boot-starter-web', version.ref = 'managed-spring-boot' }


micronaut-cache = { module = "io.micronaut.cache:micronaut-cache-bom", version.ref = "micronaut-cache" }
micronaut-views = { module = "io.micronaut.views:micronaut-views-bom", version.ref = "micronaut-views" }
micronaut-validation = { module = "io.micronaut.validation:micronaut-validation-bom", version.ref = "micronaut-validation" }

managed-spring = { module = 'org.springframework:spring-core', version.ref = 'managed-spring' }
managed-spring-context = { module = 'org.springframework:spring-context', version.ref = 'managed-spring' }
managed-spring-tx = { module = 'org.springframework:spring-tx', version.ref = 'managed-spring' }
Expand All @@ -44,11 +40,6 @@ spring-boot-starter-thymeleaf = { module = 'org.springframework.boot:spring-boot
spring-boot-starter-tomcat = { module = 'org.springframework.boot:spring-boot-starter-tomcat', version.ref = 'managed-spring-boot' }
spring-boot-test = { module = 'org.springframework.boot:spring-boot-starter-test', version.ref = 'managed-spring-boot' }

junit-jupiter-api = { module = 'org.junit.jupiter:junit-jupiter-api' }
junit-jupiter-engine = { module = 'org.junit.jupiter:junit-jupiter-engine' }

servlet-api = { module = 'jakarta.servlet:jakarta.servlet-api', version.ref = 'servlet-api' }
jakarta-annotation = { module = 'jakarta.annotation:jakarta.annotation-api', version.ref = 'jakarta-annotation' }
spring-test = { module = 'org.springframework:spring-test', version.ref = 'managed-spring' }

spock-spring = { module = 'org.spockframework:spock-spring' }
Expand Down
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ micronautBuild {
importMicronautCatalog("micronaut-cache")
importMicronautCatalog("micronaut-views")
importMicronautCatalog("micronaut-validation")
importMicronautCatalog("micronaut-servlet")
}
10 changes: 5 additions & 5 deletions spring-annotation/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ dependencies {
api mn.micronaut.inject
api mn.micronaut.aop
api mnValidation.micronaut.validation
implementation mnValidation.micronaut.validation.processor

implementation mnValidation.micronaut.validation.processor
implementation mn.micronaut.core.processor
implementation projects.micronautSpring
implementation projects.micronautSpringContext

implementation mn.micronaut.runtime
implementation(mnCache.micronaut.cache.core)
implementation mnCache.micronaut.cache.core

testAnnotationProcessor mn.micronaut.inject.java

testImplementation mn.micronaut.inject.groovy
testImplementation projects.micronautSpring
testImplementation libs.managed.spring.tx
}

compileTestGroovy.options.forkOptions.jvmArgs =['-Xdebug', '-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005']
compileTestGroovy.options.fork=true
//compileTestGroovy.options.forkOptions.jvmArgs = ['-Xdebug', '-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005']
//compileTestGroovy.options.fork = true
7 changes: 5 additions & 2 deletions spring-boot-annotation/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ plugins {
}

dependencies {
implementation projects.micronautSpringAnnotation

api mn.micronaut.core.processor
api mn.micronaut.inject
api mn.micronaut.context
api(mn.micronaut.http)
api mn.micronaut.http

implementation projects.micronautSpringAnnotation

testAnnotationProcessor mn.micronaut.inject.java

testImplementation projects.micronautSpringBoot
testImplementation libs.managed.spring.boot
testImplementation libs.spring.boot.autoconfigure
Expand Down
7 changes: 5 additions & 2 deletions spring-boot-starter/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,23 @@ plugins {
}

dependencies {

api mn.micronaut.aop
api mn.micronaut.inject
api mn.micronaut.context
api libs.managed.spring.boot

implementation libs.spring.boot.autoconfigure
implementation libs.jakarta.annotation
implementation mn.jakarta.annotation.api

testAnnotationProcessor mn.micronaut.inject.java

testCompileOnly mnServlet.servlet.api

testImplementation mn.micronaut.http
testImplementation libs.spring.boot.autoconfigure
testImplementation libs.spring.boot.actuator
testImplementation libs.spring.boot.test
testImplementation libs.servlet.api
testImplementation libs.h2database
testImplementation libs.managed.spring.jdbc

Expand Down
6 changes: 5 additions & 1 deletion spring-boot/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,26 @@ plugins {
}

dependencies {

api(projects.micronautSpringContext)
api(libs.managed.spring.boot)

compileOnly(libs.spring.boot.autoconfigure)

testAnnotationProcessor(mn.micronaut.inject.java)
testAnnotationProcessor(projects.micronautSpringBootAnnotation)
testAnnotationProcessor(projects.micronautSpringWebAnnotation)

testCompileOnly(mnServlet.servlet.api)

testImplementation(projects.micronautSpringWeb)
testImplementation(mn.micronaut.management)
testImplementation(mn.micronaut.http.client)
testImplementation(mn.micronaut.http.server.netty)
testImplementation(libs.spring.boot.autoconfigure)
testImplementation(libs.spring.boot.actuator)
testImplementation(libs.servlet.api)
testImplementation(mn.micronaut.jackson.databind)

testRuntimeOnly(libs.managed.spring.boot.starter.web)
testRuntimeOnly(libs.spring.boot.starter.tomcat)
testRuntimeOnly(mn.jakarta.annotation.api)
Expand Down
6 changes: 3 additions & 3 deletions spring-context/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ dependencies {
api mn.micronaut.aop
api mn.micronaut.inject
api projects.micronautSpring

implementation(mnCache.micronaut.cache.core)

testAnnotationProcessor mn.micronaut.inject.java
testAnnotationProcessor projects.micronautSpringAnnotation

testImplementation mn.micronaut.jackson.databind
testImplementation mn.micronaut.runtime
testImplementation mn.micronaut.inject.java
testImplementation projects.micronautSpringAnnotation
testImplementation mn.micronaut.inject.java.test
testImplementation("org.springframework:spring-jdbc:6.1.3") {
because 'not defined in toml because it hit a bug with version catalogs'
}
testImplementation libs.managed.spring.jdbc
testImplementation libs.h2database
}
1 change: 0 additions & 1 deletion spring-web/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ dependencies {
testImplementation mn.micronaut.http.server.netty

testRuntimeOnly(mnViews.micronaut.views.thymeleaf)

testRuntimeOnly libs.spring.boot.starter.thymeleaf
}

Expand Down
11 changes: 8 additions & 3 deletions spring/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@ plugins {
id("io.micronaut.build.internal.spring-module")
}
dependencies {

compileOnly(libs.managed.spring.jdbc)
compileOnly(mnTest.micronaut.test.core)

api(libs.managed.spring)
api(libs.managed.spring.tx)
api(libs.managed.spring.context)
implementation(mn.micronaut.core.processor)
api(mn.micronaut.inject)
api(mn.micronaut.aop)
compileOnly(libs.managed.spring.jdbc)
compileOnly(mnTest.micronaut.test.core)

implementation(mn.micronaut.core.processor)

testAnnotationProcessor(mn.micronaut.inject.java)

testCompileOnly(mn.micronaut.inject.groovy)

testImplementation(libs.spock.spring)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,8 @@ private <T extends Map<String, Object>> Object convertValue(Function<MergedAnnot
AnnotationValue<?> av = (AnnotationValue<?>) value;
if (adapts.contains(Adapt.ANNOTATION_TO_MAP)) {
value = asMap(factory, av, adaptations);
} else {
// TODO: synthesize annotation from value?
}
// TODO: else synthesize annotation from value?
}
return value;
}
Expand Down
4 changes: 2 additions & 2 deletions test-suite/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ plugins {
dependencies {
testAnnotationProcessor(projects.micronautSpringAnnotation)
testAnnotationProcessor(mn.micronaut.inject.java)

testCompileOnly(mn.micronaut.inject.groovy)

testImplementation(projects.micronautSpring)
testImplementation(mnTest.micronaut.test.spock)
testImplementation(libs.junit.jupiter.api)
testRuntimeOnly(libs.junit.jupiter.engine)
}

tasks.withType<Test> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
*/
package io.micronaut.spring.tx;

import org.junit.jupiter.api.Assertions;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.interceptor.TransactionAspectSupport;


@MetaAnnotation
public class MetaTransactionalBean {

public String doSomething() {
// should not throw
final TransactionStatus transactionStatus = TransactionAspectSupport.currentTransactionStatus();
Assertions.assertNotNull(transactionStatus);
if (transactionStatus == null) {
throw new IllegalStateException("transactionStatus can't be null");
}
return "foo";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
package io.micronaut.spring.tx;

import jakarta.inject.Singleton;
import org.junit.jupiter.api.Assertions;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
Expand All @@ -28,7 +27,9 @@ public class TransactionalBean {
public String doSomething() {
// should not throw
final TransactionStatus transactionStatus = TransactionAspectSupport.currentTransactionStatus();
Assertions.assertNotNull(transactionStatus);
if (transactionStatus == null) {
throw new IllegalStateException("transactionStatus can't be null");
}
return "foo";
}
}

0 comments on commit e910ed1

Please sign in to comment.