Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
use withComponent
  • Loading branch information
buzztaiki committed Mar 17, 2012
1 parent d815078 commit ee5e3c9
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions src/main/groovy/org/grumblesmurf/malabar/Project.groovy
Expand Up @@ -107,23 +107,25 @@ class Project
return
}

def af = GroovyServer.mvnServer.plexus.lookup(org.apache.maven.artifact.factory.ArtifactFactory);
def sourceArtifact =
af.createArtifactWithClassifier(artifact.groupId,
artifact.artifactId,
artifact.version,
artifact.type,
"sources");
def ar = mvnServer.plexus.lookup(org.apache.maven.artifact.resolver.ArtifactResolver);
try {
def localRepo = request.localRepository
ar.resolve(sourceArtifact, request.remoteRepositories, localRepo);
def f = new File(localRepo.basedir, localRepo.pathOf(sourceArtifact))
println "\"${f}\""
} catch (Exception e) {
// TODO log
println "nil"
}
mvnServer.withComponent(org.apache.maven.artifact.factory.ArtifactFactory) { af ->
def sourceArtifact =
af.createArtifactWithClassifier(artifact.groupId,
artifact.artifactId,
artifact.version,
artifact.type,
"sources");
mvnServer.withComponent(org.apache.maven.artifact.resolver.ArtifactResolver) { ar ->
try {
def localRepo = request.localRepository
ar.resolve(sourceArtifact, request.remoteRepositories, localRepo);
def f = new File(localRepo.basedir, localRepo.pathOf(sourceArtifact))
println "\"${f}\""
} catch (Exception e) {
// TODO log
println "nil"
}
}
}
}

def successfulCompilation() {
Expand Down

0 comments on commit ee5e3c9

Please sign in to comment.