/** * Tries to resolve the specified artifact from the artifacts of the given project. * * @param project The project to try to resolve the artifact from, must not be <code>null</code>. * @param requestedArtifact The artifact to resolve, must not be <code>null</code>. * @return The matching artifact from the project or <code>null</code> if not found. Note that this */ private Artifact findMatchingArtifact( MavenProject project, Artifact requestedArtifact ) { String requestedRepositoryConflictId = ArtifactIdUtils.toVersionlessId( requestedArtifact ); Artifact mainArtifact = RepositoryUtils.toArtifact( project.getArtifact() ); if ( requestedRepositoryConflictId.equals( ArtifactIdUtils.toVersionlessId( mainArtifact ) ) ) { return mainArtifact; } for ( Artifact attachedArtifact : RepositoryUtils.toArtifacts( project.getAttachedArtifacts() ) ) { if ( attachedArtifactComparison( requestedArtifact, attachedArtifact ) ) { return attachedArtifact; } } return null; }
ArtifactIdUtils.toVersionlessId( dependency.getGroupId(), dependency.getArtifactId(), dependency.getType(), classifier ); dependencies.put( key, dependency );
/** * Transforms the {@link ArtifactClassificationNode} to {@link ArtifactsUrlClassification}. * * @param classificationNodes the fat object classified that needs to be transformed * @return {@link ArtifactsUrlClassification} */ private List<ArtifactUrlClassification> toServiceUrlClassification(Collection<ArtifactClassificationNode> classificationNodes) { return classificationNodes.stream().map(node -> { final String versionLessId = toVersionlessId(node.getArtifact()); return serviceResourcesResolver .resolveServiceResourcesFor(new ArtifactUrlClassification(versionLessId, node.getArtifact().getArtifactId(), node.getUrls())); }).collect(toList()); }
.map(dependency -> toVersionlessId(dependency.getArtifact())) .collect(toList()); final String versionLessId = toVersionlessId(node.getArtifact()); final PluginUrlClassification pluginUrlClassification = pluginResourcesResolver.resolvePluginResourcesFor(
if ( ArtifactIdUtils.toVersionlessId( a ).equals( ArtifactIdUtils.toVersionlessId( w ) ) )
.equals(toVersionlessId(artifact))) && !pluginUrlClassifications.stream() .equals(toVersionlessId(artifact))) && !applicationSharedLibUrls.stream() .anyMatch(applicationSharedLibUrl -> applicationSharedLibUrl.getArtifactId().equals(artifactId)));
.flatMap(l -> l.stream()) .collect(Collectors.toCollection(() -> new TreeSet<>((d1, d2) -> { if (toVersionlessId(d1.getArtifact()).equals(toVersionlessId(d2.getArtifact()))) { try { return versionScheme.parseVersion(d1.getArtifact().getVersion())
@Override public String toString() { StringBuilder buffer = new StringBuilder( 256 ); for ( int i = 0, n = dependencies.size(); i < n; i++ ) { if ( i > 0 ) { buffer.append( " -> " ); } buffer.append( ArtifactIdUtils.toVersionlessId( dependencies.get( i ).getArtifact() ) ); } return buffer.toString(); }
@Override public String toString() { StringBuilder buffer = new StringBuilder( 256 ); for ( int i = 0, n = dependencies.size(); i < n; i++ ) { if ( i > 0 ) { buffer.append( " -> " ); } buffer.append( ArtifactIdUtils.toVersionlessId( dependencies.get( i ).getArtifact() ) ); } return buffer.toString(); }
Artifact w = winner.getArtifact(); buffer.append(" (conflicts with "); if (ArtifactIdUtils.toVersionlessId(a).equals(ArtifactIdUtils.toVersionlessId(w))) { buffer.append(w.getVersion()); } else {
Artifact w = winner.getArtifact(); buffer.append(" (conflicts with "); if (ArtifactIdUtils.toVersionlessId(a) .equals(ArtifactIdUtils.toVersionlessId(w))) { buffer.append(w.getVersion()); } else {
if ( ArtifactIdUtils.toVersionlessId( a ).equals( ArtifactIdUtils.toVersionlessId( w ) ) )
/** * Creates an artifact identifier of the form {@code <groupId>:<artifactId>:<extension>[:<classifier>]}. * * @param artifact The artifact to create an identifer for, may be {@code null}. * @return The artifact identifier or {@code null} if the input was {@code null}. */ public static String toVersionlessId( Artifact artifact ) { String id = null; if ( artifact != null ) { id = toVersionlessId( artifact.getGroupId(), artifact.getArtifactId(), artifact.getExtension(), artifact.getClassifier() ); } return id; }
/** * Creates an artifact identifier of the form {@code <groupId>:<artifactId>:<extension>[:<classifier>]}. * * @param artifact The artifact to create an identifer for, may be {@code null}. * @return The artifact identifier or {@code null} if the input was {@code null}. */ public static String toVersionlessId( Artifact artifact ) { String id = null; if ( artifact != null ) { id = toVersionlessId( artifact.getGroupId(), artifact.getArtifactId(), artifact.getExtension(), artifact.getClassifier() ); } return id; }