Hi all,
I debugged through
org.apache.maven.artifact.resolver.DefaultArtifactResolver (see the snippet
of code where it searches the maven-parent in localrepo then goes for wagon
to download it from remote )and found that *destination *has value "*
\org\apache\maven\maven-parent\11\maven-parent-11.pom* " and *
desitnation.exist()* has *false *value and force is *false *already.
Since maven-parent is already present into my localRepo it(*
desitnation.exist()*) should return *true* and then it shouldn't go for
remote repo( central) to download it from there.
* if ( !destination.exists() || force )*
{
if ( !wagonManager.isOnline() )
{
throw new ArtifactNotFoundException( "System is
offline.", artifact );
}
try
{
// TODO: force should be passed to the wagon manager
if ( artifact.getRepository() != null )
{
// the transformations discovered the artifact - so
use it exclusively
wagonManager.getArtifact( artifact,
artifact.getRepository() );
}
else
{
wagonManager.getArtifact( artifact, repositories );
}
if ( !artifact.isResolved() && !destination.exists() )
{
throw new ArtifactResolutionException(
"Failed to resolve artifact, possibly due to a
repository list that is not appropriately equipped for this artifact's
metadata.",
artifact, getMirroredRepositories(
remoteRepositories ) );
}
}
catch ( ResourceDoesNotExistException e )
{
throw new ArtifactNotFoundException( e.getMessage(),
artifact,
getMirroredRepositories( remoteRepositories ), e );
}
catch ( TransferFailedException e )
{
throw new ArtifactResolutionException( e.getMessage(),
artifact,
getMirroredRepositories( remoteRepositories ), e );
}
resolved = true;
}
* else if ( destination.exists() )
{
// locally resolved...no need to hit the remote repo.
artifact.setResolved( true );
}
*can you please point why this is returning as false even if i have
correct destination value
*(\org\apache\maven\maven-parent\11\maven-parent-11.pom
*)
thanks,
amaresh
*
*
On Wed, Dec 23, 2009 at 11:12 AM, amaresh mourya
<[email protected]>wrote:
> Thanks Wandy,
> yeah I removed proxy information from setting.xml
> and blown up the "org" (org.apache.maven.maven-parent) directory from the
> local repo...but with no luck.
>
>
> On Tue, Dec 22, 2009 at 2:25 AM, Wendy Smoak <[email protected]> wrote:
>
>> On Mon, Dec 21, 2009 at 2:46 AM, amaresh mourya
>> <[email protected]> wrote:
>> > I ran the org.apache.maven.project.MavenProject build() method from
>> > DeafultMavenProjectBuilder for maven-artifact's pom.xml (see A) to build
>> > Maven Project for maven-artifact, but since it is derived from
>> > org.apache.maven:maven:2.2.0 's pom.xml which has parent entry like
>> shown
>> > below (see B), and maven-parent is not located at relative path is gives
>> me
>> > the following error (see C):
>> > If maven-parent is not available at relative path it should download it
>> from
>> > the central.
>> >
>> > 1. I haven't touched my local repo.
>> > 2. my setting.xml resides at \apache-maven-2.1.0\conf\settings.xml and
>> have
>> > just proxy information
>>
>> Did you try this build once before adding your proxy information to
>> settings.xml? If so, Maven may be "remembering" that failure. By
>> default it only tries to download an artifact once per day.
>>
>> After checking the central repo and confirming that the artifact does
>> exist, try deleting at least that sub-tree from your local repository,
>> and try the build again. You can also try adding -U on the command
>> line to force updates.
>>
>> --
>> Wendy
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>