Return-Path: X-Original-To: apmail-maven-commits-archive@www.apache.org Delivered-To: apmail-maven-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6284B1024B for ; Sun, 1 Sep 2013 11:16:18 +0000 (UTC) Received: (qmail 40677 invoked by uid 500); 1 Sep 2013 11:16:01 -0000 Delivered-To: apmail-maven-commits-archive@maven.apache.org Received: (qmail 40432 invoked by uid 500); 1 Sep 2013 11:15:57 -0000 Mailing-List: contact commits-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@maven.apache.org Delivered-To: mailing list commits@maven.apache.org Received: (qmail 40226 invoked by uid 99); 1 Sep 2013 11:15:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Sep 2013 11:15:56 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Sep 2013 11:15:52 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 123052388CB2 for ; Sun, 1 Sep 2013 11:14:24 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r876903 [36/41] - in /websites/production/maven/content/plugins-archives/maven-remote-resources-plugin-1.5: ./ apidocs/ apidocs/org/ apidocs/org/apache/ apidocs/org/apache/maven/ apidocs/org/apache/maven/plugin/ apidocs/org/apache/maven/plu... Date: Sun, 01 Sep 2013 11:14:12 -0000 To: commits@maven.apache.org From: rfscholte@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130901111424.123052388CB2@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Added: websites/production/maven/content/plugins-archives/maven-remote-resources-plugin-1.5/xref/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.html ============================================================================== --- websites/production/maven/content/plugins-archives/maven-remote-resources-plugin-1.5/xref/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.html (added) +++ websites/production/maven/content/plugins-archives/maven-remote-resources-plugin-1.5/xref/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.html Sun Sep 1 11:14:08 2013 @@ -0,0 +1,1496 @@ + + + + +ProcessRemoteResourcesMojo xref + + + +
+
+1   package org.apache.maven.plugin.resources.remote;
+2   
+3   /*
+4    * Licensed to the Apache Software Foundation (ASF) under one
+5    * or more contributor license agreements.  See the NOTICE file
+6    * distributed with this work for additional information
+7    * regarding copyright ownership.  The ASF licenses this file
+8    * to you under the Apache License, Version 2.0 (the
+9    * "License"); you may not use this file except in compliance
+10   * with the License.  You may obtain a copy of the License at
+11   *
+12   *   http://www.apache.org/licenses/LICENSE-2.0
+13   *
+14   * Unless required by applicable law or agreed to in writing,
+15   * software distributed under the License is distributed on an
+16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+17   * KIND, either express or implied.  See the License for the
+18   * specific language governing permissions and limitations
+19   * under the License.
+20   */
+21  
+22  import org.apache.maven.ProjectDependenciesResolver;
+23  import org.apache.maven.artifact.Artifact;
+24  import org.apache.maven.artifact.factory.ArtifactFactory;
+25  import org.apache.maven.artifact.repository.ArtifactRepository;
+26  import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
+27  import org.apache.maven.artifact.resolver.ArtifactResolutionException;
+28  import org.apache.maven.artifact.resolver.ArtifactResolver;
+29  import org.apache.maven.artifact.versioning.VersionRange;
+30  import org.apache.maven.execution.MavenSession;
+31  import org.apache.maven.model.Model;
+32  import org.apache.maven.model.Organization;
+33  import org.apache.maven.model.Resource;
+34  import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
+35  import org.apache.maven.plugin.AbstractMojo;
+36  import org.apache.maven.plugin.MojoExecutionException;
+37  import org.apache.maven.plugin.logging.Log;
+38  import org.apache.maven.plugin.resources.remote.io.xpp3.RemoteResourcesBundleXpp3Reader;
+39  import org.apache.maven.plugin.resources.remote.io.xpp3.SupplementalDataModelXpp3Reader;
+40  import org.apache.maven.plugins.annotations.Component;
+41  import org.apache.maven.plugins.annotations.LifecyclePhase;
+42  import org.apache.maven.plugins.annotations.Mojo;
+43  import org.apache.maven.plugins.annotations.Parameter;
+44  import org.apache.maven.project.InvalidProjectModelException;
+45  import org.apache.maven.project.MavenProject;
+46  import org.apache.maven.project.MavenProjectBuilder;
+47  import org.apache.maven.project.ProjectBuildingException;
+48  import org.apache.maven.project.artifact.InvalidDependencyVersionException;
+49  import org.apache.maven.project.inheritance.ModelInheritanceAssembler;
+50  import org.apache.maven.shared.artifact.filter.collection.ArtifactFilterException;
+51  import org.apache.maven.shared.artifact.filter.collection.ArtifactIdFilter;
+52  import org.apache.maven.shared.artifact.filter.collection.FilterArtifacts;
+53  import org.apache.maven.shared.artifact.filter.collection.GroupIdFilter;
+54  import org.apache.maven.shared.artifact.filter.collection.ProjectTransitivityFilter;
+55  import org.apache.maven.shared.artifact.filter.collection.ScopeFilter;
+56  import org.apache.maven.shared.filtering.MavenFileFilter;
+57  import org.apache.maven.shared.filtering.MavenFileFilterRequest;
+58  import org.apache.maven.shared.filtering.MavenFilteringException;
+59  import org.apache.velocity.VelocityContext;
+60  import org.apache.velocity.app.Velocity;
+61  import org.apache.velocity.app.VelocityEngine;
+62  import org.apache.velocity.exception.MethodInvocationException;
+63  import org.apache.velocity.exception.ParseErrorException;
+64  import org.apache.velocity.exception.ResourceNotFoundException;
+65  import org.apache.velocity.runtime.RuntimeServices;
+66  import org.apache.velocity.runtime.log.LogChute;
+67  import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader;
+68  import org.codehaus.plexus.resource.ResourceManager;
+69  import org.codehaus.plexus.resource.loader.FileResourceLoader;
+70  import org.codehaus.plexus.util.FileUtils;
+71  import org.codehaus.plexus.util.IOUtil;
+72  import org.codehaus.plexus.util.ReaderFactory;
+73  import org.codehaus.plexus.util.StringUtils;
+74  import org.codehaus.plexus.util.WriterFactory;
+75  import org.codehaus.plexus.util.xml.Xpp3Dom;
+76  import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+77  
+78  import java.io.File;
+79  import java.io.FileInputStream;
+80  import java.io.FileOutputStream;
+81  import java.io.FileReader;
+82  import java.io.FileWriter;
+83  import java.io.IOException;
+84  import java.io.InputStream;
+85  import java.io.InputStreamReader;
+86  import java.io.OutputStream;
+87  import java.io.OutputStreamWriter;
+88  import java.io.PrintWriter;
+89  import java.io.Reader;
+90  import java.io.StringReader;
+91  import java.io.Writer;
+92  import java.net.MalformedURLException;
+93  import java.net.URL;
+94  import java.text.SimpleDateFormat;
+95  import java.util.ArrayList;
+96  import java.util.Arrays;
+97  import java.util.Collections;
+98  import java.util.Comparator;
+99  import java.util.Date;
+100 import java.util.Enumeration;
+101 import java.util.HashMap;
+102 import java.util.LinkedHashSet;
+103 import java.util.List;
+104 import java.util.Map;
+105 import java.util.Properties;
+106 import java.util.Set;
+107 import java.util.TreeMap;
+108 
+109 /**
+110  * <p>
+111  * Pull down resourceBundles containing remote resources and process the
+112  * resources contained inside. When that is done the resources are injected
+113  * into the current (in-memory) Maven project, making them available to the
+114  * process-resources phase.
+115  * </p>
+116  * <p>
+117  * Resources that end in ".vm" are treated as velocity templates.  For those, the ".vm" is
+118  * stripped off for the final artifact name and it's  fed through velocity to have properties
+119  * expanded, conditions processed, etc...
+120  * </p>
+121  * <p/>
+122  * Resources that don't end in ".vm" are copied "as is".
+123  */
+124 // NOTE: Removed the following in favor of maven-artifact-resolver library, for MRRESOURCES-41
+125 // If I leave this intact, interdependent projects within the reactor that haven't been built
+126 // (remember, this runs in the generate-resources phase) will cause the build to fail.
+127 //
+128 // @requiresDependencyResolution test
+129 @Mojo( name = "process", defaultPhase = LifecyclePhase.GENERATE_RESOURCES, threadSafe = true )
+130 public class ProcessRemoteResourcesMojo
+131     extends AbstractMojo implements LogChute
+132 {
+133 
+134     private static final String TEMPLATE_SUFFIX = ".vm";
+135 
+136     /**
+137      * <p>
+138      * In cases where a local resource overrides one from a remote resource bundle, that resource
+139      * should be filtered if the resource set specifies it. In those cases, this parameter defines
+140      * the list of delimiters for filterable expressions. These delimiters are specified in the
+141      * form 'beginToken*endToken'. If no '*' is given, the delimiter is assumed to be the same for start and end.
+142      * </p>
+143      * <p>
+144      * So, the default filtering delimiters might be specified as:
+145      * </p>
+146      * <pre>
+147      * &lt;delimiters&gt;
+148      *   &lt;delimiter&gt;${*}&lt/delimiter&gt;
+149      *   &lt;delimiter&gt;@&lt/delimiter&gt;
+150      * &lt;/delimiters&gt;
+151      * </pre>
+152      * <p/>
+153      * Since the '@' delimiter is the same on both ends, we don't need to specify '@*@' (though we can).
+154      *
+155      * @since 1.1
+156      */
+157     @Parameter
+158     protected List<String> filterDelimiters;
+159 
+160     /**
+161      * @since 1.1
+162      */
+163     @Parameter( defaultValue = "true" )
+164     protected boolean useDefaultFilterDelimiters;
+165 
+166     /**
+167      * If true, only generate resources in the directory of the root project in a multimodule build.
+168      * Dependencies from all modules will be aggregated before resource-generation takes place.
+169      *
+170      * @since 1.1
+171      */
+172     @Parameter( defaultValue = "false" )
+173     protected boolean runOnlyAtExecutionRoot;
+174 
+175     /**
+176      * Used for calculation of execution-root for {@link ProcessRemoteResourcesMojo#runOnlyAtExecutionRoot}.
+177      */
+178     @Parameter( defaultValue = "${basedir}", readonly = true, required = true )
+179     protected File basedir;
+180 
+181     /**
+182      * The character encoding scheme to be applied when filtering resources.
+183      */
+184     @Parameter( property = "encoding", defaultValue = "${project.build.sourceEncoding}" )
+185     protected String encoding;
+186 
+187     /**
+188      * The local repository taken from Maven's runtime. Typically $HOME/.m2/repository.
+189      */
+190     @Parameter( defaultValue = "${localRepository}", readonly = true, required = true )
+191     private ArtifactRepository localRepository;
+192 
+193     /**
+194      * List of Remote Repositories used by the resolver.
+195      */
+196     @Parameter( defaultValue = "${project.remoteArtifactRepositories}", readonly = true, required = true )
+197     private List<ArtifactRepository> remoteArtifactRepositories;
+198 
+199     /**
+200      * The current Maven project.
+201      */
+202     @Component
+203     private MavenProject project;
+204 
+205     /**
+206      * The directory where processed resources will be placed for packaging.
+207      */
+208     @Parameter( defaultValue = "${project.build.directory}/maven-shared-archive-resources" )
+209     private File outputDirectory;
+210 
+211     /**
+212      * The directory containing extra information appended to the generated resources.
+213      */
+214     @Parameter( defaultValue = "${basedir}/src/main/appended-resources" )
+215     private File appendedResourcesDirectory;
+216 
+217     /**
+218      * Supplemental model data.  Useful when processing
+219      * artifacts with incomplete POM metadata.
+220      * <p/>
+221      * By default, this Mojo looks for supplemental model
+222      * data in the file "${appendedResourcesDirectory}/supplemental-models.xml".
+223      *
+224      * @since 1.0-alpha-5
+225      */
+226     @Parameter
+227     private String[] supplementalModels;
+228 
+229     /**
+230      * List of artifacts that are added to the search path when looking
+231      * for supplementalModels, expressed with
+232      * <code>groupId:artifactId:version[:type[:classifier]]</code> format.
+233      *
+234      * @since 1.1
+235      */
+236     @Parameter
+237     private List<String> supplementalModelArtifacts;
+238 
+239     /**
+240      * Map of artifacts to supplemental project object models.
+241      */
+242     private Map<String, Model> supplementModels;
+243 
+244     /**
+245      * Merges supplemental data model with artifact
+246      * metadata.  Useful when processing artifacts with
+247      * incomplete POM metadata.
+248      */
+249     @Component
+250     private ModelInheritanceAssembler inheritanceAssembler;
+251 
+252     /**
+253      * The resource bundles that will be retrieved and processed,
+254      * expressed with <code>groupId:artifactId:version[:type[:classifier]]</code> format.
+255      */
+256     @Parameter( required = true )
+257     private List<String> resourceBundles;
+258 
+259     /**
+260      * Skip remote-resource processing
+261      *
+262      * @since 1.0-alpha-5
+263      */
+264     @Parameter( property = "remoteresources.skip", defaultValue = "false" )
+265     private boolean skip;
+266 
+267     /**
+268      * Attaches the resources to the project as a resource directory.
+269      *
+270      * @since 1.0-beta-1
+271      * @deprecated Please use {@link #attachToMain} and {@link #attachToTest} instead.
+272      */
+273     @Deprecated
+274     @Parameter( defaultValue = "true" )
+275     private boolean attached = true;
+276 
+277     /**
+278      * Attaches the resources to the main build of the project as a resource
+279      * directory.
+280      *
+281      * @since 1.5
+282      */
+283     @Parameter( defaultValue = "true", property = "attachToMain" )
+284     private boolean attachToMain;
+285 
+286     /**
+287      * Attaches the resources to the test build of the project as a resource
+288      * directory.
+289      *
+290      * @since 1.5
+291      */
+292     @Parameter( defaultValue = "true", property = "attachToTest" )
+293     private boolean attachToTest;
+294 
+295     /**
+296      * Additional properties to be passed to velocity.
+297      * <p/>
+298      * Several properties are automatically added:<br/>
+299      * project - the current MavenProject <br/>
+300      * projects - the list of dependency projects<br/>
+301      * projectTimespan - the timespan of the current project (requires inceptionYear in pom)<br/>
+302      * locator - the ResourceManager that can be used to retrieve additional resources<br/>
+303      * <p/>
+304      * See <a href="http://maven.apache.org/ref/current/maven-project/apidocs/org/apache/maven/project/MavenProject.html">
+305      * the javadoc for MavenProject</a> for information about the properties on the MavenProject.
+306      */
+307     @Parameter
+308     private Map<String, Object> properties = new HashMap<String, Object>();
+309     
+310     /**
+311      * Whether to include properties defined in the project when filtering resources.
+312      *
+313      * @since 1.2
+314      */
+315     @Parameter( defaultValue = "false" )
+316     protected boolean includeProjectProperties = false;
+317 
+318     /**
+319      * The list of resources defined for the project.
+320      */
+321     @Parameter( defaultValue = "${project.resources}", readonly = true, required = true )
+322     private List<Resource> resources;
+323 
+324     /**
+325      * Artifact Resolver, needed to resolve and download the {@code resourceBundles}.
+326      */
+327     @Component
+328     private ArtifactResolver artifactResolver;
+329 
+330     /**
+331      * Filtering support, for local resources that override those in the remote bundle.
+332      */
+333     @Component
+334     private MavenFileFilter fileFilter;
+335 
+336     /**
+337      * Artifact factory, needed to create artifacts.
+338      */
+339     @Component
+340     private ArtifactFactory artifactFactory;
+341 
+342     /**
+343      * The Maven session.
+344      */
+345     @Component
+346     private MavenSession mavenSession;
+347 
+348     /**
+349      * ProjectBuilder, needed to create projects from the artifacts.
+350      */
+351     @Component( role = MavenProjectBuilder.class )
+352     private MavenProjectBuilder mavenProjectBuilder;
+353 
+354     /**
+355      */
+356     @Component
+357     private ResourceManager locator;
+358 
+359 
+360     /**
+361      * Scope to include. An Empty string indicates all scopes (default is "runtime").
+362      *
+363      * @since 1.0
+364      */
+365     @Parameter( property = "includeScope", defaultValue = "runtime" )
+366     protected String includeScope;
+367 
+368     /**
+369      * Scope to exclude. An Empty string indicates no scopes (default).
+370      *
+371      * @since 1.0
+372      */
+373     @Parameter( property = "excludeScope", defaultValue = "" )
+374     protected String excludeScope;
+375     
+376     
+377     /**
+378      * When resolving project dependencies, specify the scopes to include.
+379      * The default is the same as "includeScope" if there are no exclude scopes set.
+380      * Otherwise, it defaults to "test" to grab all the dependencies so the
+381      * exclude filters can filter out what is not needed.
+382      * @since 1.5 
+383      */
+384     @Parameter
+385     private String[] resolveScopes;
+386     
+387 
+388     /**
+389      * Comma separated list of Artifact names too exclude.
+390      *
+391      * @since 1.0
+392      */
+393     @Parameter( property = "excludeArtifactIds", defaultValue = "" )
+394     protected String excludeArtifactIds;
+395 
+396     /**
+397      * Comma separated list of Artifact names to include.
+398      *
+399      * @since 1.0
+400      */
+401     @Parameter( property = "includeArtifactIds", defaultValue = "" )
+402     protected String includeArtifactIds;
+403 
+404     /**
+405      * Comma separated list of GroupId Names to exclude.
+406      *
+407      * @since 1.0
+408      */
+409     @Parameter( property = "excludeGroupIds", defaultValue = "" )
+410     protected String excludeGroupIds;
+411 
+412     /**
+413      * Comma separated list of GroupIds to include.
+414      *
+415      * @since 1.0
+416      */
+417     @Parameter( property = "includeGroupIds", defaultValue = "" )
+418     protected String includeGroupIds;
+419 
+420     /**
+421      * If we should exclude transitive dependencies
+422      *
+423      * @since 1.0
+424      */
+425     @Parameter( property = "excludeTransitive", defaultValue = "false" )
+426     protected boolean excludeTransitive;
+427 
+428     /**
+429      */
+430     @Component( hint = "default" )
+431     protected ProjectDependenciesResolver dependencyResolver;
+432 
+433     
+434     private VelocityEngine velocity;
+435     
+436     @SuppressWarnings( "unchecked" )
+437     public void execute()
+438         throws MojoExecutionException
+439     {
+440         if ( skip )
+441         {
+442             return;
+443         }
+444 
+445         if ( runOnlyAtExecutionRoot && !isExecutionRoot() )
+446         {
+447             getLog().info( "Skipping remote-resource generation in this project because it's not the Execution Root" );
+448             return;
+449         }
+450         if ( resolveScopes == null )
+451         {
+452             if ( excludeScope == null || "".equals( excludeScope ) )
+453             {
+454                 resolveScopes = new String[] { this.includeScope };
+455             }
+456             else
+457             {
+458                 resolveScopes = new String[] { Artifact.SCOPE_TEST };
+459             }
+460         }
+461         velocity = new VelocityEngine();
+462         velocity.setProperty( VelocityEngine.RUNTIME_LOG_LOGSYSTEM, this );
+463         velocity.setProperty( "resource.loader", "classpath" );
+464         velocity.setProperty( "classpath.resource.loader.class", ClasspathResourceLoader.class.getName() );
+465         velocity.init();
+466 
+467         if ( supplementalModels == null )
+468         {
+469             File sups = new File( appendedResourcesDirectory, "supplemental-models.xml" );
+470             if ( sups.exists() )
+471             {
+472                 try
+473                 {
+474                     supplementalModels = new String[]{ sups.toURI().toURL().toString() };
+475                 }
+476                 catch ( MalformedURLException e )
+477                 {
+478                     //ignore
+479                     getLog().debug( "URL issue with supplemental-models.xml: " + e.toString() );
+480                 }
+481             }
+482         }
+483 
+484         addSupplementalModelArtifacts();
+485         locator.addSearchPath( FileResourceLoader.ID, project.getFile().getParentFile().getAbsolutePath() );
+486         if ( appendedResourcesDirectory != null )
+487         {
+488             locator.addSearchPath( FileResourceLoader.ID, appendedResourcesDirectory.getAbsolutePath() );
+489         }
+490         locator.addSearchPath( "url", "" );
+491         locator.setOutputDirectory( new File( project.getBuild().getDirectory() ) );
+492 
+493         if ( includeProjectProperties )
+494         {
+495             final Properties projectProperties = project.getProperties();
+496             for ( Object key : projectProperties.keySet() )
+497             {
+498                 properties.put( key.toString(), projectProperties.get( key ).toString() );
+499             }
+500         }
+501 
+502         ClassLoader origLoader = Thread.currentThread().getContextClassLoader();
+503         try
+504         {
+505             Thread.currentThread().setContextClassLoader( this.getClass().getClassLoader() );
+506 
+507             validate();
+508 
+509             List<File> resourceBundleArtifacts = downloadBundles( resourceBundles );
+510             supplementModels = loadSupplements( supplementalModels );
+511 
+512             VelocityContext context = new VelocityContext( properties );
+513             configureVelocityContext( context );
+514 
+515             RemoteResourcesClassLoader classLoader = new RemoteResourcesClassLoader( null );
+516 
+517             initalizeClassloader( classLoader, resourceBundleArtifacts );
+518             Thread.currentThread().setContextClassLoader( classLoader );
+519 
+520             processResourceBundles( classLoader, context );
+521 
+522             try
+523             {
+524                 if ( outputDirectory.exists() )
+525                 {
+526                     // ----------------------------------------------------------------------------
+527                     // Push our newly generated resources directory into the MavenProject so that
+528                     // these resources can be picked up by the process-resources phase.
+529                     // ----------------------------------------------------------------------------
+530                     Resource resource = new Resource();
+531                     resource.setDirectory( outputDirectory.getAbsolutePath() );
+532                     // MRRESOURCES-61 handle main and test resources separately
+533                     if ( attached && attachToMain )
+534                     {
+535                         project.getResources().add( resource );
+536                     }
+537                     if ( attached && attachToTest )
+538                     {
+539                         project.getTestResources().add( resource );
+540                     }
+541 
+542                     // ----------------------------------------------------------------------------
+543                     // Write out archiver dot file
+544                     // ----------------------------------------------------------------------------
+545                     File dotFile = new File( project.getBuild().getDirectory(), ".plxarc" );
+546                     FileUtils.mkdir( dotFile.getParentFile().getAbsolutePath() );
+547                     FileUtils.fileWrite( dotFile.getAbsolutePath(), outputDirectory.getName() );
+548                 }
+549             }
+550             catch ( IOException e )
+551             {
+552                 throw new MojoExecutionException( "Error creating dot file for archiving instructions.", e );
+553             }
+554         }
+555         finally
+556         {
+557             Thread.currentThread().setContextClassLoader( origLoader );
+558         }
+559     }
+560 
+561     private boolean isExecutionRoot()
+562     {
+563         Log log = this.getLog();
+564 
+565         boolean result = mavenSession.getExecutionRootDirectory().equalsIgnoreCase( basedir.toString() );
+566 
+567         if ( log.isDebugEnabled() )
+568         {
+569             log.debug( "Root Folder:" + mavenSession.getExecutionRootDirectory() );
+570             log.debug( "Current Folder:" + basedir );
+571 
+572             if ( result )
+573             {
+574                 log.debug( "This is the execution root." );
+575             }
+576             else
+577             {
+578                 log.debug( "This is NOT the execution root." );
+579             }
+580         }
+581 
+582         return result;
+583     }
+584 
+585     private void addSupplementalModelArtifacts()
+586         throws MojoExecutionException
+587     {
+588         if ( supplementalModelArtifacts != null && !supplementalModelArtifacts.isEmpty() )
+589         {
+590             List<File> artifacts = downloadBundles( supplementalModelArtifacts );
+591 
+592             for ( File artifact : artifacts )
+593             {
+594                 if ( artifact.isDirectory() )
+595                 {
+596                     locator.addSearchPath( FileResourceLoader.ID, artifact.getAbsolutePath() );
+597                 }
+598                 else
+599                 {
+600                     try
+601                     {
+602                         locator.addSearchPath( "jar", "jar:" + artifact.toURI().toURL().toExternalForm() );
+603                     }
+604                     catch ( MalformedURLException e )
+605                     {
+606                         throw new MojoExecutionException( "Could not use jar " + artifact.getAbsolutePath(), e );
+607                     }
+608                 }
+609             }
+610 
+611 
+612         }
+613     }
+614 
+615     @SuppressWarnings( "unchecked" )
+616     protected List<MavenProject> getProjects()
+617         throws MojoExecutionException
+618     {
+619         List<MavenProject> projects = new ArrayList<MavenProject>();
+620 
+621         // add filters in well known order, least specific to most specific
+622         FilterArtifacts filter = new FilterArtifacts();
+623 
+624         Set<Artifact> artifacts = resolveProjectArtifacts();
+625         if ( this.excludeTransitive )
+626         {
+627             Set<Artifact> depArtifacts;
+628             if ( runOnlyAtExecutionRoot )
+629             {
+630                 depArtifacts = aggregateProjectDependencyArtifacts();
+631             }
+632             else
+633             {
+634                 depArtifacts = project.getDependencyArtifacts();
+635             }
+636             filter.addFilter( new ProjectTransitivityFilter( depArtifacts, true ) );
+637         }
+638 
+639         filter.addFilter( new ScopeFilter( this.includeScope, this.excludeScope ) );
+640         filter.addFilter( new GroupIdFilter( this.includeGroupIds, this.excludeGroupIds ) );
+641         filter.addFilter( new ArtifactIdFilter( this.includeArtifactIds, this.excludeArtifactIds ) );
+642 
+643         // perform filtering
+644         try
+645         {
+646             artifacts = filter.filter( artifacts );
+647         }
+648         catch ( ArtifactFilterException e )
+649         {
+650             throw new MojoExecutionException( e.getMessage(), e );
+651         }
+652 
+653         for ( Artifact artifact : artifacts )
+654         {
+655             try
+656             {
+657                 List<ArtifactRepository> remoteRepo = remoteArtifactRepositories;
+658                 if ( artifact.isSnapshot() )
+659                 {
+660                     VersionRange rng = VersionRange.createFromVersion( artifact.getBaseVersion() );
+661                     artifact =
+662                         artifactFactory.createDependencyArtifact( artifact.getGroupId(), artifact.getArtifactId(), rng,
+663                                                                   artifact.getType(), artifact.getClassifier(),
+664                                                                   artifact.getScope(), null, artifact.isOptional() );
+665                 }
+666 
+667                 getLog().debug( "Building project for " + artifact );
+668                 MavenProject p = null;
+669                 try
+670                 {
+671                     p = mavenProjectBuilder.buildFromRepository( artifact, remoteRepo, localRepository );
+672                 }
+673                 catch ( InvalidProjectModelException e )
+674                 {
+675                     getLog().warn( "Invalid project model for artifact [" + artifact.getArtifactId() + ":" +
+676                                        artifact.getGroupId() + ":" + artifact.getVersion() + "]. " +
+677                                        "It will be ignored by the remote resources Mojo." );
+678                     continue;
+679                 }
+680 
+681                 String supplementKey =
+682                     generateSupplementMapKey( p.getModel().getGroupId(), p.getModel().getArtifactId() );
+683 
+684                 if ( supplementModels.containsKey( supplementKey ) )
+685                 {
+686                     Model mergedModel = mergeModels( p.getModel(), supplementModels.get( supplementKey ) );
+687                     MavenProject mergedProject = new MavenProject( mergedModel );
+688                     projects.add( mergedProject );
+689                     mergedProject.setArtifact( artifact );
+690                     mergedProject.setVersion( artifact.getVersion() );
+691                     getLog().debug( "Adding project with groupId [" + mergedProject.getGroupId() + "] (supplemented)" );
+692                 }
+693                 else
+694                 {
+695                     projects.add( p );
+696                     getLog().debug( "Adding project with groupId [" + p.getGroupId() + "]" );
+697                 }
+698             }
+699             catch ( ProjectBuildingException e )
+700             {
+701                 throw new MojoExecutionException( e.getMessage(), e );
+702             }
+703         }
+704         Collections.sort( projects, new ProjectComparator() );
+705         return projects;
+706     }
+707 
+708     private Set<Artifact> resolveProjectArtifacts()
+709         throws MojoExecutionException
+710     {
+711         try
+712         {
+713             if ( runOnlyAtExecutionRoot )
+714             {

[... 773 lines stripped ...]