org.apache.maven.plugin.resources.remote
Class ProcessRemoteResourcesMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.maven.plugin.resources.remote.ProcessRemoteResourcesMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

public class ProcessRemoteResourcesMojo
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".

Is defined by the goal name:
process
Is bound to the specified phase of the standard build lifecycle:
generate-resources

Field Summary
protected  File basedir
          Used for calculation of execution-root for runOnlyAtExecutionRoot.
protected  org.apache.maven.ProjectDependenciesResolver dependencyResolver
           
protected  String encoding
          The character encoding scheme to be applied when filtering resources.
protected  String excludeArtifactIds
          Comma separated list of Artifact names too 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  String includeScope
          Scope to include.
protected  boolean runOnlyAtExecutionRoot
          If true, only generate resources in the directory of the root project in a multimodule build.
protected  boolean useDefaultFilterDelimiters
           
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
ProcessRemoteResourcesMojo()
           
 
Method Summary
protected  void configureVelocityContext(VelocityContext context)
           
protected  boolean copyResourceIfExists(File file, String relFileName, VelocityContext context)
           
 void execute()
           
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(RemoteResourcesClassLoader classLoader, VelocityContext context)
           
protected  void validate()
           
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

filterDelimiters

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).

Since:
1.1
Is defined by:

useDefaultFilterDelimiters

protected boolean useDefaultFilterDelimiters
Since:
1.1
Is defined by:
default-value:
true

runOnlyAtExecutionRoot

protected boolean runOnlyAtExecutionRoot
If true, only generate resources in the directory of the root project in a multimodule build. Dependencies from all modules will be aggregated before resource-generation takes place.

Since:
1.1
Is defined by:
default-value:
false

basedir

protected File basedir
Used for calculation of execution-root for runOnlyAtExecutionRoot.

Is defined by:
default-value:
${basedir}
Is readonly.
Is required.

encoding

protected String encoding
The character encoding scheme to be applied when filtering resources.

Is defined by:
expression:
${encoding}
default-value:
${project.build.sourceEncoding}

includeScope

protected String includeScope
Scope to include. An Empty string indicates all scopes (default).

Since:
1.0
Is defined by:
expression:
${includeScope}
default-value:
runtime

excludeScope

protected String excludeScope
Scope to exclude. An Empty string indicates no scopes (default).

Since:
1.0
Is defined by:
expression:
${excludeScope}
default-value:

excludeArtifactIds

protected String excludeArtifactIds
Comma separated list of Artifact names too exclude.

Since:
1.0
Is defined by:
expression:
${excludeArtifactIds}
default-value:

includeArtifactIds

protected String includeArtifactIds
Comma separated list of Artifact names to include.

Since:
1.0
Is defined by:
expression:
${includeArtifactIds}
default-value:

excludeGroupIds

protected String excludeGroupIds
Comma separated list of GroupId Names to exclude.

Since:
1.0
Is defined by:
expression:
${excludeGroupIds}
default-value:

includeGroupIds

protected String includeGroupIds
Comma separated list of GroupIds to include.

Since:
1.0
Is defined by:
expression:
${includeGroupIds}
default-value:

excludeTransitive

protected boolean excludeTransitive
If we should exclude transitive dependencies

Since:
1.0
Is defined by:
expression:
${excludeTransitive}
default-value:
false

dependencyResolver

protected org.apache.maven.ProjectDependenciesResolver dependencyResolver
Is a Plexus component defined by:
role-hint:
default
Constructor Detail

ProcessRemoteResourcesMojo

public ProcessRemoteResourcesMojo()
Method Detail

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

getProjects

protected List<org.apache.maven.project.MavenProject> getProjects()
                                                           throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

getProjectsSortedByOrganization

protected Map<org.apache.maven.model.Organization,List<org.apache.maven.project.MavenProject>> getProjectsSortedByOrganization(List<org.apache.maven.project.MavenProject> projects)
                                                                                                                        throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

copyResourceIfExists

protected boolean copyResourceIfExists(File file,
                                       String relFileName,
                                       VelocityContext context)
                                throws IOException,
                                       org.apache.maven.plugin.MojoExecutionException
Throws:
IOException
org.apache.maven.plugin.MojoExecutionException

validate

protected void validate()
                 throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

configureVelocityContext

protected void configureVelocityContext(VelocityContext context)
                                 throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

processResourceBundles

protected void processResourceBundles(RemoteResourcesClassLoader classLoader,
                                      VelocityContext context)
                               throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

getSupplement

protected org.apache.maven.model.Model getSupplement(org.codehaus.plexus.util.xml.Xpp3Dom supplementModelXml)
                                              throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

mergeModels

protected org.apache.maven.model.Model mergeModels(org.apache.maven.model.Model parent,
                                                   org.apache.maven.model.Model child)


Copyright © 2002-2009 The Apache Software Foundation. All Rights Reserved.