You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are attempting to use the Transformer maven plugin for a use case that I've never seen described, but which I would think would be possible.
We have a bunch of SpringBoot applications that depend on artifacts that use the "javax" packages in their source code. We now require they use the "jakarta" packages. However, we require these artifacts to be used at compile time, not just runtime. I've seen a number of examples using the transformer where it will package up the transformed jars, but never a case where it uses the transformed jars at compile time.
The text was updated successfully, but these errors were encountered:
I think the key point here is that with Maven, there is a big difference in thinking something could be done and actually doing it. I believe I've managed to put something together that demonstrates this, but I discovered afterwards that there were some other issues with my test case unrelated to this, so I'm not certain yet whether it fully deals with the problem. Some other people will have to deal with those questions on Monday.
The "trick" to get it to fully work is to use the "jar" goal and then use the "maven-antrun-plugin" to extract the contents of all the transformed jars into "target/classes", and do this in the "prepare" phase. I'm not sure if I can find this documented anywhere, but it appears that the maven-compiler-plugin will use target/classes not just as the destination for compiled classes, but also additional classpath for classes being compiled. These classes being present in target/classes will also take precedence over the same FQCNs the compiler finds in the untransformed versions of the dependency artifacts.
We are attempting to use the Transformer maven plugin for a use case that I've never seen described, but which I would think would be possible.
We have a bunch of SpringBoot applications that depend on artifacts that use the "javax" packages in their source code. We now require they use the "jakarta" packages. However, we require these artifacts to be used at compile time, not just runtime. I've seen a number of examples using the transformer where it will package up the transformed jars, but never a case where it uses the transformed jars at compile time.
The text was updated successfully, but these errors were encountered: