You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@abdera.apache.org by Ugo Cei <ug...@gmail.com> on 2006/12/17 11:11:41 UTC

Abdera, commons-codec and Maven

Folks,

I'm trying to build a project that uses Abdera, using Maven 2. Here's  
the list of dependencies taken from my POM:

     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       <version>3.8.1</version>
     </dependency>
     <dependency>
       <groupId>org.apache.abdera</groupId>
       <artifactId>abdera-server</artifactId>
       <version>0.3.0-incubating-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.apache.abdera</groupId>
       <artifactId>abdera-client</artifactId>
       <version>0.3.0-incubating-SNAPSHOT</version>
       <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>javax.servlet</groupId>
       <artifactId>servlet-api</artifactId>
       <version>2.4</version>
     </dependency>
     <dependency>
       <groupId>commons-logging</groupId>
       <artifactId>commons-logging</artifactId>
       <version>1.1</version>
     </dependency>
     <dependency>
       <groupId>log4j</groupId>
       <artifactId>log4j</artifactId>
       <version>1.2.9</version>
     </dependency>
     <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring</artifactId>
       <version>2.0.1</version>
     </dependency>
     <dependency>
       <groupId>org.mortbay.jetty</groupId>
       <artifactId>jetty</artifactId>
       <version>6.0.0rc0</version>
       <scope>test</scope>
     </dependency>

With these dependencies, my project builds but does not run because  
of a class introduced in commons-codec 1.3 but not yet there in  
commons-codec 1.2. Dependency on commons-codec is specified in  
Abdera's protocol/pom.xml. For some reason, Maven pulls down version  
1.2 instead of 1.3, and this even if I specify the exact version in  
protocol/pom.xml.

I can work around the issue by declaring an explicit dependency on  
1.3 in my project's pom.xml, but I'd like to understand why this is  
happening. I have a hunch commons-codec is specified in the  
dependencies for one of the other libraries I'm using, but I don't  
know how to check, short of looking at all their POMs, recursively.

Besides this, I'd like to know if we can somehow force evey project  
that includes Abdera libs as dependencies to download commons-codec  
1.3 at least, to prevent other people from falling in the same trap I  
fell into.

	Ugo


Re: Abdera, commons-codec and Maven

Posted by Stephen Duncan <st...@gmail.com>.
I'll post a link to your results on the Maven lists, because I don't
entirely understand what's going on here.  However, after testing, it
seems setting the version value in the dependencyManagement section
to: [1.3] to force exactly 1.3 to be allowed works.

-Stephen

On 12/19/06, Ugo Cei <ug...@gmail.com> wrote:
>
> On Dec 17, 2006, at 4:50 PM, Stephen Duncan wrote:
>
> > And I think we should be able to satisfy your last request.
> > Basically, when you just write the version in directly like we have,
> > it's just a suggested version.  We should be able to write it as a
> > version range.  Please try applying the attached patch, rerunning mvn
> > install, and trying out your project again.
>
> If I do that, it says:
>
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Failed to resolve artifact.
>
> Missing:
> ----------
> 1) commons-codec:commons-codec:jar:RELEASE
>
>    Try downloading the file manually from the project website.
>
>    Then, install it using the command:
>        mvn install:install-file -DgroupId=commons-codec -
> DartifactId=commons-codec \
>            -Dversion=RELEASE -Dpackaging=jar -Dfile=/path/to/file
>
>    Path to dependency:
>          1) org.apache.abdera:abdera-client:jar:0.3.0-incubating-
> SNAPSHOT
>          2) commons-httpclient:commons-httpclient:jar:3.0
>          3) commons-codec:commons-codec:jar:RELEASE
>
> ----------
> 1 required artifact is missing.
>
> for artifact:
>    org.apache.abdera:abdera-client:jar:0.3.0-incubating-SNAPSHOT
>
> from the specified remote repositories:
>    central (http://repo1.maven.org/maven2)
>
>
>
>         Ugo
>
>
>
>


-- 
Stephen Duncan Jr
www.stephenduncanjr.com

Re: Abdera, commons-codec and Maven

Posted by Ugo Cei <ug...@gmail.com>.
On Dec 17, 2006, at 4:50 PM, Stephen Duncan wrote:

> And I think we should be able to satisfy your last request.
> Basically, when you just write the version in directly like we have,
> it's just a suggested version.  We should be able to write it as a
> version range.  Please try applying the attached patch, rerunning mvn
> install, and trying out your project again.

If I do that, it says:

[INFO]  
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]  
------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Missing:
----------
1) commons-codec:commons-codec:jar:RELEASE

   Try downloading the file manually from the project website.

   Then, install it using the command:
       mvn install:install-file -DgroupId=commons-codec - 
DartifactId=commons-codec \
           -Dversion=RELEASE -Dpackaging=jar -Dfile=/path/to/file

   Path to dependency:
         1) org.apache.abdera:abdera-client:jar:0.3.0-incubating- 
SNAPSHOT
         2) commons-httpclient:commons-httpclient:jar:3.0
         3) commons-codec:commons-codec:jar:RELEASE

----------
1 required artifact is missing.

for artifact:
   org.apache.abdera:abdera-client:jar:0.3.0-incubating-SNAPSHOT

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



	Ugo




Re: Abdera, commons-codec and Maven

Posted by Ugo Cei <ug...@gmail.com>.
On Dec 17, 2006, at 4:50 PM, Stephen Duncan wrote:

> You can run your Maven build with -X to get debug output, which will
> include the dependency info you need.  It's a little hard to read, so
> you could alternatively run "mvn
> project-info-reports:dependencies" and then open the html file it
> produces in target/site/dependencies.html

The problem lies with commons-httpclient 3.0, whose POM says:

     <dependency>
       <groupId>commons-codec</groupId>
       <artifactId>commons-codec</artifactId>
       <version>1.2</version>
     </dependency>


	Ugo


-- 
Ugo Cei
Sourcesense - Via Venezia 23, 20099 Sesto S.Giovanni (MI)
http://www.sourcesense.com




Re: Abdera, commons-codec and Maven

Posted by Ugo Cei <u....@sourcesense.com>.
On Dec 17, 2006, at 4:50 PM, Stephen Duncan wrote:

> You can run your Maven build with -X to get debug output, which will
> include the dependency info you need.  It's a little hard to read, so

Here's more info, from running mvn -X:

[DEBUG]     commons-httpclient:commons-httpclient:jar:3.0:test  
(selected for tes
t)
[DEBUG]       commons-logging:commons-logging:jar:1.0.3:test (removed  
- nearer f
ound: 1.1)
[DEBUG]       commons-codec:commons-codec:jar:1.2:test (selected for  
test)
[DEBUG] Skipping disabled repository central
[DEBUG] abdera-protocol: using locally installed snapshot
[DEBUG] Retrieving parent-POM: org.apache.abdera:abdera::0.3.0- 
incubating-SNAPSH
OT for project: null:abdera-protocol:jar:0.3.0-incubating-SNAPSHOT  
from the repo
sitory.
[DEBUG] abdera: using locally installed snapshot
[DEBUG]     org.apache.abdera:abdera-protocol:jar:0.3.0-incubating- 
SNAPSHOT:test
(selected for test)
[DEBUG]       org.apache.geronimo.specs:geronimo- 
activation_1.0.2_spec:jar:1.1:t
est (selected for test)
[DEBUG]       commons-codec:commons-codec:jar:1.3:test (removed -  
nearer found:
1.2)

Last line is interesting: "nearer found". Nearer to what?

	Ugo



-- 
Ugo Cei
Blog: http://agylen.com/
Open Source Zone: http://oszone.org/
Evil or Not?: http://evilornot.info/
Company: http://www.sourcesense.com/



Re: Abdera, commons-codec and Maven

Posted by Stephen Duncan <st...@gmail.com>.
You can run your Maven build with -X to get debug output, which will
include the dependency info you need.  It's a little hard to read, so
you could alternatively run "mvn
project-info-reports:dependencies" and then open the html file it
produces in target/site/dependencies.html

And I think we should be able to satisfy your last request.
Basically, when you just write the version in directly like we have,
it's just a suggested version.  We should be able to write it as a
version range.  Please try applying the attached patch, rerunning mvn
install, and trying out your project again.

-Stephen

On 12/17/06, Ugo Cei <ug...@gmail.com> wrote:
> Folks,
>
> I'm trying to build a project that uses Abdera, using Maven 2. Here's
> the list of dependencies taken from my POM:
>
>      <dependency>
>        <groupId>junit</groupId>
>        <artifactId>junit</artifactId>
>        <version>3.8.1</version>
>      </dependency>
>      <dependency>
>        <groupId>org.apache.abdera</groupId>
>        <artifactId>abdera-server</artifactId>
>        <version>0.3.0-incubating-SNAPSHOT</version>
>      </dependency>
>      <dependency>
>        <groupId>org.apache.abdera</groupId>
>        <artifactId>abdera-client</artifactId>
>        <version>0.3.0-incubating-SNAPSHOT</version>
>        <scope>test</scope>
>      </dependency>
>      <dependency>
>        <groupId>javax.servlet</groupId>
>        <artifactId>servlet-api</artifactId>
>        <version>2.4</version>
>      </dependency>
>      <dependency>
>        <groupId>commons-logging</groupId>
>        <artifactId>commons-logging</artifactId>
>        <version>1.1</version>
>      </dependency>
>      <dependency>
>        <groupId>log4j</groupId>
>        <artifactId>log4j</artifactId>
>        <version>1.2.9</version>
>      </dependency>
>      <dependency>
>        <groupId>org.springframework</groupId>
>        <artifactId>spring</artifactId>
>        <version>2.0.1</version>
>      </dependency>
>      <dependency>
>        <groupId>org.mortbay.jetty</groupId>
>        <artifactId>jetty</artifactId>
>        <version>6.0.0rc0</version>
>        <scope>test</scope>
>      </dependency>
>
> With these dependencies, my project builds but does not run because
> of a class introduced in commons-codec 1.3 but not yet there in
> commons-codec 1.2. Dependency on commons-codec is specified in
> Abdera's protocol/pom.xml. For some reason, Maven pulls down version
> 1.2 instead of 1.3, and this even if I specify the exact version in
> protocol/pom.xml.
>
> I can work around the issue by declaring an explicit dependency on
> 1.3 in my project's pom.xml, but I'd like to understand why this is
> happening. I have a hunch commons-codec is specified in the
> dependencies for one of the other libraries I'm using, but I don't
> know how to check, short of looking at all their POMs, recursively.
>
> Besides this, I'd like to know if we can somehow force evey project
> that includes Abdera libs as dependencies to download commons-codec
> 1.3 at least, to prevent other people from falling in the same trap I
> fell into.
>
>         Ugo
>
>


-- 
Stephen Duncan Jr
www.stephenduncanjr.com