public String getPluginDependencyVersion ( String groupId , String artifactId ) throws MojoExecutionException { final Map < String , Dependency > deps = getPluginDependencies ( ) ; final String key = ArtifactUtils . versionlessKey ( groupId , artifactId ) ; this . log . debug ( "COMPONENT DEPENDENCIES(getPluginVersionFromDependencies):" ) ; //$NON-NLS-1$ this . log . debug ( deps . toString ( ) ) ; final Dependency dep = deps . get ( key ) ; if ( dep != null ) { final String version = dep . getVersion ( ) ; if ( version != null && ! version . isEmpty ( ) ) { return version ; } throw new MojoExecutionException ( MessageFormat . format ( Messages . MavenHelper_2 , key ) ) ; } throw new MojoExecutionException ( MessageFormat . format ( Messages . MavenHelper_3 , key , deps ) ) ; }
Replies the version of the given plugin that is specified in the POM of the plugin in which this mojo is located .