maven-plugin-development

MavenResourcesExecution How to Get as Variable Instead of Writing to A File?

╄→гoц情女王★ 提交于 2019-12-12 03:45:04
问题 I use that at my plugin: MavenResourcesExecution mavenResourcesExecution = new MavenResourcesExecution(resources, outputFileDirectory, project, encoding, buildFilters, Collections.<String>emptyList(), session); try { mavenResourcesFiltering.filterResources(mavenResourcesExecution); } catch (MavenFilteringException e) { e.printStackTrace(); } and it writes everyting into a file however I want to retrieve it as a variable instead of writing it into a file. How can I do it? 回答1: I have

How to Get Maven Project Version From Java Method as Like at Pom

半腔热情 提交于 2019-12-10 23:35:20
问题 I can get some variable's values from my pom file i.e.: ${project.version} and I am developing a custom maven plugin and I can set it with expressions however I don't want it. How can I get it in a Java method as like my pom file? PS: System.getProperty("project.version") doesn't work, I should find a generic solution because I will use it at other things too i.e. getting bamboo build number etc. 回答1: I did this in my web project by using the maven-war-plugin to inject the version into the