public abstract class AbstractProcessRemoteResourcesMojo
extends org.apache.maven.plugin.AbstractMojo
Pull down resourceBundles containing remote resources and process the resources contained inside. When that is done, the resources are injected into the current (in-memory) Maven project, making them available to the process-resources phase.
Resources that end in ".vm" are treated as Velocity templates. For those, the ".vm" is stripped off for the final artifact name and it's fed through Velocity to have properties expanded, conditions processed, etc...
Resources that don't end in ".vm" are copied "as is".This is a support abstract class, with two non-aggregating and aggregating implementations.
Modifier and Type | Field and Description |
---|---|
protected String |
encoding
The character encoding scheme to be applied when filtering resources.
|
protected String |
excludeArtifactIds
Comma separated list of Artifact names to exclude.
|
protected String |
excludeGroupIds
Comma separated list of GroupId Names to exclude.
|
protected String |
excludeScope
Scope to exclude.
|
protected boolean |
excludeTransitive
If we should exclude transitive dependencies
|
protected List<String> |
filterDelimiters
In cases where a local resource overrides one from a remote resource bundle, that resource should be filtered if
the resource set specifies it.
|
protected String |
includeArtifactIds
Comma separated list of Artifact names to include.
|
protected String |
includeGroupIds
Comma separated list of GroupIds to include.
|
protected boolean |
includeProjectProperties
Whether to include properties defined in the project when filtering resources.
|
protected String |
includeScope
Scope to include.
|
protected org.apache.maven.execution.MavenSession |
mavenSession
The Maven session.
|
protected org.apache.maven.project.MavenProject |
project
The current project.
|
protected Map<String,Object> |
properties
Additional properties to be passed to Velocity.
|
protected org.eclipse.aether.RepositorySystem |
repoSystem |
protected String[] |
resolveScopes
When resolving project dependencies, specify the scopes to include.
|
protected boolean |
useDefaultFilterDelimiters |
protected int |
velocityFilterInMemoryThreshold
When the result of velocity transformation fits in memory, it is compared with the actual contents on disk
to eliminate unnecessary destination file overwrite.
|
Constructor and Description |
---|
AbstractProcessRemoteResourcesMojo() |
Modifier and Type | Method and Description |
---|---|
protected org.apache.velocity.VelocityContext |
buildVelocityContext(Map<String,Object> properties) |
protected boolean |
copyResourceIfExists(File file,
String relFileName,
org.apache.velocity.VelocityContext context) |
void |
execute() |
protected abstract Set<org.apache.maven.artifact.Artifact> |
getAllDependencies()
Returns all the transitive hull of all the involved maven projects.
|
protected abstract Set<org.apache.maven.artifact.Artifact> |
getDirectDependencies()
Returns all the direct dependencies of all the involved maven projects.
|
protected List<org.apache.maven.project.MavenProject> |
getProjects() |
protected Map<org.apache.maven.model.Organization,List<org.apache.maven.project.MavenProject>> |
getProjectsSortedByOrganization(List<org.apache.maven.project.MavenProject> projects) |
protected org.apache.maven.model.Model |
getSupplement(org.codehaus.plexus.util.xml.Xpp3Dom supplementModelXml) |
protected org.apache.maven.model.Model |
mergeModels(org.apache.maven.model.Model parent,
org.apache.maven.model.Model child) |
protected void |
processResourceBundles(ClassLoader classLoader,
org.apache.velocity.VelocityContext context) |
protected void |
validate() |
@Parameter protected List<String> filterDelimiters
In cases where a local resource overrides one from a remote resource bundle, that resource should be filtered if the resource set specifies it. In those cases, this parameter defines the list of delimiters for filterable expressions. These delimiters are specified in the form 'beginToken*endToken'. If no '*' is given, the delimiter is assumed to be the same for start and end.
So, the default filtering delimiters might be specified as:
<delimiters> <delimiter>${*}</delimiter> <delimiter>@</delimiter> </delimiters>Since the '@' delimiter is the same on both ends, we don't need to specify '@*@' (though we can).
@Parameter(defaultValue="true") protected boolean useDefaultFilterDelimiters
@Parameter(property="encoding", defaultValue="${project.build.sourceEncoding}") protected String encoding
@Parameter protected Map<String,Object> properties
project
- the current MavenProject projects
- the list of dependency projectsprojectsSortedByOrganization
- the list of dependency projects sorted by organizationprojectTimespan
- the timespan of the current project (requires inceptionYear in pom)locator
- the ResourceManager that can be used to retrieve additional resources@Parameter(defaultValue="false") protected boolean includeProjectProperties
@Parameter(defaultValue="5242880") protected int velocityFilterInMemoryThreshold
@Parameter(defaultValue="${session}", readonly=true, required=true) protected org.apache.maven.execution.MavenSession mavenSession
@Parameter(defaultValue="${project}", readonly=true, required=true) protected org.apache.maven.project.MavenProject project
@Parameter(property="includeScope", defaultValue="runtime") protected String includeScope
@Parameter(property="excludeScope", defaultValue="") protected String excludeScope
@Parameter protected String[] resolveScopes
@Parameter(property="excludeArtifactIds", defaultValue="") protected String excludeArtifactIds
@Parameter(property="includeArtifactIds", defaultValue="") protected String includeArtifactIds
@Parameter(property="excludeGroupIds", defaultValue="") protected String excludeGroupIds
@Parameter(property="includeGroupIds", defaultValue="") protected String includeGroupIds
@Parameter(property="excludeTransitive", defaultValue="false") protected boolean excludeTransitive
@Component protected org.eclipse.aether.RepositorySystem repoSystem
public void execute() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
protected List<org.apache.maven.project.MavenProject> getProjects()
protected abstract Set<org.apache.maven.artifact.Artifact> getAllDependencies()
protected abstract Set<org.apache.maven.artifact.Artifact> getDirectDependencies()
protected Map<org.apache.maven.model.Organization,List<org.apache.maven.project.MavenProject>> getProjectsSortedByOrganization(List<org.apache.maven.project.MavenProject> projects)
protected boolean copyResourceIfExists(File file, String relFileName, org.apache.velocity.VelocityContext context) throws IOException, org.apache.maven.plugin.MojoExecutionException
IOException
org.apache.maven.plugin.MojoExecutionException
protected void validate() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
protected org.apache.velocity.VelocityContext buildVelocityContext(Map<String,Object> properties)
protected void processResourceBundles(ClassLoader classLoader, org.apache.velocity.VelocityContext context) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
protected org.apache.maven.model.Model getSupplement(org.codehaus.plexus.util.xml.Xpp3Dom supplementModelXml) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
protected org.apache.maven.model.Model mergeModels(org.apache.maven.model.Model parent, org.apache.maven.model.Model child)
Copyright © 2002–2023 The Apache Software Foundation. All rights reserved.