return resolveJRubyCompleteArtifact(DEFAULT_JRUBY_VERSION);
}
protected Artifact resolveJRubyStdlibArtifact(Artifact jruby) throws DependencyResolutionRequiredException,
MojoExecutionException {
final ArtifactResolutionRequest request = new ArtifactResolutionRequest();
for (final Dependency artifact : this.project.getDependencies()) {
if (artifact.getArtifactId().equals(JRUBY_STDLIB)
// TODO this condition is not needed ?
&& !artifact.getScope().equals(Artifact.SCOPE_PROVIDED)
&& !artifact.getScope().equals(Artifact.SCOPE_SYSTEM)) {
request.setArtifact(this.repositorySystem
.createArtifact(artifact.getGroupId(), artifact
.getArtifactId(), artifact.getVersion(),
artifact.getType()));
break;
}
}
if (request.getArtifact() == null){
request.setResolveTransitively(true);
request.setArtifact(jruby);
}
request.setLocalRepository(this.localRepository);
request.setRemoteRepositories(this.project.getRemoteArtifactRepositories());
Set<Artifact> set = this.repositorySystem.resolve(request).getArtifacts();
for (Artifact a: set){
if (JRUBY_STDLIB.equals(a.getArtifactId())) {
return a;
}