You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Julien Letrouit <ju...@gmail.com> on 2011/02/04 23:10:26 UTC
Maven can not fetch dependencies of type "POM"
Hi,
I am pretty new to maven, so this is probably a silly question.
My problem is I can't fetch any dependencies of type "POM".
For example, if I try to compile:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>test.pom</groupId>
<artifactId>some-pom</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-parent</artifactId>
<version>7</version>
</dependency>
</dependencies>
</project>
I get:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building some-pom 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.215s
[INFO] Finished at: Fri Feb 04 16:53:00 EST 2011
[INFO] Final Memory: 3M/121M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project some-pom: Could not resolve
dependencies for project test.pom:some-pom:jar:1.0-SNAPSHOT: Failure
to find org.mortbay.jetty:jetty-parent:jar:7 in
http://repo1.maven.org/maven2 was cached in the local repository,
resolution will not be reattempted until the update interval of
central has elapsed or updates are forced -> [Help 1]
org.mortbay.jetty:jetty-parent is a parent pom file, but for some
reason maven tries to find org.mortbay.jetty:jetty-parent:jar.
If I add <type>pom</type>, it is working fine, but the trouble is
lot of projects don't do that. For example:
http://www.scalablesolutions.se/akka/repository/se/scalablesolutions/akka/akka-persistence-mongo/1.0-RC3/akka-persistence-mongo-1.0-RC3.pom
is referencing:
<dependency>
<groupId>com.mongodb.casbah</groupId>
<artifactId>casbah_2.8.1</artifactId>
<version>2.0.1</version>
<scope>compile</scope>
</dependency>
without specifying the type. Which means I can't reference
akka-persistence-mongo, because I will get a similar error.
I tried with Maven 3.0.1 and 3.0.2.
Is not maven supposed to look at the POM file for the type instead of
assuming a default of "jar"?
Thank you in advance for any help!
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Maven can not fetch dependencies of type "POM"
Posted by Hilco Wijbenga <hi...@gmail.com>.
I have to admit that I'm lost as to what exactly you're trying to do
but I've added a few comments below.
On 4 February 2011 14:10, Julien Letrouit <ju...@gmail.com> wrote:
> Hi,
>
> I am pretty new to maven, so this is probably a silly question.
> My problem is I can't fetch any dependencies of type "POM".
:-) Of course, you can.
> For example, if I try to compile:
>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd">
> <modelVersion>4.0.0</modelVersion>
> <groupId>test.pom</groupId>
> <artifactId>some-pom</artifactId>
> <version>1.0-SNAPSHOT</version>
>
> <dependencies>
> <dependency>
> <groupId>org.mortbay.jetty</groupId>
> <artifactId>jetty-parent</artifactId>
> <version>7</version>
> </dependency>
> </dependencies>
> </project>
You're not asking for a POM but a JAR. (The default is
<type>jar</type>.) So add <type>pom</type>.
> I get:
>
> [INFO] Scanning for projects...
> [INFO]
> [INFO] ------------------------------------------------------------------------
> [INFO] Building some-pom 1.0-SNAPSHOT
> [INFO] ------------------------------------------------------------------------
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 0.215s
> [INFO] Finished at: Fri Feb 04 16:53:00 EST 2011
> [INFO] Final Memory: 3M/121M
> [INFO] ------------------------------------------------------------------------
> [ERROR] Failed to execute goal on project some-pom: Could not resolve
> dependencies for project test.pom:some-pom:jar:1.0-SNAPSHOT: Failure
> to find org.mortbay.jetty:jetty-parent:jar:7 in
^^^^^^^^ See? ^^^^^^^^^
> http://repo1.maven.org/maven2 was cached in the local repository,
> resolution will not be reattempted until the update interval of
> central has elapsed or updates are forced -> [Help 1]
>
> org.mortbay.jetty:jetty-parent is a parent pom file, but for some
> reason maven tries to find org.mortbay.jetty:jetty-parent:jar.
>
> If I add <type>pom</type>, it is working fine, but the trouble is
> lot of projects don't do that. For example:
Exactly, so add the type. A lot of projects don't do what?
> http://www.scalablesolutions.se/akka/repository/se/scalablesolutions/akka/akka-persistence-mongo/1.0-RC3/akka-persistence-mongo-1.0-RC3.pom
>
> is referencing:
>
> <dependency>
> <groupId>com.mongodb.casbah</groupId>
> <artifactId>casbah_2.8.1</artifactId>
> <version>2.0.1</version>
> <scope>compile</scope>
> </dependency>
>
> without specifying the type. Which means I can't reference
> akka-persistence-mongo, because I will get a similar error.
Meaning that they want the JAR. Why would that affect you? Have you
actually tried it? :-)
<OT>The artifact id is casbah_2.8.1? And then the version is 2.0.1?
Strange.</OT>
> I tried with Maven 3.0.1 and 3.0.2.
>
> Is not maven supposed to look at the POM file for the type instead of
> assuming a default of "jar"?
Maven isn't telepathic. How is it to know exactly which artifact
(.jar, -sources.jar, -javadoc.jar, .war, .pom, etcetera) you want?
Why do you want the POM? Are you sure it's what you need? Just to be
clear, if you depend on a particular JAR, its POM is downloaded too.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Re: Maven can not fetch dependencies of type "POM"
Posted by Wayne Fay <wa...@gmail.com>.
> and no, com.mongodb.casbah:casbah_2.8.1 is not a jar, it is a pom,
> there is no jar for
> com.mongodb.casbah:casbah_2.8.1
There is no jar... but if you go to the 1.0-RC3 directory for that
artifact in their repo, you'll see there is a zip file. I guess this
is what they are trying to deliver as the binary?? I have no idea why
its a zip and not a jar -- ask them.
> So looking at your answer, I guess I should ask the owners of
> akka-persistence-mongo-1.0-RC3 to modify their pom file?
You should ALWAYS take project-specific problems to the project team
and ask them to resolve it. They may not even be aware that this is a
problem for their users until you tell them.
Wayne
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Re: Maven can not fetch dependencies of type "POM"
Posted by Julien Letrouit <ju...@gmail.com>.
> I have to admit that I'm lost as to what exactly you're trying to do
> but I've added a few comments below.
Thanks for your answer and sorry for the confusion. I understand that
Maven is not telephatic, but it could download the pom file, look at
the packaging, and know from there how to treat the dependency
(whether to download the .jar or just look at dependencies
transitively).
That way, if for some reasons (for example, splitting a jar) some
projects are deciding to switch from <packaging>jar</packaging> to
<packaging>pom</packaging>, all the projects depending on them would
need no modification in their own pom file (they would not need to add
<type>pom</type>).
That said, for my particular case, I am trying to use:
http://www.scalablesolutions.se/akka/repository/se/scalablesolutions/akka=
/akka-persistence-mongo/1.0-RC3/akka-persistence-mongo-1.0-RC3.pom
and no, com.mongodb.casbah:casbah_2.8.1 is not a jar, it is a pom,
there is no jar for
com.mongodb.casbah:casbah_2.8.1
So looking at your answer, I guess I should ask the owners of
akka-persistence-mongo-1.0-RC3 to modify their pom file?
>>
http://www.scalablesolutions.se/akka/repository/se/scalablesolutions/akka=
/akka-persistence-mongo/1.0-RC3/akka-persistence-mongo-1.0-RC3.pom
>>
>> is referencing:
>>
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0<dependency>
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
=C2=A0<groupId>com.mongodb.casbah</gro=
upId>
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
=C2=A0<artifactId>casbah_2.8.1</artifa=
ctId>
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<version>2.0.1</version>
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<scope>compile</scope>
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0</dependency>
>>
>> without specifying the type. Which means I can't reference
>> akka-persistence-mongo, because I will get a similar error.
>> Is not maven supposed to look at the POM file for the type instead of
>> assuming a default of "jar"?
>
>Maven isn't telepathic. How is it to know exactly which artifact
(.jar, -sources.jar, -javadoc.jar, .war, .pom, etcetera) you want?
2011/2/4 Julien Letrouit <ju...@gmail.com>:
> Hi,
>
> I am pretty new to maven, so this is probably a silly question.
> My problem is I can't fetch any dependencies of type "POM".
> For example, if I try to compile:
>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd">
> <modelVersion>4.0.0</modelVersion>
> <groupId>test.pom</groupId>
> <artifactId>some-pom</artifactId>
> <version>1.0-SNAPSHOT</version>
>
> <dependencies>
> <dependency>
> <groupId>org.mortbay.jetty</groupId>
> <artifactId>jetty-parent</artifactId>
> <version>7</version>
> </dependency>
> </dependencies>
> </project>
>
> I get:
>
> [INFO] Scanning for projects...
> [INFO]
> [INFO]
------------------------------------------------------------------------
> [INFO] Building some-pom 1.0-SNAPSHOT
> [INFO]
------------------------------------------------------------------------
> [INFO]
------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO]
------------------------------------------------------------------------
> [INFO] Total time: 0.215s
> [INFO] Finished at: Fri Feb 04 16:53:00 EST 2011
> [INFO] Final Memory: 3M/121M
> [INFO]
------------------------------------------------------------------------
> [ERROR] Failed to execute goal on project some-pom: Could not resolve
> dependencies for project test.pom:some-pom:jar:1.0-SNAPSHOT: Failure
> to find org.mortbay.jetty:jetty-parent:jar:7 in
> http://repo1.maven.org/maven2 was cached in the local repository,
> resolution will not be reattempted until the update interval of
> central has elapsed or updates are forced -> [Help 1]
>
> org.mortbay.jetty:jetty-parent is a parent pom file, but for some
> reason maven tries to find org.mortbay.jetty:jetty-parent:jar.
>
> If I add <type>pom</type>, it is working fine, but the trouble is
> lot of projects don't do that. For example:
>
>
http://www.scalablesolutions.se/akka/repository/se/scalablesolutions/akka/akka-persistence-mongo/1.0-RC3/akka-persistence-mongo-1.0-RC3.pom
>
> is referencing:
>
> <dependency>
> <groupId>com.mongodb.casbah</groupId>
> <artifactId>casbah_2.8.1</artifactId>
> <version>2.0.1</version>
> <scope>compile</scope>
> </dependency>
>
> without specifying the type. Which means I can't reference
> akka-persistence-mongo, because I will get a similar error.
>
> I tried with Maven 3.0.1 and 3.0.2.
>
> Is not maven supposed to look at the POM file for the type instead of
> assuming a default of "jar"?
>
> Thank you in advance for any help!
>