// local repository for reporting missing source jars
List remoteRepos = includeRemoteRepositories ? getRemoteArtifactRepositories() : Collections.EMPTY_LIST;
for ( int j = 0; j < deps.length; j++ )
{
IdeDependency dependency = deps[j];
if ( dependency.isReferencedProject() || dependency.isSystemScoped() )
{
// artifact not needed
continue;
}
if ( getLog().isDebugEnabled() )
{
getLog().debug(
"Searching for sources for " + dependency.getId() + ":" + dependency.getClassifier() +
" at " + dependency.getId() + ":" + inClassifier );
}
String key =
dependency.getClassifier() == null ? dependency.getId() + ":" + inClassifier : dependency.getId() +
":" + inClassifier + ":" + dependency.getClassifier();
if ( !unavailableArtifactsCache.containsKey( key ) )
{
Artifact artifact =
IdeUtils.resolveArtifactWithClassifier( dependency.getGroupId(), dependency.getArtifactId(),
dependency.getVersion(), dependency.getClassifier(),
inClassifier, localRepository, artifactResolver,
artifactFactory, remoteRepos, getLog() );
if ( artifact.isResolved() )
{
if ( "sources".equals( inClassifier ) )
{
dependency.setSourceAttachment( artifact.getFile() );
}
else if ( "javadoc".equals( inClassifier ) )
{
dependency.setJavadocAttachment( artifact.getFile() );
}
}
else
{
unavailableArtifactsCache.put( key, Boolean.TRUE.toString() );