I have the following property in my Maven MOJO plugin:
@Mojo(name = "generate", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true)
public class GraphQLCodegenMojo extends AbstractMojo {
@Parameter
private Map<String, String> customTypesMapping;
}
Which I usually set in the following way (based on the Maven guide):
<customTypesMapping>
<DateTime>java.util.Date</DateTime>
</customTypesMapping>
Now I want to allow plugin users to supply special characters as a map key.
I've tried different approaches, but neither of them work:
<customTypesMapping>
<DateTime!>java.util.Date</DateTime!>
<DateTime!>java.util.Date</DateTime!>
<customTypeMapping>
<name>DateTime</key>
<value>java.util.Date</value>
</customTypeMapping>
</customTypeMapping>
Is there a backward-compatible way to change my maven plugin (not breaking existing clients)?