public static final String nvlS( String s, String dflt ) { return isEmpty(s) ? dflt : s; }
public ArtifactFilterList( Map<String, Collection<String>> filter ) { if( Util.isEmpty( filter ) ) return; _filters.add( new MetadataTreeArtifactFilterMap(filter) ); }
private List<Comparator<MetadataTreeNode>> getComparators() { if ( Util.isEmpty( _comparators ) ) _comparators = new ArrayList<Comparator<MetadataTreeNode>>( 2 ); if ( _comparators.size() < 1 ) { _comparators.add( new ClassicDepthComparator() ); _comparators.add( new ClassicVersionComparator() ); } return _comparators; }
public boolean veto( ArtifactMetadata md ) { String key = md.toManagementString(); Collection<String> ver = _vetos.get( key ); if( Util.isEmpty( ver ) ) return false; return ver.contains( md.getVersion() ); }
public List<Artifact> read( List<Repository> repos, List<? extends ArtifactMetadata> artifacts ) throws RepositoryException { if ( Util.isEmpty( repos ) ) throw new RepositoryException( LANG.getMessage( "null.repo" ) ); VirtualRepositoryReader vr = new VirtualRepositoryReader( repos ); ArtifactResults ar = vr.readArtifacts( artifacts ); if ( ar == null || !ar.hasResults() ) return null; if ( ar.hasExceptions() && LOG.isWarnEnabled() ) LOG.info( ar.getExceptions().toString() ); if ( !ar.hasResults() ) return null; Map<ArtifactMetadata, List<Artifact>> am = ar.getResults(); List<Artifact> al = new ArrayList<Artifact>(); for ( Map.Entry<ArtifactMetadata, List<Artifact>> e : am.entrySet() ) al.addAll( e.getValue() ); return al; }
String classifier = Util.isEmpty( md.getClassifier() ) ? "" : '-'+md.getClassifier();
public MetadataTreeNode resolveAsTree( List<Repository> repos , ArtifactScopeEnum scope , ArtifactQueryList artifacts , ArtifactInclusionList inclusions , ArtifactExclusionList exclusions ) throws RepositoryException { if ( Util.isEmpty( artifacts ) || artifacts.isEmpty() ) throw new IllegalArgumentException( LANG.getMessage( "no.artifacts" ) ); try { DependencyBuilder depBuilder = DependencyBuilderFactory.create( DependencyBuilderFactory.JAVA_DEPENDENCY_MODEL, repos, null, null, null , Util.mapOf( new String [][] { {DependencyBuilder.SYSTEM_PROPERTY_ALLOW_CIRCULAR_DEPENDENCIES, ""+_allowCircularDependencies} } ) ); MetadataTreeNode res = depBuilder.resolveConflictsAsTree( scope, artifacts, inclusions, exclusions ); depBuilder.close(); return res; } catch ( MetadataTreeException e ) { throw new RepositoryException( e ); } }
public List<ArtifactMetadata> resolve( List<Repository> repos , ArtifactScopeEnum scope , ArtifactQueryList artifacts , ArtifactInclusionList inclusions , ArtifactExclusionList exclusions ) throws RepositoryException { if ( Util.isEmpty( artifacts ) || artifacts.isEmpty() ) throw new IllegalArgumentException( LANG.getMessage( "no.artifacts" ) ); try { DependencyBuilder depBuilder = DependencyBuilderFactory.create( DependencyBuilderFactory.JAVA_DEPENDENCY_MODEL, repos, null, null, null , Util.mapOf( new Object [][] { {DependencyBuilder.SYSTEM_PROPERTY_ALLOW_CIRCULAR_DEPENDENCIES, ""+_allowCircularDependencies} } ) ); List<ArtifactMetadata> res = depBuilder.resolveConflicts( scope, artifacts, inclusions, exclusions ); depBuilder.close(); return res; } catch ( MetadataTreeException e ) { throw new RepositoryException( e ); } }
dependencies.addAll( allDependencies ); if ( Util.isEmpty( dependencies ) ) return node;