You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by amaresh mourya <am...@gmail.com> on 2009/12/21 10:46:45 UTC

Unable to download artifact from repository

Hi All,

I have the situation where when :


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

Can anyone suggest what's wrong with my setting.xml (if any) or what is
preventing maven to download from central..

A: part of maven-artifact's pom.xml

 <parent>
   <groupId>org.apache.maven</groupId>
   <artifactId>maven</artifactId>
   <version>2.2.0</version>
 </parent>
 <artifactId>maven-artifact</artifactId>


B:part of maven's pom.xml

<parent>
   <groupId>org.apache.maven</groupId>
   <artifactId>maven-parent</artifactId>
   <version>11</version>
   <relativePath>../pom/maven/pom.xml</relativePath>
  </parent>
 <artifactId>maven</artifactId>
 <version>2.2.0</version>
 <packaging>pom</packaging>


C:Error thrown


org.apache.maven.project.ProjectBuildingException: Cannot find parent:
org.apache.maven:maven-parent for project: null:maven:pom:2.2.0 for project
null:maven:pom:2.2.0
       at
org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1398)
       at
org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1415)
       at
org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:823)
       at
org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:508)
       at
org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:217)
       at
oracle.jdeveloper.maven.node.POMNode.getFullMavenProject(POMNode.java:322)
       at
oracle.jdevimpl.wizard.project.MavenProjectImportWorker.loadPOM(MavenProjectImportWorker.java:215)
       at
oracle.jdevimpl.wizard.project.MavenProjectImportWorker.generate(MavenProjectImportWorker.java:163)
       at
oracle.jdevimpl.wizard.project.MavenProjectImportWorker.runGen(MavenProjectImportWorker.java:136)
       at
oracle.jdevimpl.wizard.project.MavenProjectImportWorker.callImport(MavenProjectImportWorker.java:114)
       at
oracle.jdevimpl.wizard.project.MavenProjectImportWorker.run(MavenProjectImportWorker.java:91)
       at java.lang.Thread.run(Thread.java:619)
Caused by: org.apache.maven.project.ProjectBuildingException: POM
'org.apache.maven:maven-parent' not found in repository: Unable to download
the artifact from any repository

 org.apache.maven:maven-parent:pom:11

from the specified remote repositories:
 central (http://repo1.maven.org/maven2)

 for project org.apache.maven:maven-parent
       at
org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:605)
       at
org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1394)
       ... 11 more
Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException:
Unable to download the artifact from any repository

 org.apache.maven:maven-parent:pom:11

from the specified remote repositories:
 central (http://repo1.maven.org/maven2)


       at
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:228)
       at
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:90)
       at
org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:558)
       ... 12 more
Caused by: org.apache.maven.wagon.ResourceDoesNotExistException: Unable to
download the artifact from any repository
       at
org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:349)
       at
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:216)
       ... 14 more



Regard,
Amaresh

Re: Unable to download artifact from repository

Posted by amaresh mourya <am...@gmail.com>.
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
<am...@gmail.com>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 <ws...@gmail.com> wrote:
>
>> On Mon, Dec 21, 2009 at 2:46 AM, amaresh mourya
>> <am...@gmail.com> 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: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>

Re: Unable to download artifact from repository

Posted by amaresh mourya <am...@gmail.com>.
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 <ws...@gmail.com> wrote:

> On Mon, Dec 21, 2009 at 2:46 AM, amaresh mourya
> <am...@gmail.com> 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: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Unable to download artifact from repository

Posted by Wendy Smoak <ws...@gmail.com>.
On Mon, Dec 21, 2009 at 2:46 AM, amaresh mourya
<am...@gmail.com> 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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org