On 18 February 2011 14:41, Benjamin Bentmann <[email protected]> wrote:
> 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

Yes, that looks very useful.  Thank you!

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



-- 
Johannes

Obligatory current favourite quotes:

"We are all atheists about most of the gods that societies have ever
believed in. Some of us just go one god further."
--Richard Dawkins

"Religion is regarded by the common people as true, by the wise as
false, and by the rulers as useful".
 -- Seneca
"I have more confidence in the methods of science, based on the amazing
record of science and its ability over the centuries to answer
unanswerable questions, than I do in the methods of faith (what are they?)."
 -- David J. Gross "Physics Nobel Laureate"

"Atheism is a religion to the same extent that not collecting stamps is a
 hobby."
 -- seen on Slashdot.org

http://xkcd.com/808/

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

Reply via email to