Re:Exodus: Easily migrate your JVM code from Maven to Bazel
by vips7L on Wednesday April 07, 2021 @07:34AM
(#26723341)
> What would i do in Maven?
Typically customization of maven goals is done via profiles. You can modify the configuration of the plugins depending on which profile is active. Though I'm obviously not sure if it will solve your problem without knowing exact details.
I would say that this is Maven's most obvious disadvantage. Its main disadvantage is its inflexibility.
I'm working on a little library right now that is sort of a facade for two possible backend libraries. Some code is shared, some depends on backend A, some on backend B. I want to separate the three kinds of source code, compile and test each against the correct dependencies (none, A, or B), and then put all the class files in one jar file.
In Gradle i would define some extra configurations for the A and B sides, then customise the standard jar task to include their output.
What would i do in Maven?
My Maven knowledge is pretty out of date, but i think the Maven answer would be "don't do that, create three modules and build and publish three artifacts". Or, to put it another way "our tool can't do that, so you should make life worse for your users, but we're going to insist that our way is actually the proper way to do it, for mysterious quasi-mystical reasons".