Search in sources :

Example 6 with MavenWorkspaceMap

use of org.jetbrains.idea.maven.model.MavenWorkspaceMap in project intellij-community by JetBrains.

the class CustomRepositoryMetadataManager method resolve.

@Override
public void resolve(RepositoryMetadata metadata, List remoteRepositories, ArtifactRepository localRepository) throws RepositoryMetadataResolutionException {
    super.resolve(metadata, remoteRepositories, localRepository);
    MavenWorkspaceMap map = myWorkspaceMap;
    if (map == null)
        return;
    Metadata data = metadata.getMetadata();
    Versioning versioning = data.getVersioning();
    if (versioning == null) {
        data.setVersioning(versioning = new Versioning());
    }
    for (MavenId each : map.getAvailableIds()) {
        if (each.equals(data.getGroupId(), data.getArtifactId())) {
            versioning.addVersion(each.getVersion());
        }
    }
}
Also used : MavenId(org.jetbrains.idea.maven.model.MavenId) MavenWorkspaceMap(org.jetbrains.idea.maven.model.MavenWorkspaceMap)

Aggregations

MavenWorkspaceMap (org.jetbrains.idea.maven.model.MavenWorkspaceMap)6 MavenId (org.jetbrains.idea.maven.model.MavenId)2 ConfigurationException (com.intellij.openapi.options.ConfigurationException)1 IgnoredFileBean (com.intellij.openapi.vcs.changes.IgnoredFileBean)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 IOException (java.io.IOException)1 MavenExplicitProfiles (org.jetbrains.idea.maven.model.MavenExplicitProfiles)1 MavenEmbedderWrapper (org.jetbrains.idea.maven.server.MavenEmbedderWrapper)1 MavenServerExecutionResult (org.jetbrains.idea.maven.server.MavenServerExecutionResult)1 MavenProcessCanceledException (org.jetbrains.idea.maven.utils.MavenProcessCanceledException)1