Hi,
We tried both the ways
1.<settings><profiles><profile><repositories><repository><snapshotPolicy/>
2. -U
It did not work the first way and if we use second way we found one problem
Ex:
Step1: Developer A created a new artifact (artifact1 snapshot) in his local
machine and he don't want to move it to central repository untile he coplete
working with artfact2. Note: assume there is old artifact1 snapshot is
already in central repository.
Step2: Now he started working on artifact2 snapshot in his local machine and
artifact2 has dependency of artifact1 snapshot latest code.
When we use -U when working with artifact2 snapshot it is overwriting the
very latest artifact1 snapshot with old artifact1 snapshot in central
repository.
So we did some work around
1. we customized maven-plugin to write build.xml using pom.xml
And we added the followoing code to the following method:
writeGetDepsTarget(XMLWriter writer)
// TODO: proxy - probably better to use wagon!
for (Iterator i = project.getArtifacts().iterator(); i.hasNext();)
{
Artifact artifact = (Artifact) i.next();
// TODO: should the artifacthandler be used instead?
String path = toRelative(localRepository,
artifact.getFile().getPath());
String parentPath = toRelative(localRepository,
artifact.getFile().getParent());
----------------------------------------------------------------------------
----
for (Iterator j = project.getRepositories().iterator();
j.hasNext();)
{
Repository repository = (Repository) j.next();
if (repository.getUrl().indexOf(DEFAULT_REPO) == -1)
{
writer.startElement("mkdir");
------------------------------
writer.addAttribute("dir", "${maven.repo.local}/" +
parentPath);
writer.endElement();
writer.startElement("get");
writer.addAttribute("src", repository.getUrl() + "/" +
path);
writer.addAttribute("dest", "${maven.repo.local}/" +
path);
writer.addAttribute("usetimestamp", "true");
writer.addAttribute("ignoreerrors", "true");
writer.endElement(); // get
}
}
}
Thanks,
Pratapam.
-----Original Message-----
From: Nicolas Chalumeau [mailto:[EMAIL PROTECTED]
Sent: Friday, June 10, 2005 10:43 AM
To: Maven Users List
Subject: Re: Unable to get latest SNAPSHOT version from repository.
oups!!
You can do this in the settings.xml with the
<settings><profiles><profile><repositories><repository><snapshotPolicy/>
element
http://maven.apache.org/maven2/maven-settings/settings.html#class_Repository
2005/6/10, Nicolas Chalumeau <[EMAIL PROTECTED]>:
> In the http://maven.apache.org/maven2/maven1.html# page it is said :
>
> Improved SNAPSHOT handling - Snapshots are now checked for updates
> only once per day by default - though can be configured to be once per
> build, on a particular interval, or never. A command line option can
> force a check - making it more like updating from an SCM.
>
> I didn't try but I think its the -U command line option
>
> Nicolas
>
> 2005/6/10, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
> > Hi Brett,
> >
> > These are the steps:
> >
> > 1. Developer A update the snapshot in his local machine and put it in
> > central repository.
> > 2. When Developer B run m2 ant:ant he should get the latest snapshot
into
> > Developer B local re updated by A. But its not happening since Developer
B
> > local repository has previous version of snapshot (same file names
jar,pom
> > etc in the artifact).
> >
> > Maven is printing message saying "There is no update"
> >
> > Am I missing anyting wehen I install snapshot. Do I need to genarate
any
> > time stamp any where.
> >
> > Thanks,
> > Pratapam.
> >
> > --------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]