The default-value of a Mojo property starts with:
${user.home}
I will write the value to a properties file and it should then be replaced at runtime not at build time.
I tried:
default-value="${user.home}/..."
default-value="\${user.home}/..."
default-value="\\${user.home}/..."
but it always gets replaced with the user.home of the user running the build.
Is there a way to avoid the replacement?
Edit:
The code in question is in a custom Maven Mojo:
public class MyCustomMojo extends AbstractMojo {
...
/**
* @parameter expression="${some-expression}" default-value="\\${user.home}/some-path"
* @required
*/
private String userdir;
...
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
...
Properties configProperties = new Properties();
configProperties.setProperty(Main.USER_DIR_PROPERTY, userdir);
Path propertiesFilePath = confPath.resolve(propertiesFileName);
try (BufferedOutputStream bos = new BufferedOutputStream(Files.newOutputStream(propertiesFilePath))) {
properties.store(bos, "");
}
...
}
}