手机可以做3d动漫视频网站,广告联盟平台,重庆网站建设解决方案,app开发学习网站我想将settings.xml配置文件参数注入Java类.我尝试使用maven-annotation-plugin,但值为null.我想知道这是不是因为这个插件是为Mojo设计的Setting.xml片段APP_NAMEUSER_EMAILUSER_PASSWORD在班上Parameter(defaultValue test.email, readonly true)private Strin…我想将settings.xml配置文件参数注入Java类.我尝试使用maven-annotation-plugin,但值为null.我想知道这是不是因为这个插件是为Mojo设计的Setting.xml片段APP_NAMEUSER_EMAILUSER_PASSWORD在班上Parameter(defaultValue test.email, readonly true)private String userEmail;Parameter(defaultValue test.password, readonly true)private String userPassword;解决方法:我会使用maven-resources-plugin生成.properties文件并避免生成代码.src/main/resourcestrue并创建文件src / main / resources / com / example / your / file.propertiestestMail ${test.email}propertyName ${maven.variable.name}在Java中访问它getClass().getResourceAsStream(/com/example/your/file.properties)为了更进一步,您可以使用maven-enforcer-plugin强制执行test.email属性maven-enforcer-pluginenforce-email-propertiesenforcetest.emailThe test.email property is missing.It must [your free error text here]标签java,maven,code-injection来源 https://codeday.me/bug/20190725/1535188.html