You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Kevin Moran <gr...@yahoo.com> on 2007/04/16 11:48:25 UTC

[M2] Newbie Problem with Snapshot Dependencies

Hello all,
    I've set up a Maven 2 repository and followed the
directions at http://maven.apache.org/ant-tasks.html
to retrofit my project's build.xml's so they pull in
dependencies from my repository.

    I set up each build file's classpath along the
lines of

<artifact:dependencies
    pathId="dependency.classpath"
    filesetId="dependency.fileset">

    <remoteRepository="my.maven.repository"/>
    <pom refid="my.pom.reference"/>
</artifact:dependencies>

and then referenced the classpath
("dependency.classpath") in my build files' <javac>
tasks.

    What I'm seeing is that my compilations work fine
as long as my build files don't depend on snapshot
jars.  If I specify a dependency on a snapshot, it
downloads the latest Jar from the repository, but does
not specify the correct path to it in the classpath.

    What I end up with under $HOME/.m2/repository is
the Jar being installed under, say, 1.0-SNAPSHOT:

$HOME/.m2/repository/myGroup/myJar/1.0-SNAPSHOT/myJar-1.0-SNAPSHOT.jar
$HOME/.m2/repository/myGroup/myJar/1.0-SNAPSHOT/myJar-1.0-20070416.064415-1.jar
...

But if I echo dependency.classpath in my build.xml, I
see it's not looking for myJar under 1.0-SNAPSHOT. 
It's looking for it under, say, 1.0-20070416.064415-1:

$HOME/.m2/repository/myGroup/myJar/1.0-20070416.064415-1/myJar-1.0-20070416.064415-1.jar

Because there is no 1.0-20070416.064415-1 directory
(just a 1.0-SNAPSHOT directory), <javac> fails.

Is this a known bug or am I doing something wrong?  If
it's a known bug, is there a workaround?  I'm
desperate to get snapshots working.

Thanks in advance,
Kevin Moran

P.S. I am using Maven 2.0.5 and maven-artifact-ant-2.0.4-dep.jar.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: [M2] Newbie Problem with Snapshot Dependencies

Posted by Kevin Moran <gr...@yahoo.com>.
Thank you, Jo, for the quick response.  Unfortunately,
the problem persists even with snapshots and releases
enabled.

After you responded, I found someone with the same
problem:

http://mail-archives.apache.org/mod_mbox/maven-users/200606.mbox/%3C3F227B042654B049A3C1B7B10FF65A08033AA0FA@exchange.inside.eclyptic.com%3E

The problem is that Maven is generating the wrong
classpath when snapshots are involved.

Unless I am mistaken, this is still broken in Maven. 
But there is a suggested patch.  If I can figure out
how to build the maven-artifact-ant Jar using it, I
will see if it fixes the problem.

Thanks for your help.  Wish me luck!
Kevin Moran

--- Jo Vandermeeren <jo...@gmail.com> wrote:

> Kevin,
> 
> You have to enable snapshots for your repository.
> I haven't tried it myself using the ant lib, but you
> could try to set the
> 'releases' and 'snapshots' attributes both to
> 'true'.
> 
> Cheers
> Jo
> 
> On 4/16/07, Kevin Moran <gr...@yahoo.com> wrote:
> >
> > Hello all,
> >     I've set up a Maven 2 repository and followed
> the
> > directions at
> http://maven.apache.org/ant-tasks.html
> > to retrofit my project's build.xml's so they pull
> in
> > dependencies from my repository.
> >
> >     I set up each build file's classpath along the
> > lines of
> >
> > <artifact:dependencies
> >     pathId="dependency.classpath"
> >     filesetId="dependency.fileset">
> >
> >     <remoteRepository="my.maven.repository"/>
> >     <pom refid="my.pom.reference"/>
> > </artifact:dependencies>
> >
> > and then referenced the classpath
> > ("dependency.classpath") in my build files'
> <javac>
> > tasks.
> >
> >     What I'm seeing is that my compilations work
> fine
> > as long as my build files don't depend on snapshot
> > jars.  If I specify a dependency on a snapshot, it
> > downloads the latest Jar from the repository, but
> does
> > not specify the correct path to it in the
> classpath.
> >
> >     What I end up with under $HOME/.m2/repository
> is
> > the Jar being installed under, say, 1.0-SNAPSHOT:
> >
> >
>
$HOME/.m2/repository/myGroup/myJar/1.0-SNAPSHOT/myJar-1.0-SNAPSHOT.jar
> >
>
$HOME/.m2/repository/myGroup/myJar/1.0-SNAPSHOT/myJar-
> > 1.0-20070416.064415-1.jar
> > ...
> >
> > But if I echo dependency.classpath in my
> build.xml, I
> > see it's not looking for myJar under 1.0-SNAPSHOT.
> > It's looking for it under, say,
> 1.0-20070416.064415-1:
> >
> >
>
$HOME/.m2/repository/myGroup/myJar/1.0-20070416.064415-1/myJar-
> > 1.0-20070416.064415-1.jar
> >
> > Because there is no 1.0-20070416.064415-1
> directory
> > (just a 1.0-SNAPSHOT directory), <javac> fails.
> >
> > Is this a known bug or am I doing something wrong?
>  If
> > it's a known bug, is there a workaround?  I'm
> > desperate to get snapshots working.
> >
> > Thanks in advance,
> > Kevin Moran
> >
> > P.S. I am using Maven 2.0.5 and
> maven-artifact-ant-2.0.4-dep.jar.
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around
> > http://mail.yahoo.com
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> users-unsubscribe@maven.apache.org
> > For additional commands, e-mail:
> users-help@maven.apache.org
> >
> >
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: [M2] Newbie Problem with Snapshot Dependencies

Posted by Jo Vandermeeren <jo...@gmail.com>.
Kevin,

You have to enable snapshots for your repository.
I haven't tried it myself using the ant lib, but you could try to set the
'releases' and 'snapshots' attributes both to 'true'.

Cheers
Jo

On 4/16/07, Kevin Moran <gr...@yahoo.com> wrote:
>
> Hello all,
>     I've set up a Maven 2 repository and followed the
> directions at http://maven.apache.org/ant-tasks.html
> to retrofit my project's build.xml's so they pull in
> dependencies from my repository.
>
>     I set up each build file's classpath along the
> lines of
>
> <artifact:dependencies
>     pathId="dependency.classpath"
>     filesetId="dependency.fileset">
>
>     <remoteRepository="my.maven.repository"/>
>     <pom refid="my.pom.reference"/>
> </artifact:dependencies>
>
> and then referenced the classpath
> ("dependency.classpath") in my build files' <javac>
> tasks.
>
>     What I'm seeing is that my compilations work fine
> as long as my build files don't depend on snapshot
> jars.  If I specify a dependency on a snapshot, it
> downloads the latest Jar from the repository, but does
> not specify the correct path to it in the classpath.
>
>     What I end up with under $HOME/.m2/repository is
> the Jar being installed under, say, 1.0-SNAPSHOT:
>
> $HOME/.m2/repository/myGroup/myJar/1.0-SNAPSHOT/myJar-1.0-SNAPSHOT.jar
> $HOME/.m2/repository/myGroup/myJar/1.0-SNAPSHOT/myJar-
> 1.0-20070416.064415-1.jar
> ...
>
> But if I echo dependency.classpath in my build.xml, I
> see it's not looking for myJar under 1.0-SNAPSHOT.
> It's looking for it under, say, 1.0-20070416.064415-1:
>
> $HOME/.m2/repository/myGroup/myJar/1.0-20070416.064415-1/myJar-
> 1.0-20070416.064415-1.jar
>
> Because there is no 1.0-20070416.064415-1 directory
> (just a 1.0-SNAPSHOT directory), <javac> fails.
>
> Is this a known bug or am I doing something wrong?  If
> it's a known bug, is there a workaround?  I'm
> desperate to get snapshots working.
>
> Thanks in advance,
> Kevin Moran
>
> P.S. I am using Maven 2.0.5 and maven-artifact-ant-2.0.4-dep.jar.
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>