You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Christopher Patti <cp...@broad.mit.edu> on 2008/12/31 19:32:27 UTC

Why does my multiproject build revert to taking SNAPSHOT versions of dependencies when I want a specified version?

Folks;

I've run into this problem before, and have never been able to explain it.

We have a number of dependent sub-projects, and whenever I try to do a build
from one of the sub-projects, somewhere down the dependency chain it
switches away from the version I'm specifying with -Dbuild.version and back
to SNAPSHOT, causing the build to fail.

Here's some sample output:
--------
1:17pm prodinfo@node179 /prodinfolocal/buildareas/squid/R2_5_653/salmon >
mvn -PPROD -Dsquid.version=R2_5_653H1 -Dbuild.version=R2_5_653H1
-Dproject.version=R2_5_653H1 -Dmaven.test.skip=true install
[INFO] Scanning for projects...
[INFO]
------------------------------------------------------------------------
[INFO] Building Squid Salmon UI
[INFO]    task-segment: [install]
[INFO]
------------------------------------------------------------------------
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
Downloading:
http://prodinfosvn.broad.mit.edu:8000/m2-repository/Squid/SquidEntities/1.0-SNAPSHOT/SquidEntities-1.0-SNAPSHOT.pom
Downloading:
http://prodinfosvn.broad.mit.edu:8000/m2-repository/Squid/dbawrappers/1.0-SNAPSHOT/dbawrappers-1.0-SNAPSHOT.pom
Downloading:
http://prodinfosvn.broad.mit.edu:8000/m2-repository/jadm/jadm/1.0-SNAPSHOT/jadm-1.0-SNAPSHOT.pom
Downloading:
http://prodinfosvn.broad.mit.edu:8000/m2-repository/Squid/SquidEntities/1.0-SNAPSHOT/SquidEntities-1.0-SNAPSHOT.jar
Downloading:
http://prodinfosvn.broad.mit.edu:8000/m2-repository/jadm/jadm/1.0-SNAPSHOT/jadm-1.0-SNAPSHOT.jar
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Missing:
----------
1) Squid:SquidEntities:jar:1.0-SNAPSHOT

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=Squid -DartifactId=SquidEntities
-Dversion=1.0-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file
there:
      mvn deploy:deploy-file -DgroupId=Squid -DartifactId=SquidEntities
-Dversion=1.0-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url]
-DrepositoryId=[id]

  Path to dependency:
        1) Squid:salmon:jar:R2_5_653H1
        2) Squid:common:jar:R2_5_653H1
        3) Squid:SquidEntities:jar:1.0-SNAPSHOT

2) jadm:jadm:jar:1.0-SNAPSHOT

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=jadm -DartifactId=jadm
-Dversion=1.0-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file
there:
      mvn deploy:deploy-file -DgroupId=jadm -DartifactId=jadm
-Dversion=1.0-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url]
-DrepositoryId=[id]

  Path to dependency:
        1) Squid:salmon:jar:R2_5_653H1
        2) bettalims:bettalims:jar:R2_5_653H1
        3) jadm:jadm:jar:1.0-SNAPSHOT

----------
2 required artifacts are missing.

for artifact:
  Squid:salmon:jar:R2_5_653H1

from the specified remote repositories:
  central (http://repo1.maven.org/maven2),
  codehaus (http://repository.codehaus.org/),
  sourceforge (http://repository.codehaus.org/),
  internal (http://prodinfosvn.broad.mit.edu:8000/m2-repository)


[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 4 seconds
[INFO] Finished at: Wed Dec 31 13:18:22 EST 2008
[INFO] Final Memory: 17M/244M
[INFO]
------------------------------------------------------------------------
9.185u 0.508s 0:05.51 175.6%    0+0k 0+0io 1pf+0w
1:18pm prodinfo@node179 /prodinfolocal/buildareas/squid/R2_5_653/salmon >
------

Why does it all of a sudden switch from the version I want (R2_5_653H1) to
SNAPSHOT here?

Hers's the way the dependency is specified in this (salmon) subproject's
POM:
----
    <dependency>
      <groupId>Squid</groupId>
      <artifactId>common</artifactId>
      <version>${build.version}</version>
    </dependency>
----

and here's the dependency to the failing SquidEntities in the common POM:

---
        <dependency>
            <groupId>Squid</groupId>
            <artifactId>SquidEntities</artifactId>
            <version>${project.version}</version>
        </dependency>

----

I'd appreciate any clues, as I'm out of ideas.

Thanks!
-Chris


-- 
Christopher Patti - Release Engineer - E-Mail: cpatti@broad.mit.edu
Y! feoh AIM: chrisfeohpatti GTalk/Jabber: cpatti@gmail.com
Phone - Work: 617-324-2820 Cell: 617-710-1806 Home: 617-764-5887

Re: Why does my multiproject build revert to taking SNAPSHOT versions of dependencies when I want a specified version?

Posted by Christopher Patti <cp...@broad.mit.edu>.
On Mon, Jan 5, 2009 at 2:52 PM, Christopher Patti <cp...@broad.mit.edu>wrote:

> On Thu, Jan 1, 2009 at 2:59 AM, Wayne Fay <wa...@gmail.com> wrote:
>
>> > Why does it all of a sudden switch from the version I want (R2_5_653H1)
>> to
>> > SNAPSHOT here?
>>
>> Bugs have been filed in Jira against various Maven2 versions involving
>> the dotted notation of properties. Specifically, it seems like
>> anything before the final dot is sometimes ignored, so
>> this.is.a.property.version is evaluated as simply version which is
>> usually project.version.
>>
>> I'd replace your dots with underlines and see if you have different
>> results. I moved away from dots entirely the first time this bug hit
>> me a while back. I can't give you a specific Jira to look at/follow
>> but I'm sure you could find it/one of them (I feel like there are a
>> couple).
>>
>> Wayne
>>
>
> Thanks, this is a good point and might also help explain some other
> problems we've had.
>
> This will very likely cause my novice Maven 2 skills to show, but I can't
> just change:
> ---
>         <dependency>
>                 <groupId>Squid</groupId>
>                 <artifactId>dbawrappers</artifactId>
>                 <version>${build.version}</version>
>         </dependency>
> ---
> to:
> ---
>         <dependency>
>                 <groupId>Squid</groupId>
>                 <artifactId>dbawrappers</artifactId>
>                 <version>${build_version}</version>
>         </dependency>
> ---
>
> Can I? Won't that break the desired "If no version is specified, use
> SNAPSHOT' behavior I'm trying to override for versioned builds?
>
> Thanks,
> -Chris
>


Aha! If I use use ${version} that seems to fix the problem! Thanks so much!
-Chris

-- 
Christopher Patti - Release Engineer - E-Mail: cpatti@broad.mit.edu
Y! feoh AIM: chrisfeohpatti GTalk/Jabber: cpatti@gmail.com
Phone - Work: 617-324-2820 Cell: 617-710-1806 Home: 617-764-5887

Re: Why does my multiproject build revert to taking SNAPSHOT versions of dependencies when I want a specified version?

Posted by Christopher Patti <cp...@broad.mit.edu>.
On Thu, Jan 1, 2009 at 2:59 AM, Wayne Fay <wa...@gmail.com> wrote:

> > Why does it all of a sudden switch from the version I want (R2_5_653H1)
> to
> > SNAPSHOT here?
>
> Bugs have been filed in Jira against various Maven2 versions involving
> the dotted notation of properties. Specifically, it seems like
> anything before the final dot is sometimes ignored, so
> this.is.a.property.version is evaluated as simply version which is
> usually project.version.
>
> I'd replace your dots with underlines and see if you have different
> results. I moved away from dots entirely the first time this bug hit
> me a while back. I can't give you a specific Jira to look at/follow
> but I'm sure you could find it/one of them (I feel like there are a
> couple).
>
> Wayne
>

Thanks, this is a good point and might also help explain some other problems
we've had.

This will very likely cause my novice Maven 2 skills to show, but I can't
just change:
---
        <dependency>
                <groupId>Squid</groupId>
                <artifactId>dbawrappers</artifactId>
                <version>${build.version}</version>
        </dependency>
---
to:
---
        <dependency>
                <groupId>Squid</groupId>
                <artifactId>dbawrappers</artifactId>
                <version>${build_version}</version>
        </dependency>
---

Can I? Won't that break the desired "If no version is specified, use
SNAPSHOT' behavior I'm trying to override for versioned builds?

Thanks,
-Chris
-- 
Christopher Patti - Release Engineer - E-Mail: cpatti@broad.mit.edu
Y! feoh AIM: chrisfeohpatti GTalk/Jabber: cpatti@gmail.com
Phone - Work: 617-324-2820 Cell: 617-710-1806 Home: 617-764-5887

Re: Why does my multiproject build revert to taking SNAPSHOT versions of dependencies when I want a specified version?

Posted by Wayne Fay <wa...@gmail.com>.
> Why does it all of a sudden switch from the version I want (R2_5_653H1) to
> SNAPSHOT here?

Bugs have been filed in Jira against various Maven2 versions involving
the dotted notation of properties. Specifically, it seems like
anything before the final dot is sometimes ignored, so
this.is.a.property.version is evaluated as simply version which is
usually project.version.

I'd replace your dots with underlines and see if you have different
results. I moved away from dots entirely the first time this bug hit
me a while back. I can't give you a specific Jira to look at/follow
but I'm sure you could find it/one of them (I feel like there are a
couple).

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org