public int hashCode() { return getId().hashCode(); }
private static String constructMessage( MavenProject project, Artifact artifact ) { return DEFAULT_MESSAGE + " (project: " + project.getId() + "; illegal attachment: " + artifact.getId() + ")"; }
public Map getPluginContext( PluginDescriptor plugin, MavenProject project ) { Map<String, Map> pluginContextsByKey = pluginContextsByProjectAndPluginKey.get( project.getId() ); if ( pluginContextsByKey == null ) { pluginContextsByKey = new HashMap<>(); pluginContextsByProjectAndPluginKey.put( project.getId(), pluginContextsByKey ); } Map pluginContext = pluginContextsByKey.get( plugin.getPluginLookupKey() ); if ( pluginContext == null ) { pluginContext = new HashMap<>(); pluginContextsByKey.put( plugin.getPluginLookupKey(), pluginContext ); } return pluginContext; }
public Map<String, Object> getPluginContext( PluginDescriptor plugin, MavenProject project ) { String projectKey = project.getId(); Map<String, Map<String, Object>> pluginContextsByKey = pluginContextsByProjectAndPluginKey.get( projectKey ); if ( pluginContextsByKey == null ) { pluginContextsByKey = new ConcurrentHashMap<>(); pluginContextsByProjectAndPluginKey.put( projectKey, pluginContextsByKey ); } String pluginKey = plugin.getPluginLookupKey(); Map<String, Object> pluginContext = pluginContextsByKey.get( pluginKey ); if ( pluginContext == null ) { pluginContext = new ConcurrentHashMap<>(); pluginContextsByKey.put( pluginKey, pluginContext ); } return pluginContext; }
private void calculateConcreteProjectReferences( MavenProject project, ProjectBuilderConfiguration config, Set processedProjects ) throws ModelInterpolationException { Map projectRefs = project.getProjectReferences(); if ( projectRefs != null ) { for ( Iterator it = projectRefs.values().iterator(); it.hasNext(); ) { MavenProject reference = (MavenProject) it.next(); if ( !processedProjects.contains( reference.getId() ) ) { calculateConcreteStateInternal( reference, config, true, processedProjects ); } } } }
private void restoreDynamicProjectReferences( MavenProject project, ProjectBuilderConfiguration config, Set processedProjects ) throws ModelInterpolationException { Map projectRefs = project.getProjectReferences(); if ( projectRefs != null ) { for ( Iterator it = projectRefs.values().iterator(); it.hasNext(); ) { MavenProject projectRef = (MavenProject) it.next(); if ( !processedProjects.contains( projectRef.getId() ) ) { restoreDynamicStateInternal( projectRef, config, true, processedProjects ); } } } }
@Override public String toString() { return getProject().getId() + " -> " + getTaskSegment(); } }
private void validatePrerequisitesForNonMavenPluginProjects( List<MavenProject> projects ) { for ( MavenProject mavenProject : projects ) { if ( !"maven-plugin".equals( mavenProject.getPackaging() ) ) { Prerequisites prerequisites = mavenProject.getPrerequisites(); if ( prerequisites != null && prerequisites.getMaven() != null ) { logger.warn( "The project " + mavenProject.getId() + " uses prerequisites" + " which is only intended for maven-plugin projects " + "but not for non maven-plugin projects. " + "For such purposes you should use the maven-enforcer-plugin. " + "See https://maven.apache.org/enforcer/enforcer-rules/requireMavenVersion.html" ); } } } }
@Deprecated public static Set<Artifact> createArtifacts( ArtifactFactory artifactFactory, List<Dependency> dependencies, String inheritedScope, ArtifactFilter dependencyFilter, MavenProject project ) throws InvalidDependencyVersionException { Set<Artifact> artifacts = new LinkedHashSet<>(); for ( Dependency d : dependencies ) { Artifact dependencyArtifact; try { dependencyArtifact = createDependencyArtifact( artifactFactory, d, inheritedScope, dependencyFilter ); } catch ( InvalidVersionSpecificationException e ) { throw new InvalidDependencyVersionException( project.getId(), d, project.getFile(), e ); } if ( dependencyArtifact != null ) { artifacts.add( dependencyArtifact ); } } return artifacts; }
public String getName() { // TODO: this should not be allowed to be null. if ( getModel().getName() != null ) { return getModel().getName(); } else { return "Unnamed - " + getId(); } }
public void debugReactorPlan( ProjectBuildList projectBuilds ) { if ( !logger.isDebugEnabled() ) { return; } logger.debug( "=== REACTOR BUILD PLAN ================================================" ); for ( Iterator<ProjectSegment> it = projectBuilds.iterator(); it.hasNext(); ) { ProjectSegment projectBuild = it.next(); logger.debug( "Project: " + projectBuild.getProject().getId() ); logger.debug( "Tasks: " + projectBuild.getTaskSegment().getTasks() ); logger.debug( "Style: " + ( projectBuild.getTaskSegment().isAggregating() ? "Aggregating" : "Regular" ) ); if ( it.hasNext() ) { logger.debug( "-----------------------------------------------------------------------" ); } } logger.debug( "=======================================================================" ); }
+ result.getProject().getId() );
project.getId() + " in relative path: " + parentRelativePath ); project.getId() + " cannot be loaded from relative path: " + parentDescriptor + "; path does not exist." ); parentModel.getRelativePath() + "\' for project: " + project.getId() ); parentModel.getRelativePath() + "' in parent specification in " + project.getId() + ":" + "\n Specified: " + parentModel.getId() + "\n Found: " + candidateParent.getId() ); project.getId() + " from the repository." ); throw new ProjectBuildingException( project.getId(), "Cannot find parent: " + e.getProjectId() + " for project: " + project.getId(), e );
private void restoreDynamicStateInternal( MavenProject project, ProjectBuilderConfiguration config, boolean processProjectReferences, Set processedProjects ) throws ModelInterpolationException { if ( processProjectReferences ) { processedProjects.add( project.getId() ); } if ( project.isConcrete() && projectWasChanged( project ) ) { if ( project.getParent() != null ) { restoreDynamicStateInternal( project.getParent(), config, processProjectReferences, processedProjects ); } restoreBuildRoots( project, config, getLogger().isDebugEnabled() ); restoreModelBuildSection( project, config, getLogger().isDebugEnabled() ); if ( project.getExecutionProject() != null ) { restoreDynamicStateInternal( project.getExecutionProject(), config, processProjectReferences, processedProjects ); } project.setConcrete( false ); } if ( processProjectReferences ) { restoreDynamicProjectReferences( project, config, processedProjects ); } }
processedProjects.add( project.getId() );