A custom provider should extend extend System Link |
---|
file | src/main/java/de/smartics/maven/plugin/buildmetadata/data/AbstractMetaDataProvider.java |
---|
system-id | svn |
---|
system-type | svn |
---|
label | de.smartics.maven.plugin.buildmetadata.data.AbstractMetaDataProvider |
---|
| and are required to implement System Link |
---|
file | src/main/java/de/smartics/maven/plugin/buildmetadata/data/MetaDataProvider.java |
---|
system-id | svn |
---|
system-type | svn |
---|
label | de.smartics.maven.plugin.buildmetadata.data.MetaDataProvider |
---|
| . The abstract class provides access to Maven's project, the settings, runtime and SCM information.The following class implements an example provider that only echos on the console. Code Block |
---|
| public class EchoProvider extends AbstractMetaDataProvider {
/**
* The string to echo.
*/
private String echo;
/**
* The number of times to echo the string.
*/
private int times;
/**
* {@inheritDoc}
*
* @see de.smartics.maven.plugin.buildmetadata.data.MetaDataProvider#provideBuildMetaData(java.util.Properties)
*/
public void provideBuildMetaData(final Properties buildMetaDataProperties)
throws MojoExecutionException {
if (times > 0) {
for (int i = 0; i < times; i++) {
System.out.println(echo);
}
}
}
} |
Add the buildmetadata plugin artifact as a dependency. Code Block Placeholder |
---|
code-language | HTML and XML |
---|
| <plugin>
<groupId>${project-group-id}</groupId>
<artifactId>${project-artifact-id}</artifactId>
<version>${project-version}</version>
<scope>provided</scope>
</plugin> |
|