skinny85 / jilt

Java annotation processor library for auto-generating Builder (including Staged Builder) pattern classes
Other
229 stars 13 forks source link

Jilt doesn't genereate Builder classes when using MapStruct annotation processor #26

Closed virtual-thread closed 3 weeks ago

virtual-thread commented 1 month ago

Quarkus project using maven with jilt version 1.6.1 mapstruct version 1.5.5.Final with java 21

If I don't add annotation processor for mapstrcut jilt on maven clean package generates sources and it works fine, as soon as I add mapstrcut annotation processor and do 'maven clean package' jilt stops generating classes.

I add this annotation processor

         <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>${compiler-plugin.version}</version>
            <configuration>
                <annotationProcessorPaths>
                    <path>
                        <groupId>org.mapstruct</groupId>
                        <artifactId>mapstruct-processor</artifactId>
                        <version>1.5.5.Final</version>
                    </path>
                </annotationProcessorPaths>
                <compilerArgs>
                    <arg>-parameters</arg>
                </compilerArgs>
            </configuration>
        </plugin>
thmasker commented 1 month ago

I think you also need to add the annotation processor for Jilt:

         <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>${compiler-plugin.version}</version>
            <configuration>
                <annotationProcessorPaths>
                    <path>
                        <groupId>org.mapstruct</groupId>
                        <artifactId>mapstruct-processor</artifactId>
                        <version>1.5.5.Final</version>
                    </path>
                    <path>
                        <groupId>cc.jilt</groupId>
                        <artifactId>jilt</artifactId>
                        <version>1.6.1</version>
                    </path>
                </annotationProcessorPaths>
                <compilerArgs>
                    <arg>-parameters</arg>
                </compilerArgs>
            </configuration>
        </plugin>
virtual-thread commented 1 month ago

It is working thank you.

skinny85 commented 1 month ago

Hi @virtual-thread,

thanks for opening the issue!

Curious, why do you need to add mapstruct to the Maven compiler plugin settings? Does it not work without it?

skinny85 commented 1 month ago

Also, thanks a lot for the quick response @thmasker!

skinny85 commented 3 weeks ago

I'm closing this one due to inactivity. If you still need anything related to this issue, please comment, and I'll be happy to re-open.