如何从Kotlin AllOpen插件中排除注释?

如何从Kotlin AllOpen插件中排除注释?,kotlin,axon,kotlin-maven-plugin,Kotlin,Axon,Kotlin Maven Plugin,我正在使用Axon框架,在这里我可以用@Aggregate注释我的域类(它是用Spring中的@Component进行元注释的)。然后,我必须为我拥有的每个私有方法/字段道歉,明确地将它们标记为final 我认为在我的例子中,我很擅长将类标记为打开,因此我想手动执行,同时将@Aggregate从spring插件中排除,但我找不到这样做的方法。解决方法 据介绍,spring插件在支持元注释的同时,通过只列出spring注释,在引擎盖下使用了all-open。所以,我们确实这样做了,但我们没有指定l

我正在使用Axon框架,在这里我可以用
@Aggregate
注释我的类(它是用Spring中的@Component进行元注释的)。然后,我必须为我拥有的每个私有方法/字段道歉,明确地将它们标记为
final

我认为在我的例子中,我很擅长将类标记为打开,因此我想手动执行,同时将
@Aggregate
spring
插件中排除,但我找不到这样做的方法。

解决方法 据介绍,
spring
插件在支持元注释的同时,通过只列出spring注释,在引擎盖下使用了
all-open
。所以,我们确实这样做了,但我们没有指定list
@组件
,所以在我们的代码中,我们必须使用原型(存储库、服务等)。这样它就不会拾取
@聚合


org.jetbrains.kotlin
kotlin maven插件
${kotlin.version}
全部开放
全部打开:annotation=org.springframework.stereotype.Service
全部打开:annotation=org.springframework.stereotype.Controller
全部打开:annotation=org.springframework.data.repository.repository
全部打开:annotation=org.springframework.context.annotation.Configuration
全部打开:annotation=org.springframework.boot.test.context.SpringBootTest
全部打开:annotation=org.springframework.cache.annotation.Cacheable
全部打开:annotation=org.springframework.transaction.annotation.Transactional
全部打开:annotation=org.springframework.scheduling.annotation.Async
org.jetbrains.kotlin
科特林·马文·阿洛彭
${kotlin.version}