Dónal
Dónal

Reputation: 187529

maven plugin configuration

When writing a Maven plugin, you can configure various parameters within the mojo class, e.g.

/**
 * The path to the properties files.
 * 
 * @parameter expression="${project.build.directory}"
 */
private File buildDir;

Is there a reference that lists all the available project properties (e.g. ${project.build.directory})? For example, how do I get the value of the resources directory?

Thanks, Don

Upvotes: 1

Views: 710

Answers (2)

Pascal Thivent
Pascal Thivent

Reputation: 570345

Is there a reference that lists all the available project properties (e.g. ${project.build.directory})?

The already mentioned Maven Properties Guide is the place to go. Also be sure to check PLXUTILS-37 that introduced the following syntax:

  • project.dependencies[0] if dependencies is a java.util.List object or an array object
  • project.dependenciesAsMap(dep1) if dependenciesAsMap is a java.util.Map object

For example, how do I get the value of the resources directory?

Why would you need this? Resources are typically copied to ${project.build.directory} and you should interact with them from there.

But if you really want to go this way, don't forget that project.build.resources holds a List of Resource (so you might need ${project.build.resources[0].directory}).

Upvotes: 1

Abhinav Sarkar
Abhinav Sarkar

Reputation: 23802

I think you are looking for the Maven Properties Guide.

Upvotes: 1

Related Questions