maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hilco Wijbenga <hilco.wijbe...@gmail.com>
Subject Re: Maven can not fetch dependencies of type "POM"
Date Fri, 04 Feb 2011 23:38:27 GMT
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 <julien.letrouit@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


Mime
View raw message