You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Stanley Lee <ma...@gmail.com> on 2008/04/01 15:48:44 UTC

How to force the check of the latest dependency jars?

Hi all,

Assume project A depends on lib1.jar. When I build project A, first time it
will go to get the latest lib1.jar. After that, it only tries so if last
check was 1 day ago or more.

Is there any way to force the build to check out latest lib1.jar?

I saw mvn command line has an option --update-snapshots, and tried it.
However, on screen, I don't see any hint that Maven try to connect to
repository and pull the latest lib1.jar.

Your help is highly appreciated!

Stan

Re: How to force the check of the latest dependency jars?

Posted by simon <si...@chello.at>.
If the artifact that you want to get the latest of *is* a snapshot, then
how often maven checks depends on your repository definition. When a
repo is defined (in a pom or settings.xml) there is an optional element
that says how often it is checked for updated snapshots. This defaults
to 1 day, but can also be set to "every time".

If you have a setup where you have some developers deploying snapshots
to an internal company repo frequently, then adjusting the default value
is useful. But if a new snapshot is only every few days, it is probably
easier for an email to be sent out telling people to run "mvn -U" on
their next build to get the latest snapshot. And setting "every time"
for the settings referencing the apache snapshot repo will not be
terribly popular...if everyone did that, the load on the server would be
much much higher.

See the pom reference documentation on the maven site for details on the
schema for settings.xml or pom.xml files.

Regards,
Simon

On Tue, 2008-04-01 at 11:34 -0500, Wayne Fay wrote:
> mvn -U forces Maven to check for updates.
> 
> But lib1.jar is not a snapshot, so Maven will not look for updates to
> it. Only if the name was lib1-SNAPSHOT.jar. Things that don't have
> SNAPSHOT in the name are considered "final" and immutable, thus Maven
> will never look for updates to those files as they cannot exist (if
> you are doing things right).
> 
> Wayne
> 
> On 4/1/08, Stanley Lee <ma...@gmail.com> wrote:
> > Hi all,
> >
> > Assume project A depends on lib1.jar. When I build project A, first time it
> > will go to get the latest lib1.jar. After that, it only tries so if last
> > check was 1 day ago or more.
> >
> > Is there any way to force the build to check out latest lib1.jar?
> >
> > I saw mvn command line has an option --update-snapshots, and tried it.
> > However, on screen, I don't see any hint that Maven try to connect to
> > repository and pull the latest lib1.jar.
> >
> > Your help is highly appreciated!
> >
> > Stan
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 


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


Re: How to force the check of the latest dependency jars?

Posted by Wayne Fay <wa...@gmail.com>.
mvn -U forces Maven to check for updates.

But lib1.jar is not a snapshot, so Maven will not look for updates to
it. Only if the name was lib1-SNAPSHOT.jar. Things that don't have
SNAPSHOT in the name are considered "final" and immutable, thus Maven
will never look for updates to those files as they cannot exist (if
you are doing things right).

Wayne

On 4/1/08, Stanley Lee <ma...@gmail.com> wrote:
> Hi all,
>
> Assume project A depends on lib1.jar. When I build project A, first time it
> will go to get the latest lib1.jar. After that, it only tries so if last
> check was 1 day ago or more.
>
> Is there any way to force the build to check out latest lib1.jar?
>
> I saw mvn command line has an option --update-snapshots, and tried it.
> However, on screen, I don't see any hint that Maven try to connect to
> repository and pull the latest lib1.jar.
>
> Your help is highly appreciated!
>
> Stan
>

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