Johannes Ruscheinski wrote:

         private void resolveDendencies(final Artifact artifact) {
                 getLog().info("+++ ProfilerMojo: attempting resolution
from " + localRepository.getUrl());
                 final String localPath = localRepository.getUrl() +
"/" + localRepository.pathOf(artifact);
                 if (fetch(localPath) != null) {
                         getLog().info("+++ ProfilerMojo: found " +
artifact + " at " + localPath);
                         return;
                 }

                 for (final ArtifactRepository repository : remoteRepositories) 
{
                         getLog().info("+++ ProfilerMojo: attempting
resolution from " + repository.getUrl());
                         final String remotePath = repository + "/" +
repository.pathOf(artifact);
                         if (fetch(remotePath) != null) {
                                 getLog().info("+++ ProfilerMojo: found
" + artifact + " at " + remotePath);
                                 return;
                         }
                 }

                 getLog().info("+++ ProfilerMojo: NOT FOUND " + artifact);
         }

         private Object fetch(final String urlAsString) {
                 try {
                         final URL url = new URL(urlAsString);
                         final URLConnection connection = url.openConnection();
                         return connection.getContent();
                 } catch (Exception e) {
                         return null;
                 }

This might be helpful:
http://docs.codehaus.org/display/MAVENUSER/Mojo+Developer+Cookbook#MojoDeveloperCookbook-Creatingandresolvinganartifact


Benjamin

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to