linpeilie / mapstruct-plus

MapStruct Plus is an enhancement to the MapStruct framework. It can automatically generate the transformation operation between two classes through an annotation, omitting the operation of defining the interface of MapStruct, makes Java type conversion easy and elegant.
https://mapstruct.plus/
Apache License 2.0
263 stars 20 forks source link

MapperConfig无法在公共jar包中使用? #103

Open tfnick opened 2 weeks ago

tfnick commented 2 weeks ago

【问题】 package org.xxx;

import io.github.linpeilie.annotations.MapperConfig;

@MapperConfig( mapperPackage="org.xxx.gen", autoConfigPackage="org.xxx.gen.config", adapterPackage="org.xxx.gen.adapter" ) public class MapStructPlusConfiguration { //mapstruct plus generate config }

我定义了一个公共配置,作为framework.jar的一部分,项目project_demo依赖framework.jar之后,生成的代码并不在预期的pakcage:org.xxx.gen之下。 【期望】 每个子项目不需要单独定义一个MapStructPlusConfiguration类,每个子项目通过依赖framework.jar即可,项目有共同的生成代码目录:org.xxx.gen

linpeilie commented 1 week ago

是的,这个不支持跨模块配置,可以通过compilerArgs参数的方式,来统一配置