我的 Maven MOJO 插件中有以下属性:
@Mojo(name = "generate", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true)
public class GraphQLCodegenMojo extends AbstractMojo {
@Parameter
private Map<String, String> customTypesMapping;
}
我通常以以下方式设置(基于Maven 指南):
<customTypesMapping>
<DateTime>java.util.Date</DateTime>
</customTypesMapping>
现在我想允许插件用户提供特殊字符作为映射键。
我尝试了不同的方法,但它们都不起作用:
<customTypesMapping>
<DateTime!>java.util.Date</DateTime!>
<DateTime!>java.util.Date</DateTime!>
<customTypeMapping>
<name>DateTime</key>
<value>java.util.Date</value>
</customTypeMapping>
</customTypeMapping>
是否有向后兼容的方式来更改我的 Maven 插件(不破坏现有客户端)?