Unable to get latest SNAPSHOT version from repository.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Unable to get latest SNAPSHOT version from repository.

Kakarla_Pratapam

Hi,

   I am using Maven 2.0.

   My problem is  unable to get the latest SNAPSHOT version from our central
repository to local repository when I run m2 ant:ant in my local machine.

Any thoughts.

Thanks,
Pratapam.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Unable to get latest SNAPSHOT version from repository.

Brett Porter
Can you describe what you mean by "unable". What goes wrong?

- Brett

On 6/10/05, [hidden email] <[hidden email]> wrote:

>
> Hi,
>
>    I am using Maven 2.0.
>
>    My problem is  unable to get the latest SNAPSHOT version from our central
> repository to local repository when I run m2 ant:ant in my local machine.
>
> Any thoughts.
>
> Thanks,
> Pratapam.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Unable to get latest SNAPSHOT version from repository.

Kakarla_Pratapam
In reply to this post by Kakarla_Pratapam
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Unable to get latest SNAPSHOT version from repository.

Nicolas Chalumeau
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, [hidden email] <[hidden email]>:

> 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: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Unable to get latest SNAPSHOT version from repository.

Nicolas Chalumeau
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 <[hidden email]>:

> 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, [hidden email] <[hidden email]>:
> > 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: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: Unable to get latest SNAPSHOT version from repository.

Kakarla_Pratapam
In reply to this post by Kakarla_Pratapam
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:[hidden email]]
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 <[hidden email]>:

> 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, [hidden email] <[hidden email]>:
> > 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: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Unable to get latest SNAPSHOT version from repository.

Brett Porter
I think I understand now. So m2 is working fine - it is when using Ant
that the snapshots are not updated? We will eventually changer the
generated script to use the Maven tasks instead of get which will make
them behave identically.

It sounds like your local developer is using m2 to generate the ant
build file locally. If that is the case - is there a reason they
aren't using m2 to build straight away?

- Brett

On 6/11/05, [hidden email] <[hidden email]> wrote:

> 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:[hidden email]]
> 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 <[hidden email]>:
> > 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, [hidden email] <[hidden email]>:
> > > 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: [hidden email]
> > > For additional commands, e-mail: [hidden email]
> > >
> > >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]