public Set < Artifact > resolve ( String groupId , String artifactId ) throws MojoExecutionException { final ArtifactResolutionRequest request = new ArtifactResolutionRequest ( ) ; request . setResolveRoot ( true ) ; request . setResolveTransitively ( true ) ; request . setLocalRepository ( getSession ( ) . getLocalRepository ( ) ) ; request . setRemoteRepositories ( getSession ( ) . getCurrentProject ( ) . getRemoteArtifactRepositories ( ) ) ; request . setOffline ( getSession ( ) . isOffline ( ) ) ; request . setForceUpdate ( getSession ( ) . getRequest ( ) . isUpdateSnapshots ( ) ) ; request . setServers ( getSession ( ) . getRequest ( ) . getServers ( ) ) ; request . setMirrors ( getSession ( ) . getRequest ( ) . getMirrors ( ) ) ; request . setProxies ( getSession ( ) . getRequest ( ) . getProxies ( ) ) ; request . setArtifact ( createArtifact ( groupId , artifactId ) ) ; final ArtifactResolutionResult result = resolve ( request ) ; return result . getArtifacts ( ) ; }
Resolve the artifacts with the given key .