maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kamaci <>
Subject Reading Variables From a Properties File Without Creating An Ouptut File
Date Fri, 08 Feb 2013 20:49:03 GMT
I am developing a Maven plugin. It will search for given token and inject
values at given files. Everything is OK but there is only one thing that I
am struggling with. I have some tokens and variables and I want to read them
from a properties file. For example:

project.version = ${project.version}
svn.revision.number = ${svn.revision.number} = ${}

If I write them into my pom.xml file Maven will understand that variables
and when I get the value of them within my Mojo Maven will automatically
give me the value of variable. However if I write them into a properties
file it doesn't.

I have realized resource tag and tried:


but it is not what I want. I have tried to that at my Mojo:

	MavenResourcesExecution mavenResourcesExecution = new
MavenResourcesExecution(resources, outputFileDirectory, project, encoding,
buildFilters, Collections.<String>emptyList(), session);

	try {
	} catch (MavenFilteringException e) {

but because of I pass outputFileDirectory it creates a new properties file
into that directory. I don't want to get a new filtered properties file I
just want to retrieve a properties variable that includes replaced with real
values of Maven variables from my original properties file.

If I don't create a outputdirectory and just I can do something like that:

    Properties filteredProperties =

everything will be OK for me. How can I do that?

PS: Something like ${project.version} I call them as Maven variables.

View this message in context:
Sent from the Maven - Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message