You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Francis Yuen <fy...@gmail.com> on 2008/09/05 20:42:20 UTC
How to stop Maven to look for updates on snapshots?
Hi,
I have a project A that depends on an artifact X which is a SNAPSHOT.
Artifact X uses a parent pom X1 which uses a parent pom X2. Both X1 and X2
are SNAPSHOTs. Artifact X, X1 and X2 are available from a remote repository
R.
In the pom of project A, I included repository R by defining its id, name
and url. Artifacts X, X1 and X2 were brought in to my local repository by
running mvn install on the project pom. I want to be able to stop Maven
from getting updates on artifact X. On a new day, if I run mvn install in
offline mode, the build fails. After I build the project in online mode,
subsequent builds on the same day can be run in offline mode. I did a
couple of tests:
Test 1.
I advanced the date to a day later than today and then ran "mvn -o -e
install". The build failed and the error was that X was missing. The error
messages suggested to download X manually from the project site and then
install it using mvn install:install.
Test 2.
In the pom of project A, I added
<snapshots><updatePolicy>never</updatePolicy></snapshots> to respository
section of R. I advanced the date to a day later and then ran "mvn -o -e
install". The build failed. The message thrown by
org.apache.maven.artifact.resolver.ArtifactResolutionException indicated
that it was unable to read the metadata file for artifact X: Cannot find
parent X2 for X1 for X.
It looks like that in Test 1, Maven did not see X to be in my local
repository. In Test 2, by introducing repository snapshot never update
policy in the project pom, Maven seems to see X and X1 but not X2.
I am fairly new to Maven. Can someone tell me how to stop Maven to look for
updates on snapshots (or its parent pom)?
Re: How to stop Maven to look for updates on snapshots?
Posted by Rémy Sanlaville <re...@gmail.com>.
Hi,
It seems that the offline mode does not work with SNAPSHOT.
You also have this issue : http://jira.codehaus.org/browse/MNG-3314
Rémy
Re: How to stop Maven to look for updates on snapshots?
Posted by Olivier THIERRY <ol...@gmail.com>.
It looks like this issue : http://jira.codehaus.org/browse/MNG-2433
It is supposed to have been corrected with Maven 2.0.6, but I still have the
problem with Maven 2.0.8 and it happened to me when doing a demonstration
with no internet connection, not funny at all.
This issue has to be reopened !
2008/9/5 Francis Yuen <fy...@gmail.com>
> Hi,
> I have a project A that depends on an artifact X which is a SNAPSHOT.
> Artifact X uses a parent pom X1 which uses a parent pom X2. Both X1 and X2
> are SNAPSHOTs. Artifact X, X1 and X2 are available from a remote
> repository
> R.
>
> In the pom of project A, I included repository R by defining its id, name
> and url. Artifacts X, X1 and X2 were brought in to my local repository by
> running mvn install on the project pom. I want to be able to stop Maven
> from getting updates on artifact X. On a new day, if I run mvn install in
> offline mode, the build fails. After I build the project in online mode,
> subsequent builds on the same day can be run in offline mode. I did a
> couple of tests:
>
> Test 1.
> I advanced the date to a day later than today and then ran "mvn -o -e
> install". The build failed and the error was that X was missing. The
> error
> messages suggested to download X manually from the project site and then
> install it using mvn install:install.
>
> Test 2.
> In the pom of project A, I added
> <snapshots><updatePolicy>never</updatePolicy></snapshots> to respository
> section of R. I advanced the date to a day later and then ran "mvn -o -e
> install". The build failed. The message thrown by
> org.apache.maven.artifact.resolver.ArtifactResolutionException indicated
> that it was unable to read the metadata file for artifact X: Cannot find
> parent X2 for X1 for X.
>
> It looks like that in Test 1, Maven did not see X to be in my local
> repository. In Test 2, by introducing repository snapshot never update
> policy in the project pom, Maven seems to see X and X1 but not X2.
>
> I am fairly new to Maven. Can someone tell me how to stop Maven to look
> for
> updates on snapshots (or its parent pom)?
>