maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From saavyone <>
Subject Re: maven-metadata-local.xml <localCopy>
Date Mon, 28 Mar 2011 19:36:17 GMT
We're struggling with this as well!

Our team has 5 inter-dependent projects (not circularly) and a dozen
developers. Once any of the projects are 'mvn install'ed for any reason,
they become "locally managed" and FORGET about getting any updates from
Nexus ever again! While working on that project, it works like it should,
i.e. I don't want Nexus stomping my work. But, once I'm done i want to turn
control back over to Nexus (switch from "locally managed" to "remotely
managed"). Now, I know we could edit localCopy to be false, but is that
really a feature or a hassle? I would think using -U should do this. But,
alas it does not. Instead of surgically altering our artifacts' metadata in
the repository, It's just easier to delete the local repository (which is
what we all do).

Has this never come up in Maven-land? What do you maven-ites do in this

I did find the following bug:
But, I haven't tried the patch because building/running a custom build of
maven seems too hack-ish. Let's vote this up and get it fixed!


Halvor Platou wrote:
> Thanks for the answers!
> We are using version 2.2.1. Remember that you need to build the artifact
> at your computer for the maven-metadata-local.xml to be written to your
> local repository with the &lt;localCopy&gt; tag.
> I now also see that there are two maven-metadata-local.xml. One in the
> root folder of the artifact in the repository and one inside the
> x.x-SNAPSHOT folder. It is only the one inside the x.x-SNAPSHOT folder
> that has this content. Here is an example:
> &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
> &lt;metadata&gt;
>   &lt;groupId&gt;com.mycomp&lt;/groupId&gt;
>   &lt;artifactId&gt;test&lt;/artifactId&gt;
>   &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
>   &lt;versioning&gt;
>     &lt;snapshot&gt;
>       &lt;localCopy&gt;true&lt;/localCopy&gt;
>     &lt;/snapshot&gt;
>     &lt;lastUpdated&gt;20100422213001&lt;/lastUpdated&gt;
>   &lt;/versioning&gt;
> &lt;/metadata&gt;
> Halvor
> On Apr22, 2010, at 8:23 PM, Ron Wheeler wrote:
> &gt; What version of Maven?
> &gt; 
> &gt; I do not see that tag in my local repo. I only checked a few
> Artifacts 
> &gt; but none of them had that line.
> &gt; I am  using Maven 2.2.1 under Eclipse but I am not sure that this
> would 
> &gt; make any difference.
> &gt; 
> &gt; Sorry that I am not more help but perhaps one of the smart guys might 
> &gt; know what is happening.
> &gt; 
> &gt; Ron
> &gt; 
> &gt; On 22/04/2010 2:13 PM, Halvor Platou wrote:
> &gt;&gt; Yes, these are all SNAPSHOT versions. Earlier this has not bee a
> problem, but now it seems to be very consistent behavior. We have tried
> this with several computers and they all show the same problem. We have
> also tried with several remote repositories. Does anyone know the meaning
> of the&lt;localCopy&gt;  in maven-metadata.xml?
> &gt;&gt; 
> &gt;&gt; Halvor
> &gt;&gt; 
> &gt;&gt; 
> &gt;&gt; On Apr22, 2010, at 8:01 PM, Ron Wheeler wrote:
> &gt;&gt; 
> &gt;&gt; 
> &gt;&gt;&gt; On 22/04/2010 11:00 AM, Halvor Platou wrote:
> &gt;&gt;&gt; 
> &gt;&gt;&gt;&gt; Hello
> &gt;&gt;&gt;&gt; 
> &gt;&gt;&gt;&gt; We have a problem concerning building of maven snapshot
> artifacts that seems very odd.
> &gt;&gt;&gt;&gt; 
> &gt;&gt;&gt;&gt; Let's say we have artifact: &quot;A&quot; and
> &quot;B&quot;.
> &gt;&gt;&gt;&gt; &quot;A&quot; depends on &quot;B&quot;.
> &gt;&gt;&gt;&gt; If we build both of these on one computer, everything
> seems fine.
> &gt;&gt;&gt;&gt; 
> &gt;&gt;&gt;&gt; If then artifact &quot;B&quot; is built and
> deployed(Nexus) on a different computer, &quot;mvn install -U&quot; on
> artifact &quot;A&quot; on the first computer will not get the new artifact
> &quot;B&quot;, but use the one in the local repository.
> &gt;&gt;&gt;&gt; 
> &gt;&gt;&gt;&gt; It seems that when we build locally the file
> &quot;maven-metadata-local.xml&quot; is created in the local repository
> containing&lt;localCopy&gt;true&lt;/localCopy&gt;. As long as this is
> to true it will not get any new artifacts from the remote
> repository(Nexus) even if they are newer and we specify -U. Removing the
> localCopy line or changing it to false will make it download the new
> artifact.
> &gt;&gt;&gt;&gt; 
> &gt;&gt;&gt;&gt;  Is it supposed to be like this? And has it always been
> like this?
> &gt;&gt;&gt;&gt; 
> &gt;&gt;&gt;&gt; Halvor
> &gt;&gt;&gt;&gt; 
> &gt;&gt;&gt;&gt; 
> &gt;&gt;&gt; Since you are deploying multiple times, you should be using
> &gt;&gt;&gt; and you should always get the latest from the Nexus.
> &gt;&gt;&gt; 
> &gt;&gt;&gt; If they are releases, then it should not matter whether you
> get it from
> &gt;&gt;&gt; your local repo or somewhere else since releases are
> immutable and all
> &gt;&gt;&gt; copies of the same release versions are supposed to be
> identical.
> &gt;&gt;&gt; 
> &gt;&gt;&gt; If you make a mistake in a release, you have to delete the
> bad copy from
> &gt;&gt;&gt; everywhere that has the wrong release.
> &gt;&gt;&gt; 
> &gt;&gt;&gt; 
> &gt;&gt;&gt; Ron
> &gt;&gt;&gt; 
> &gt;&gt;&gt; 
> &gt;&gt;&gt; 
> &gt;&gt;&gt;
> ---------------------------------------------------------------------
> &gt;&gt;&gt; To unsubscribe, e-mail:
> &gt;&gt;&gt; For additional commands, e-mail:
> &gt;&gt;&gt; 
> &gt;&gt;&gt; 
> &gt;&gt;&gt; 
> &gt;&gt; 
> &gt; 
> &gt; 
> &gt; ---------------------------------------------------------------------
> &gt; To unsubscribe, e-mail:
> &gt; For additional commands, e-mail:
> &gt; 
> &gt;

View this message in context:
Sent from the Maven - Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message