Claudio Paternesi
11/20/2024, 11:40 AMjdaugherty
11/20/2024, 12:14 PMjdaugherty
11/20/2024, 12:16 PMClaudio Paternesi
11/20/2024, 1:38 PMjdaugherty
11/20/2024, 2:20 PMClaudio Paternesi
11/20/2024, 2:31 PMjdaugherty
11/20/2024, 8:30 PMSteve Osguthorpe
11/22/2024, 10:08 AMRestController as you suggest, and use them in micronaut. So you have to use the spring flavour of annotation. It's been on my list of things to try for a while as it would allow us to share business logic between Grails/Spring and Micronaut.
https://micronaut-projects.github.io/micronaut-spring/latest/guide/#springMvc
Lists the "Compatible" annotations.Claudio Paternesi
11/22/2024, 10:13 AMSteve Osguthorpe
11/22/2024, 10:20 AMClaudio Paternesi
11/25/2024, 11:04 AMSteve Osguthorpe
11/25/2024, 11:35 AM@Autowired should work. Obviously your micronaut library must be compiled already and on the path, and you'll need the inject-java and maybe other dependencies in your spring boot app... I would do some investigation based on that guide.Claudio Paternesi
11/25/2024, 11:48 AMSteve Osguthorpe
11/25/2024, 11:49 AMSteve Osguthorpe
11/25/2024, 11:50 AM@Bean (Not the one from micronaut)
Then you can inject that bean in your micronaut app and you can also inject it in your spring app. I don't think you can have a full micronaut application that you can expose to spring. Just a shared library.Steve Osguthorpe
11/25/2024, 11:51 AMSteve Osguthorpe
11/25/2024, 11:52 AMClaudio Paternesi
11/25/2024, 12:10 PMSteve Osguthorpe
11/25/2024, 12:31 PMClaudio Paternesi
11/25/2024, 1:22 PMimplementation 'com......'Steve Osguthorpe
11/25/2024, 1:26 PMClaudio Paternesi
11/25/2024, 1:29 PMSteve Osguthorpe
11/25/2024, 1:31 PM@Autowired in your spring application after following following these docs?
https://micronaut-projects.github.io/micronaut-spring/latest/guide/#sharingLibrariesSteve Osguthorpe
11/25/2024, 1:32 PMClaudio Paternesi
11/25/2024, 1:34 PMimplementation platform("io.micronaut.platform:micronaut-platform:4.0.0")
annotationProcessor platform("io.micronaut.platform:micronaut-platform:4.0.0")
annotationProcessor("io.micronaut:micronaut-inject-java")
annotationProcessor("jakarta.annotation:jakarta.annotation-api:2.1.1")
implementation("jakarta.annotation:jakarta.annotation-api:2.1.1")
implementation("io.micronaut.spring:micronaut-spring-boot-starter")
I don't understand if all of these should go to the Grails projectClaudio Paternesi
11/25/2024, 1:35 PMSteve Osguthorpe
11/25/2024, 1:36 PMSteve Osguthorpe
11/25/2024, 1:36 PMClaudio Paternesi
11/25/2024, 1:37 PMSteve Osguthorpe
11/25/2024, 1:37 PMClaudio Paternesi
11/25/2024, 1:37 PMSteve Osguthorpe
11/25/2024, 1:38 PMClaudio Paternesi
11/25/2024, 1:38 PMSteve Osguthorpe
11/25/2024, 1:39 PMare you saying to import all those dependencies in the Grails projectFor grails No. If it was Spring(/Boot) then yes.
Steve Osguthorpe
11/25/2024, 1:39 PMAnd then in the Grails project use the AutowiredYes.
Claudio Paternesi
11/25/2024, 1:40 PMClaudio Paternesi
11/25/2024, 1:40 PMSteve Osguthorpe
11/25/2024, 1:42 PMSteve Osguthorpe
11/25/2024, 1:43 PMClaudio Paternesi
11/25/2024, 1:44 PMSteve Osguthorpe
11/25/2024, 1:45 PMjdaugherty
11/25/2024, 1:46 PMSteve Osguthorpe
11/25/2024, 1:46 PMClaudio Paternesi
11/25/2024, 1:49 PMSteve Osguthorpe
11/25/2024, 1:51 PMclass SomeService {
@Autowired
TheTypeFromTheLibrary theTypeFromTheLibrary
}
and not
class SomeService {
@Autowired
def theTypeFromTheLibrary
}Claudio Paternesi
11/25/2024, 1:51 PMSteve Osguthorpe
11/25/2024, 1:54 PM