import { DependenciesTreeNode } from '../treeDataProviders/dependenciesTree/dependenciesTreeNode' ; import { MavenUtils } from '../utils/mavenUtils' ; import { AbstractDependencyUpdate } from './abstractDependencyUpdate' ; import { MavenTreeNode } from '../treeDataProviders/dependenciesTree/dependenciesRoot/mavenTree' ; import { ScanUtils } from '../utils/scanUtils' ; export class MavenDependencyUpdate extends AbstractDependencyUpdate { constructor ( ) { super ( MavenUtils . PKG_TYPE ) ; } @override  public isMatched ( dependenciesTreeNode ) { return super . isMatched ( dependenciesTreeNode ) && dependenciesTreeNode . parent instanceof MavenTreeNode ; } @override  public updateDependencyVersion ( dependenciesTreeNode , fixedVersion ) { const workspace = ( < MavenTreeNode > dependenciesTreeNode . parent ) . workspaceFolder ; const [ groupId , artifactId ] = MavenUtils . getGavArray ( dependenciesTreeNode ) ; ScanUtils . executeCmd ( 'mvn versions:use-dep-version -DgenerateBackupPoms=false -Dincludes=' + groupId + ':' + artifactId + ' -DdepVersion=' + fixedVersion , workspace ) ; dependenciesTreeNode . generalInfo . version = fixedVersion ; } }