mirror of https://github.com/apache/maven.git
reintroduced LineLength Checkstyle rule and fixed code...
This commit is contained in:
parent
be3fb20032
commit
eecdc9a171
|
@ -31,7 +31,7 @@
|
|||
</scm>
|
||||
|
||||
<properties>
|
||||
<checkstyle.violation.ignore>RedundantThrows,NewlineAtEndOfFile,ParameterNumber,MethodLength,FileLength,JavadocType,LineLength,MethodName,MagicNumber,ConstantName,VisibilityModifier,InnerAssignment</checkstyle.violation.ignore>
|
||||
<checkstyle.violation.ignore>RedundantThrows,NewlineAtEndOfFile,ParameterNumber,MethodLength,FileLength,JavadocType,MethodName,MagicNumber,ConstantName,VisibilityModifier,InnerAssignment</checkstyle.violation.ignore>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
|
|
@ -49,7 +49,8 @@ public class DefaultArtifactFilterManager
|
|||
private final Set<String> coreArtifacts;
|
||||
|
||||
@Inject
|
||||
public DefaultArtifactFilterManager( List<ArtifactFilterManagerDelegate> delegates, CoreExportsProvider coreExports )
|
||||
public DefaultArtifactFilterManager( List<ArtifactFilterManagerDelegate> delegates,
|
||||
CoreExportsProvider coreExports )
|
||||
{
|
||||
this.delegates = delegates;
|
||||
this.coreArtifacts = coreExports.get().getExportedArtifacts();
|
||||
|
|
|
@ -118,10 +118,8 @@ public class DefaultMaven
|
|||
}
|
||||
else
|
||||
{
|
||||
result = addExceptionToResult( new DefaultMavenExecutionResult(), new InternalErrorException(
|
||||
"Internal error: "
|
||||
+ e,
|
||||
e ) );
|
||||
result = addExceptionToResult( new DefaultMavenExecutionResult(),
|
||||
new InternalErrorException( "Internal error: " + e, e ) );
|
||||
}
|
||||
}
|
||||
finally
|
||||
|
@ -371,7 +369,8 @@ public class DefaultMaven
|
|||
|
||||
private Collection<AbstractMavenLifecycleParticipant> getLifecycleParticipants( Collection<MavenProject> projects )
|
||||
{
|
||||
Collection<AbstractMavenLifecycleParticipant> lifecycleListeners = new LinkedHashSet<AbstractMavenLifecycleParticipant>();
|
||||
Collection<AbstractMavenLifecycleParticipant> lifecycleListeners =
|
||||
new LinkedHashSet<AbstractMavenLifecycleParticipant>();
|
||||
|
||||
ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();
|
||||
try
|
||||
|
|
|
@ -127,7 +127,8 @@ public class DefaultProjectDependenciesResolver
|
|||
|
||||
if ( ! exclusions.isEmpty() )
|
||||
{
|
||||
filter = new AndArtifactFilter( Arrays.asList( new ArtifactFilter[]{ new ExcludesArtifactFilter( exclusions ), scopeFilter } ) );
|
||||
filter = new AndArtifactFilter( Arrays.asList( new ArtifactFilter[]{
|
||||
new ExcludesArtifactFilter( exclusions ), scopeFilter } ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -30,7 +30,8 @@ import org.apache.maven.project.MavenProject;
|
|||
|
||||
@Deprecated
|
||||
/**
|
||||
* @deprecated As of 3.2.2, and there is no direct replacement. This is an internal class which was not marked as such, but should have been.
|
||||
* @deprecated As of 3.2.2, and there is no direct replacement. This is an internal class which was not marked as such,
|
||||
* but should have been.
|
||||
* @author jvanzyl
|
||||
*
|
||||
*/
|
||||
|
@ -84,10 +85,11 @@ public interface ProjectDependenciesResolver
|
|||
* @param projects The projects whose dependencies should be resolved, may be {@code null}.
|
||||
* @param scopes The dependency scopes that should be resolved, may be {@code null}.
|
||||
* @param session The current build session, must not be {@code null}.
|
||||
* @return The transitive dependencies of the specified projects that match the requested scopes, never {@code null}
|
||||
* .
|
||||
* @return The transitive dependencies of the specified projects that match the requested scopes, never
|
||||
* {@code null}.
|
||||
*/
|
||||
Set<Artifact> resolve( Collection<? extends MavenProject> projects, Collection<String> scopes, MavenSession session )
|
||||
Set<Artifact> resolve( Collection<? extends MavenProject> projects, Collection<String> scopes,
|
||||
MavenSession session )
|
||||
throws ArtifactResolutionException, ArtifactNotFoundException;
|
||||
|
||||
}
|
||||
|
|
|
@ -28,7 +28,8 @@ import java.lang.annotation.Target;
|
|||
import com.google.inject.ScopeAnnotation;
|
||||
|
||||
/**
|
||||
* Indicates that annotated component should be instantiated before session starts and discarded after session execution completes.
|
||||
* Indicates that annotated component should be instantiated before session starts and discarded after session execution
|
||||
* completes.
|
||||
*
|
||||
* @author Jason van Zyl
|
||||
* @since 3.2.0
|
||||
|
|
|
@ -327,7 +327,8 @@ public class MavenRepositorySystem
|
|||
// Taken from LegacyRepositorySystem
|
||||
//
|
||||
|
||||
public static org.apache.maven.model.Repository fromSettingsRepository( org.apache.maven.settings.Repository settingsRepository )
|
||||
public static org.apache.maven.model.Repository fromSettingsRepository( org.apache.maven.settings.Repository
|
||||
settingsRepository )
|
||||
{
|
||||
org.apache.maven.model.Repository modelRepository = new org.apache.maven.model.Repository();
|
||||
modelRepository.setId( settingsRepository.getId() );
|
||||
|
@ -339,7 +340,8 @@ public class MavenRepositorySystem
|
|||
return modelRepository;
|
||||
}
|
||||
|
||||
public static org.apache.maven.model.RepositoryPolicy fromSettingsRepositoryPolicy( org.apache.maven.settings.RepositoryPolicy settingsRepositoryPolicy )
|
||||
public static org.apache.maven.model.RepositoryPolicy fromSettingsRepositoryPolicy(
|
||||
org.apache.maven.settings.RepositoryPolicy settingsRepositoryPolicy )
|
||||
{
|
||||
org.apache.maven.model.RepositoryPolicy modelRepositoryPolicy = new org.apache.maven.model.RepositoryPolicy();
|
||||
if ( settingsRepositoryPolicy != null )
|
||||
|
@ -390,7 +392,8 @@ public class MavenRepositorySystem
|
|||
}
|
||||
}
|
||||
|
||||
public static ArtifactRepositoryPolicy buildArtifactRepositoryPolicy( org.apache.maven.model.RepositoryPolicy policy )
|
||||
public static ArtifactRepositoryPolicy buildArtifactRepositoryPolicy( org.apache.maven.model.RepositoryPolicy
|
||||
policy )
|
||||
{
|
||||
boolean enabled = true;
|
||||
|
||||
|
@ -711,7 +714,8 @@ public class MavenRepositorySystem
|
|||
try
|
||||
{
|
||||
URL url = new URL( originalRepository.getUrl() );
|
||||
return !( url.getHost().equals( "localhost" ) || url.getHost().equals( "127.0.0.1" ) || url.getProtocol().equals( "file" ) );
|
||||
return !( url.getHost().equals( "localhost" ) || url.getHost().equals( "127.0.0.1" )
|
||||
|| url.getProtocol().equals( "file" ) );
|
||||
}
|
||||
catch ( MalformedURLException e )
|
||||
{
|
||||
|
|
|
@ -258,7 +258,8 @@ public class DefaultClassRealmManager
|
|||
parent = PARENT_CLASSLOADER;
|
||||
}
|
||||
|
||||
return createRealm( getKey( plugin, false ), RealmType.Plugin, parent, parentImports, foreignImports, artifacts );
|
||||
return createRealm( getKey( plugin, false ), RealmType.Plugin, parent, parentImports, foreignImports,
|
||||
artifacts );
|
||||
}
|
||||
|
||||
private static String getKey( Plugin plugin, boolean extension )
|
||||
|
|
|
@ -80,7 +80,8 @@ Plugins:
|
|||
|
||||
*/
|
||||
|
||||
//PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, CycleDetectedInPluginGraphException;
|
||||
// PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException,
|
||||
// CycleDetectedInPluginGraphException;
|
||||
|
||||
@Component( role = ExceptionHandler.class )
|
||||
public class DefaultExceptionHandler
|
||||
|
|
|
@ -186,7 +186,8 @@ public class DefaultMavenExecutionRequest
|
|||
copy.setGlobalSettingsFile( original.getGlobalSettingsFile() );
|
||||
copy.setUserToolchainsFile( original.getUserToolchainsFile() );
|
||||
copy.setGlobalToolchainsFile( original.getGlobalToolchainsFile() );
|
||||
copy.setBaseDirectory( ( original.getBaseDirectory() != null ) ? new File( original.getBaseDirectory() ) : null );
|
||||
copy.setBaseDirectory( ( original.getBaseDirectory() != null ) ? new File( original.getBaseDirectory() )
|
||||
: null );
|
||||
copy.setGoals( original.getGoals() );
|
||||
copy.setRecursive( original.isRecursive() );
|
||||
copy.setPom( original.getPom() );
|
||||
|
|
|
@ -147,11 +147,11 @@ public class DefaultMavenExecutionRequestPopulator
|
|||
}
|
||||
|
||||
List<Repository> pluginRepositories = rawProfile.getPluginRepositories();
|
||||
for ( Repository pluginRepository : pluginRepositories )
|
||||
for ( Repository pluginRepo : pluginRepositories )
|
||||
{
|
||||
try
|
||||
{
|
||||
request.addPluginArtifactRepository( repositorySystem.buildArtifactRepository( pluginRepository ) );
|
||||
request.addPluginArtifactRepository( repositorySystem.buildArtifactRepository( pluginRepo ) );
|
||||
}
|
||||
catch ( InvalidRepositoryException e )
|
||||
{
|
||||
|
@ -260,7 +260,8 @@ public class DefaultMavenExecutionRequestPopulator
|
|||
// <mirrors>
|
||||
// <mirror>
|
||||
// <id>central</id>
|
||||
// <!-- NOTE: We need to try and use the proper host name/ip as Java generally ignores proxies for "localhost" -->
|
||||
// <!-- NOTE: We need to try and use the proper host name/ip as Java generally ignores proxies for
|
||||
// "localhost" -->
|
||||
// <url>http://10.0.1.34:62247/</url>
|
||||
// <mirrorOf>central</mirrorOf>
|
||||
// </mirror>
|
||||
|
|
|
@ -302,8 +302,8 @@ public class MavenSession
|
|||
private final Settings settings;
|
||||
|
||||
@Deprecated
|
||||
public MavenSession( PlexusContainer container, RepositorySystemSession repositorySession, MavenExecutionRequest request,
|
||||
MavenExecutionResult result )
|
||||
public MavenSession( PlexusContainer container, RepositorySystemSession repositorySession,
|
||||
MavenExecutionRequest request, MavenExecutionResult result )
|
||||
{
|
||||
this.container = container;
|
||||
this.request = request;
|
||||
|
|
|
@ -118,7 +118,8 @@ public class DefaultGraphBuilder
|
|||
|
||||
if ( activeProjects.size() != projectDependencyGraph.getSortedProjects().size() )
|
||||
{
|
||||
projectDependencyGraph = new FilteredProjectDependencyGraph( projectDependencyGraph, activeProjects );
|
||||
projectDependencyGraph =
|
||||
new FilteredProjectDependencyGraph( projectDependencyGraph, activeProjects );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -377,11 +378,11 @@ public class DefaultGraphBuilder
|
|||
return result;
|
||||
}
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Project collection
|
||||
//
|
||||
// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private List<MavenProject> getProjectsForMavenReactor( MavenSession session )
|
||||
throws ProjectBuildingException
|
||||
|
|
|
@ -170,7 +170,8 @@ public class DefaultLifecycleExecutor
|
|||
public List<MavenProject> executeForkedExecutions( MojoExecution mojoExecution, MavenSession session )
|
||||
throws LifecycleExecutionException
|
||||
{
|
||||
return mojoExecutor.executeForkedExecutions( mojoExecution, session, new ProjectIndex( session.getProjects() ) );
|
||||
return mojoExecutor.executeForkedExecutions( mojoExecution, session,
|
||||
new ProjectIndex( session.getProjects() ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -23,8 +23,8 @@ import org.apache.maven.plugin.MojoExecution;
|
|||
import org.apache.maven.project.MavenProject;
|
||||
|
||||
/**
|
||||
* A MojoExecutionConfigurator is responsible for creating the configuration for Mojo based on configuration for a Mojo in the MavenProject
|
||||
* and the default configuration for the Mojo from the containing plugin's plugin.xml descriptor.
|
||||
* A MojoExecutionConfigurator is responsible for creating the configuration for Mojo based on configuration for a Mojo
|
||||
* in the MavenProject and the default configuration for the Mojo from the containing plugin's plugin.xml descriptor.
|
||||
*
|
||||
* @provisional
|
||||
* @author Jason van Zyl
|
||||
|
|
|
@ -168,7 +168,8 @@ public class DefaultLifecycleExecutionPlanCalculator
|
|||
{
|
||||
mojoDescriptor =
|
||||
pluginManager.getMojoDescriptor( mojoExecution.getPlugin(), mojoExecution.getGoal(),
|
||||
project.getRemotePluginRepositories(), session.getRepositorySession() );
|
||||
project.getRemotePluginRepositories(),
|
||||
session.getRepositorySession() );
|
||||
|
||||
mojoExecution.setMojoDescriptor( mojoDescriptor );
|
||||
}
|
||||
|
@ -204,7 +205,8 @@ public class DefaultLifecycleExecutionPlanCalculator
|
|||
|
||||
MojoDescriptor mojoDescriptor = mojoDescriptorCreator.getMojoDescriptor( pluginGoal, session, project );
|
||||
|
||||
MojoExecution mojoExecution = new MojoExecution( mojoDescriptor, executionId, MojoExecution.Source.CLI );
|
||||
MojoExecution mojoExecution = new MojoExecution( mojoDescriptor, executionId,
|
||||
MojoExecution.Source.CLI );
|
||||
|
||||
mojoExecutions.add( mojoExecution );
|
||||
}
|
||||
|
@ -298,7 +300,8 @@ public class DefaultLifecycleExecutionPlanCalculator
|
|||
|
||||
Xpp3Dom parameterDefaults = defaultConfiguration.getChild( parameter.getName() );
|
||||
|
||||
parameterConfiguration = Xpp3Dom.mergeXpp3Dom( parameterConfiguration, parameterDefaults, Boolean.TRUE );
|
||||
parameterConfiguration = Xpp3Dom.mergeXpp3Dom( parameterConfiguration, parameterDefaults,
|
||||
Boolean.TRUE );
|
||||
|
||||
if ( parameterConfiguration != null )
|
||||
{
|
||||
|
@ -369,7 +372,8 @@ public class DefaultLifecycleExecutionPlanCalculator
|
|||
}
|
||||
else
|
||||
{
|
||||
forkedExecutions = calculateForkedGoal( mojoExecution, session, forkedProject, alreadyForkedExecutions );
|
||||
forkedExecutions = calculateForkedGoal( mojoExecution, session, forkedProject,
|
||||
alreadyForkedExecutions );
|
||||
}
|
||||
|
||||
mojoExecution.setForkedExecutions( BuilderCommon.getKey( forkedProject ), forkedExecutions );
|
||||
|
@ -389,7 +393,8 @@ public class DefaultLifecycleExecutionPlanCalculator
|
|||
|
||||
String forkedPhase = mojoDescriptor.getExecutePhase();
|
||||
|
||||
Map<String, List<MojoExecution>> lifecycleMappings = calculateLifecycleMappings( session, project, forkedPhase );
|
||||
Map<String, List<MojoExecution>> lifecycleMappings = calculateLifecycleMappings( session, project,
|
||||
forkedPhase );
|
||||
|
||||
for ( List<MojoExecution> forkedExecutions : lifecycleMappings.values() )
|
||||
{
|
||||
|
|
|
@ -203,7 +203,8 @@ public class LifecycleDependencyResolver
|
|||
* plugins that require dependency resolution although they usually run in phases of the build where project
|
||||
* artifacts haven't been assembled yet. The prime example of this is "mvn release:prepare".
|
||||
*/
|
||||
if ( aggregating && areAllDependenciesInReactor( session.getProjects(), result.getUnresolvedDependencies() ) )
|
||||
if ( aggregating && areAllDependenciesInReactor( session.getProjects(),
|
||||
result.getUnresolvedDependencies() ) )
|
||||
{
|
||||
logger.warn( "The following dependencies could not be resolved at this point of the build"
|
||||
+ " but seem to be part of the reactor:" );
|
||||
|
@ -232,7 +233,8 @@ public class LifecycleDependencyResolver
|
|||
return artifacts;
|
||||
}
|
||||
|
||||
private boolean areAllDependenciesInReactor( Collection<MavenProject> projects, Collection<Dependency> dependencies )
|
||||
private boolean areAllDependenciesInReactor( Collection<MavenProject> projects,
|
||||
Collection<Dependency> dependencies )
|
||||
{
|
||||
Set<String> projectKeys = getReactorProjectKeys( projects );
|
||||
|
||||
|
|
|
@ -120,7 +120,8 @@ public class LifecycleModuleBuilder
|
|||
projectExecutionListener.afterProjectExecutionSuccess( new ProjectExecutionEvent( session, currentProject,
|
||||
mojoExecutions ) );
|
||||
|
||||
reactorContext.getResult().addBuildSummary( new BuildSuccess( currentProject, buildEndTime - buildStartTime ) );
|
||||
reactorContext.getResult().addBuildSummary( new BuildSuccess( currentProject,
|
||||
buildEndTime - buildStartTime ) );
|
||||
|
||||
eventCatapult.fire( ExecutionEvent.Type.ProjectSucceeded, session, null );
|
||||
}
|
||||
|
|
|
@ -114,14 +114,16 @@ public class LifecycleStarter
|
|||
Builder builder = builders.get( builderId );
|
||||
if ( builder == null )
|
||||
{
|
||||
throw new BuilderNotFoundException( String.format( "The builder requested using id = %s cannot be found", builderId ) );
|
||||
throw new BuilderNotFoundException( String.format( "The builder requested using id = %s cannot be"
|
||||
+ " found", builderId ) );
|
||||
}
|
||||
|
||||
int degreeOfConcurrency = session.getRequest().getDegreeOfConcurrency();
|
||||
if ( degreeOfConcurrency >= 2 )
|
||||
{
|
||||
logger.info( "" );
|
||||
logger.info( String.format( "Using the %s implementation with a thread count of %d", builder.getClass().getSimpleName(), degreeOfConcurrency ) );
|
||||
logger.info( String.format( "Using the %s implementation with a thread count of %d",
|
||||
builder.getClass().getSimpleName(), degreeOfConcurrency ) );
|
||||
}
|
||||
builder.build( session, reactorContext, projectBuilds, taskSegments, reactorBuildStatus );
|
||||
|
||||
|
|
|
@ -29,13 +29,11 @@ import org.apache.maven.lifecycle.internal.ReactorContext;
|
|||
import org.apache.maven.lifecycle.internal.TaskSegment;
|
||||
|
||||
/**
|
||||
*
|
||||
* A {@link Builder} encapsulates a strategy for building a set of Maven projects. The default strategy in Maven builds the
|
||||
* the projects serially, but a {@link Builder} can employ any type of concurrency model to build the projects.
|
||||
* A {@link Builder} encapsulates a strategy for building a set of Maven projects. The default strategy in Maven builds
|
||||
* the the projects serially, but a {@link Builder} can employ any type of concurrency model to build the projects.
|
||||
*
|
||||
* @author jvanzyl
|
||||
* @provisional
|
||||
*
|
||||
*/
|
||||
public interface Builder
|
||||
{
|
||||
|
|
|
@ -188,8 +188,8 @@ public class BuilderCommon
|
|||
}
|
||||
}
|
||||
|
||||
// Todo: I'm really wondering where this method belongs; smells like it should be on MavenProject, but for some reason
|
||||
// it isn't ? This localization is kind-of a code smell.
|
||||
// Todo: I'm really wondering where this method belongs; smells like it should be on MavenProject, but for some
|
||||
// reason it isn't ? This localization is kind-of a code smell.
|
||||
|
||||
public static String getKey( MavenProject project )
|
||||
{
|
||||
|
|
|
@ -75,8 +75,10 @@ public class DefaultBuildPluginManager
|
|||
* @throws PluginResolutionException The plugin could be found but could not be resolved.
|
||||
* @throws InvalidPluginDescriptorException
|
||||
*/
|
||||
public PluginDescriptor loadPlugin( Plugin plugin, List<RemoteRepository> repositories, RepositorySystemSession session )
|
||||
throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, InvalidPluginDescriptorException
|
||||
public PluginDescriptor loadPlugin( Plugin plugin, List<RemoteRepository> repositories,
|
||||
RepositorySystemSession session )
|
||||
throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException,
|
||||
InvalidPluginDescriptorException
|
||||
{
|
||||
return mavenPluginManager.getPluginDescriptor( plugin, repositories, session );
|
||||
}
|
||||
|
|
|
@ -50,7 +50,8 @@ public interface MavenPluginManager
|
|||
* @param session The repository session to use for resolving the plugin's main artifact, must not be {@code null}.
|
||||
* @return The plugin descriptor, never {@code null}.
|
||||
*/
|
||||
PluginDescriptor getPluginDescriptor( Plugin plugin, List<RemoteRepository> repositories, RepositorySystemSession session )
|
||||
PluginDescriptor getPluginDescriptor( Plugin plugin, List<RemoteRepository> repositories,
|
||||
RepositorySystemSession session )
|
||||
throws PluginResolutionException, PluginDescriptorParsingException, InvalidPluginDescriptorException;
|
||||
|
||||
/**
|
||||
|
|
|
@ -42,7 +42,8 @@ public class PluginContainerException
|
|||
|
||||
private ClassRealm pluginRealm;
|
||||
|
||||
public PluginContainerException( MojoDescriptor mojoDescriptor, ClassRealm pluginRealm, String message, Throwable e )
|
||||
public PluginContainerException( MojoDescriptor mojoDescriptor, ClassRealm pluginRealm, String message,
|
||||
Throwable e )
|
||||
{
|
||||
super( mojoDescriptor, message, e );
|
||||
|
||||
|
|
|
@ -35,7 +35,8 @@ public class PluginExecutionException
|
|||
this.mojoExecution = mojoExecution;
|
||||
}
|
||||
|
||||
public PluginExecutionException( MojoExecution mojoExecution, MavenProject project, String message, Throwable cause )
|
||||
public PluginExecutionException( MojoExecution mojoExecution, MavenProject project, String message,
|
||||
Throwable cause )
|
||||
{
|
||||
super( mojoExecution.getMojoDescriptor(), project, message, cause );
|
||||
this.mojoExecution = mojoExecution;
|
||||
|
|
|
@ -38,20 +38,28 @@ import org.codehaus.plexus.util.introspection.ReflectionValueExtractor;
|
|||
* <tr><th>expression</th> <th></th> <th>evaluation result</th></tr>
|
||||
* <tr><td><code>session</code></td> <td></td> <td>the actual {@link MavenSession}</td></tr>
|
||||
* <tr><td><code>session.*</code></td> <td>(since Maven 3)</td><td></td></tr>
|
||||
* <tr><td><code>localRepository</code></td> <td></td> <td>{@link MavenSession#getLocalRepository()}</td></tr>
|
||||
* <tr><td><code>localRepository</code></td> <td></td>
|
||||
* <td>{@link MavenSession#getLocalRepository()}</td></tr>
|
||||
* <tr><td><code>reactorProjects</code></td> <td></td> <td>{@link MavenSession#getProjects()}</td></tr>
|
||||
* <tr><td><code>repositorySystemSession</code></td><td> (since Maven 3)</td><td>{@link MavenSession#getRepositorySession()}</td></tr>
|
||||
* <tr><td><code>project</code></td> <td></td> <td>{@link MavenSession#getCurrentProject()}</td></tr>
|
||||
* <tr><td><code>repositorySystemSession</code></td><td> (since Maven 3)</td>
|
||||
* <td>{@link MavenSession#getRepositorySession()}</td></tr>
|
||||
* <tr><td><code>project</code></td> <td></td>
|
||||
* <td>{@link MavenSession#getCurrentProject()}</td></tr>
|
||||
* <tr><td><code>project.*</code></td> <td></td> <td></td></tr>
|
||||
* <tr><td><code>pom.*</code></td> <td>(since Maven 3)</td><td>same as <code>project.*</code></td></tr>
|
||||
* <tr><td><code>executedProject</code></td> <td></td> <td>{@link MavenProject#getExecutionProject()}</td></tr>
|
||||
* <tr><td><code>executedProject</code></td> <td></td>
|
||||
* <td>{@link MavenProject#getExecutionProject()}</td></tr>
|
||||
* <tr><td><code>settings</code></td> <td></td> <td>{@link MavenSession#getSettings()}</td></tr>
|
||||
* <tr><td><code>settings.*</code></td> <td></td> <td></td></tr>
|
||||
* <tr><td><code>basedir</code></td> <td></td> <td>{@link MavenSession#getExecutionRootDirectory()} or <code>System.getProperty( "user.dir" )</code> if null</td></tr>
|
||||
* <tr><td><code>basedir</code></td> <td></td>
|
||||
* <td>{@link MavenSession#getExecutionRootDirectory()} or
|
||||
* <code>System.getProperty( "user.dir" )</code> if null</td></tr>
|
||||
* <tr><td><code>mojoExecution</code></td> <td></td> <td>the actual {@link MojoExecution}</td></tr>
|
||||
* <tr><td><code>mojo</code></td> <td>(since Maven 3)</td><td>same as <code>mojoExecution</code></td></tr>
|
||||
* <tr><td><code>mojo.*</code></td> <td>(since Maven 3)</td><td></td></tr>
|
||||
* <tr><td><code>plugin</code></td> <td>(since Maven 3)</td><td>{@link MojoExecution#getMojoDescriptor()}.{@link MojoDescriptor#getPluginDescriptor() getPluginDescriptor()}</td></tr>
|
||||
* <tr><td><code>plugin</code></td> <td>(since Maven 3)</td>
|
||||
* <td>{@link MojoExecution#getMojoDescriptor()}.{@link MojoDescriptor#getPluginDescriptor()
|
||||
* getPluginDescriptor()}</td></tr>
|
||||
* <tr><td><code>plugin.*</code></td> <td></td> <td></td></tr>
|
||||
* <tr><td><code>*</code></td> <td></td> <td>system properties</td></tr>
|
||||
* <tr><td><code>*</code></td> <td></td> <td>project properties</td></tr>
|
||||
|
|
|
@ -38,7 +38,8 @@ public class DefaultLegacySupport
|
|||
implements LegacySupport
|
||||
{
|
||||
|
||||
private static final ThreadLocal<AtomicReference<MavenSession>> SESSION = new InheritableThreadLocal<AtomicReference<MavenSession>>();
|
||||
private static final ThreadLocal<AtomicReference<MavenSession>> SESSION =
|
||||
new InheritableThreadLocal<AtomicReference<MavenSession>>();
|
||||
|
||||
public void setSession( MavenSession session )
|
||||
{
|
||||
|
|
|
@ -878,7 +878,8 @@ public class DefaultMavenPluginManager
|
|||
extensionRecord = extensionRealmCache.get( extensionKey );
|
||||
if ( extensionRecord == null )
|
||||
{
|
||||
ClassRealm extensionRealm = classRealmManager.createExtensionRealm( plugin, toAetherArtifacts( artifacts ) );
|
||||
ClassRealm extensionRealm = classRealmManager.createExtensionRealm( plugin,
|
||||
toAetherArtifacts( artifacts ) );
|
||||
|
||||
// TODO figure out how to use the same PluginDescriptor when running mojos
|
||||
|
||||
|
|
|
@ -154,7 +154,8 @@ public class DefaultPluginDependenciesResolver
|
|||
DependencyFilter resolutionFilter =
|
||||
new ExclusionsDependencyFilter( artifactFilterManager.getCoreArtifactExcludes() );
|
||||
resolutionFilter = AndDependencyFilter.newInstance( resolutionFilter, dependencyFilter );
|
||||
return resolveInternal( plugin, pluginArtifact, resolutionFilter, new PlexusUtilsInjector(), repositories, session );
|
||||
return resolveInternal( plugin, pluginArtifact, resolutionFilter, new PlexusUtilsInjector(), repositories,
|
||||
session );
|
||||
}
|
||||
|
||||
private DependencyNode resolveInternal( Plugin plugin, Artifact pluginArtifact, DependencyFilter dependencyFilter,
|
||||
|
|
|
@ -84,7 +84,8 @@ public class DefaultPluginVersionRequest
|
|||
* @param session The repository session to use, must not be {@code null}.
|
||||
* @param repositories The plugin repositories to query, may be {@code null}.
|
||||
*/
|
||||
public DefaultPluginVersionRequest( Plugin plugin, RepositorySystemSession session, List<RemoteRepository> repositories )
|
||||
public DefaultPluginVersionRequest( Plugin plugin, RepositorySystemSession session,
|
||||
List<RemoteRepository> repositories )
|
||||
{
|
||||
setGroupId( plugin.getGroupId() );
|
||||
setArtifactId( plugin.getArtifactId() );
|
||||
|
|
|
@ -40,7 +40,8 @@ public class DefaultMavenProjectHelper
|
|||
@Requirement
|
||||
private ArtifactHandlerManager artifactHandlerManager;
|
||||
|
||||
public void attachArtifact( MavenProject project, String artifactType, String artifactClassifier, File artifactFile )
|
||||
public void attachArtifact( MavenProject project, String artifactType, String artifactClassifier,
|
||||
File artifactFile )
|
||||
{
|
||||
String type = artifactType;
|
||||
|
||||
|
|
|
@ -399,7 +399,8 @@ public class DefaultProjectBuilder
|
|||
Map<String, MavenProject> projectIndex = new HashMap<String, MavenProject>( 256 );
|
||||
|
||||
boolean noErrors =
|
||||
build( results, interimResults, projectIndex, pomFiles, new LinkedHashSet<File>(), true, recursive, config );
|
||||
build( results, interimResults, projectIndex, pomFiles, new LinkedHashSet<File>(), true, recursive,
|
||||
config );
|
||||
|
||||
populateReactorModelPool( modelPool, interimResults );
|
||||
|
||||
|
@ -635,7 +636,8 @@ public class DefaultProjectBuilder
|
|||
}
|
||||
catch ( ModelBuildingException e )
|
||||
{
|
||||
results.add( new DefaultProjectBuildingResult( e.getModelId(), interimResult.pomFile, e.getProblems() ) );
|
||||
results.add( new DefaultProjectBuildingResult( e.getModelId(), interimResult.pomFile,
|
||||
e.getProblems() ) );
|
||||
|
||||
noErrors = false;
|
||||
}
|
||||
|
@ -826,17 +828,19 @@ public class DefaultProjectBuilder
|
|||
project.setManagedVersionMap( map );
|
||||
|
||||
// release artifact repository
|
||||
if ( project.getDistributionManagement() != null && project.getDistributionManagement().getRepository() != null )
|
||||
if ( project.getDistributionManagement() != null
|
||||
&& project.getDistributionManagement().getRepository() != null )
|
||||
{
|
||||
try
|
||||
{
|
||||
DeploymentRepository r = project.getDistributionManagement().getRepository();
|
||||
if ( !StringUtils.isEmpty( r.getId() ) && !StringUtils.isEmpty( r.getUrl() ) )
|
||||
{
|
||||
ArtifactRepository repo =
|
||||
repositorySystem.buildArtifactRepository( project.getDistributionManagement().getRepository() );
|
||||
repositorySystem.injectProxy( projectBuildingRequest.getRepositorySession(), Arrays.asList( repo ) );
|
||||
repositorySystem.injectAuthentication( projectBuildingRequest.getRepositorySession(), Arrays.asList( repo ) );
|
||||
ArtifactRepository repo = repositorySystem.buildArtifactRepository( r );
|
||||
repositorySystem.injectProxy( projectBuildingRequest.getRepositorySession(),
|
||||
Arrays.asList( repo ) );
|
||||
repositorySystem.injectAuthentication( projectBuildingRequest.getRepositorySession(),
|
||||
Arrays.asList( repo ) );
|
||||
project.setReleaseArtifactRepository( repo );
|
||||
}
|
||||
}
|
||||
|
@ -856,10 +860,11 @@ public class DefaultProjectBuilder
|
|||
DeploymentRepository r = project.getDistributionManagement().getSnapshotRepository();
|
||||
if ( !StringUtils.isEmpty( r.getId() ) && !StringUtils.isEmpty( r.getUrl() ) )
|
||||
{
|
||||
ArtifactRepository repo =
|
||||
repositorySystem.buildArtifactRepository( project.getDistributionManagement().getSnapshotRepository() );
|
||||
repositorySystem.injectProxy( projectBuildingRequest.getRepositorySession(), Arrays.asList( repo ) );
|
||||
repositorySystem.injectAuthentication( projectBuildingRequest.getRepositorySession(), Arrays.asList( repo ) );
|
||||
ArtifactRepository repo = repositorySystem.buildArtifactRepository( r );
|
||||
repositorySystem.injectProxy( projectBuildingRequest.getRepositorySession(),
|
||||
Arrays.asList( repo ) );
|
||||
repositorySystem.injectAuthentication( projectBuildingRequest.getRepositorySession(),
|
||||
Arrays.asList( repo ) );
|
||||
project.setSnapshotArtifactRepository( repo );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1249,7 +1249,7 @@ public class MavenProject
|
|||
|
||||
if ( project.getPluginArtifactRepositories() != null )
|
||||
{
|
||||
setPluginArtifactRepositories( ( Collections.unmodifiableList( project.getPluginArtifactRepositories() ) ) );
|
||||
setPluginArtifactRepositories( Collections.unmodifiableList( project.getPluginArtifactRepositories() ) );
|
||||
}
|
||||
|
||||
if ( project.getActiveProfiles() != null )
|
||||
|
@ -1458,17 +1458,17 @@ public class MavenProject
|
|||
lifecyclePhases.add( lifecyclePhase );
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
// D E P R E C A T E D
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------------------------------------------
|
||||
//
|
||||
// Everything below will be removed for Maven 4.0.0
|
||||
//
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------------------------------------------
|
||||
|
||||
private ProjectBuildingRequest projectBuilderConfiguration;
|
||||
|
||||
|
@ -1531,7 +1531,8 @@ public class MavenProject
|
|||
}
|
||||
|
||||
@Deprecated
|
||||
public Set<Artifact> createArtifacts( ArtifactFactory artifactFactory, String inheritedScope, ArtifactFilter filter )
|
||||
public Set<Artifact> createArtifacts( ArtifactFactory artifactFactory, String inheritedScope,
|
||||
ArtifactFilter filter )
|
||||
throws InvalidDependencyVersionException
|
||||
{
|
||||
return MavenMetadataSource.createArtifacts( artifactFactory, getDependencies(), inheritedScope, filter, this );
|
||||
|
|
|
@ -70,6 +70,7 @@ public interface MavenProjectHelper
|
|||
* @param includes include patterns.
|
||||
* @param excludes exclude patterns.
|
||||
*/
|
||||
void addTestResource( MavenProject project, String resourceDirectory, List<String> includes, List<String> excludes );
|
||||
void addTestResource( MavenProject project, String resourceDirectory, List<String> includes,
|
||||
List<String> excludes );
|
||||
|
||||
}
|
||||
|
|
|
@ -84,7 +84,8 @@ public class ProjectModelResolver
|
|||
|
||||
public ProjectModelResolver( RepositorySystemSession session, RequestTrace trace, RepositorySystem resolver,
|
||||
RemoteRepositoryManager remoteRepositoryManager, List<RemoteRepository> repositories,
|
||||
ProjectBuildingRequest.RepositoryMerging repositoryMerging, ReactorModelPool modelPool )
|
||||
ProjectBuildingRequest.RepositoryMerging repositoryMerging,
|
||||
ReactorModelPool modelPool )
|
||||
{
|
||||
this.session = session;
|
||||
this.trace = trace;
|
||||
|
|
|
@ -80,7 +80,8 @@ public interface RepositorySystem
|
|||
throws InvalidRepositoryException;
|
||||
|
||||
ArtifactRepository createArtifactRepository( String id, String url, ArtifactRepositoryLayout repositoryLayout,
|
||||
ArtifactRepositoryPolicy snapshots, ArtifactRepositoryPolicy releases );
|
||||
ArtifactRepositoryPolicy snapshots,
|
||||
ArtifactRepositoryPolicy releases );
|
||||
|
||||
/**
|
||||
* Calculates the effective repositories for the given input repositories which are assumed to be already mirrored
|
||||
|
|
|
@ -82,7 +82,8 @@ public class DefaultRuntimeInformation
|
|||
}
|
||||
else
|
||||
{
|
||||
logger.warn( "Could not locate " + resource + " on classpath, Maven runtime information not available" );
|
||||
logger.warn( "Could not locate " + resource
|
||||
+ " on classpath, Maven runtime information not available" );
|
||||
}
|
||||
|
||||
String version = props.getProperty( "version", "" ).trim();
|
||||
|
|
|
@ -74,7 +74,8 @@ public class DefaultToolchainManager
|
|||
return selectToolchains( models, type, requirements );
|
||||
}
|
||||
|
||||
private List<Toolchain> selectToolchains( List<ToolchainModel> models, String type, Map<String, String> requirements )
|
||||
private List<Toolchain> selectToolchains( List<ToolchainModel> models, String type,
|
||||
Map<String, String> requirements )
|
||||
{
|
||||
List<Toolchain> toolchains = new ArrayList<Toolchain>();
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ public class DefaultToolchainsBuilder
|
|||
{
|
||||
ProblemCollector problems = ProblemCollectorFactory.newInstance( null );
|
||||
|
||||
PersistedToolchains globalToolchains = readToolchains( request.getGlobalToolchainsSource() , request, problems );
|
||||
PersistedToolchains globalToolchains = readToolchains( request.getGlobalToolchainsSource(), request, problems );
|
||||
|
||||
PersistedToolchains userToolchains = readToolchains( request.getUserToolchainsSource(), request, problems );
|
||||
|
||||
|
|
|
@ -38,8 +38,8 @@ public interface ToolchainsBuildingRequest
|
|||
Source getGlobalToolchainsSource();
|
||||
|
||||
/**
|
||||
* Sets the global toolchains source. If both user toolchains and a global toolchains are given, the user toolchains take
|
||||
* precedence.
|
||||
* Sets the global toolchains source. If both user toolchains and a global toolchains are given, the user toolchains
|
||||
* take precedence.
|
||||
*
|
||||
* @param globalToolchainsSource The global toolchains source, may be {@code null} to disable global toolchains.
|
||||
* @return This request, never {@code null}.
|
||||
|
@ -54,8 +54,8 @@ public interface ToolchainsBuildingRequest
|
|||
Source getUserToolchainsSource();
|
||||
|
||||
/**
|
||||
* Sets the user toolchains source. If both user toolchains and a global toolchains are given, the user toolchains take
|
||||
* precedence.
|
||||
* Sets the user toolchains source. If both user toolchains and a global toolchains are given, the user toolchains
|
||||
* take precedence.
|
||||
*
|
||||
* @param userToolchainsSource The user toolchains source, may be {@code null} to disable user toolchains.
|
||||
* @return This request, never {@code null}.
|
||||
|
|
|
@ -55,8 +55,8 @@ public interface ToolchainsReader
|
|||
throws IOException, ToolchainsParseException;
|
||||
|
||||
/**
|
||||
* Reads the toolchains from the specified character reader. The reader will be automatically closed before the method
|
||||
* returns.
|
||||
* Reads the toolchains from the specified character reader. The reader will be automatically closed before the
|
||||
* method returns.
|
||||
*
|
||||
* @param input The reader to deserialize the toolchains from, must not be {@code null}.
|
||||
* @param options The options to use for deserialization, may be {@code null} to use the default values.
|
||||
|
|
Loading…
Reference in New Issue