gemmellr commented on PR #5479: URL: https://github.com/apache/activemq-artemis/pull/5479#issuecomment-2627840060
I have never worked with the plugin either but had a dig and found that the plugin actually should process the ServiceLoader services file, and looking at it with debug logging it actually _does_ do so and even indicates that the name _should_ be updated, but then it just copies it with the original name. Looking closer at how the plugin works, its really just some glue and it is the Eclipse Transformer doing the main work underneath. I had a look there and found the ServiceLoader processing, and looking at the changes to that file it looks like it specifically had a fix that seems like it is around this issue (https://github.com/eclipse-transformer/transformer/commit/c2207cefa841cb4c6f37949fb79663d5bad3750d) of not updating the file because it _only_ needs renamed and has no change to the content. Unfortunately, the plugin is a bit old and is using an older version of the transformer. Trying to have the build use newer versions with the fix above, it seems they aren't compatible. Given it is just one file, I don't think its worth switching out to a different newer plugin just to get this working seamlessly. Your workaround of just adding the new services file directly seems fine for this specific case. However I also don't think we should leave the incorrect services file around. Running an execution of the maven-clean-plugin during the generate-sources phase, just after the transform is done, to delete the copy is probably the simplest thing for now. E.g: ``` diff --git a/artemis-cdi-jakarta-client/pom.xml b/artemis-cdi-jakarta-client/pom.xml index 218659cb69..f425880eec 100644 --- a/artemis-cdi-jakarta-client/pom.xml +++ b/artemis-cdi-jakarta-client/pom.xml @@ -157,6 +157,27 @@ </dependency> </dependencies> </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-clean-plugin</artifactId> + <executions> + <execution> + <id>remove-old-services-file</id> + <phase>generate-sources</phase> + <goals> + <goal>clean</goal> + </goals> + <configuration> + <filesets> + <fileset> + <directory>${project.build.directory}/generated-resources/transformed/META-INF/services/</directory> + </fileset> + </filesets> + <excludeDefaultDirectories>true</excludeDefaultDirectories> + </configuration> + </execution> + </executions> + </plugin> </plugins> </build> ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org For additional commands, e-mail: gitbox-h...@activemq.apache.org For further information, visit: https://activemq.apache.org/contact