maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Schaible <Joerg.Schai...@scalaris.com>
Subject Re: <updatePolicy>always</updatePolicy> not working for <releases> with Maven 3.0.4
Date Fri, 18 Jan 2013 08:22:58 GMT
Hi,

Maven User wrote:

> We produce a large application from the artifacts of 15+ components, many
> which contain multiple modules.  The version numbers are all the same, and
> a build cycle takes about four hours.
> 
> Late in a development cycle we run numbered (i.e. non “-SNAPSHOT”) builds
> in continuous integration mode.  Doing so facilitates quicker turnaround
> times of last minute bugs.  Once a package is actually delivered to QA we
> return to producing -SNAPSHOT artifacts.

What does that mean in real?

> We are aware re-producing numbered artifacts is not a best practice.  Part
> of the reason we felt like running a numbered build in CI mode would work
> is the “update policy” option which is available for "releases." See
> http://maven.apache.org/ref/3.0.4/maven-settings/settings.html.  By our
> reading, this setting should enable the updating of numbered artifacts in
> the local Maven cache with a newer version from the central repository (we
> are using Artifactory Pro 2.5.1).
> 
> 
> Instead, we observe this behavior:
> 
> Starting from an empty local Maven cache, the build of component #2 works
> as designed.
> 
> However, after component #1 is rebuilt, a rebuild of component #2, which
> is dependent on the jar file produced by the build of component #1, the
> execution of “mvn –U clean deploy” fails to update the recently modified
> numbered artifact in the local Maven cache.
> 
> 
> The routine below is part of ${MAVEN_HOME}/conf/settings.xml:
> 
>   <profiles>
>     <profile>
>         <id>Repositories</id>
>         <activation>
>               <activeByDefault>true</activeByDefault>
>         </activation>
> 
>         <repositories>
>             <repository>
>                   <id>Artifactory</id>
>                   <name>Artifactory Public Mirror</name>
>                   
<url>http://machine.domain.com:8082/artifactory/repo</url>
>                   <layout>default</layout>
>                   <releases>
>                       <enabled>true</enabled>
>                       <updatePolicy>always</updatePolicy>

A release is a release i.e. a unique artifact. There will be no updates. You 
may set this as well to "none".

>                   </releases>
>                   <snapshots>
>                       <enabled>true</enabled>
>                       <updatePolicy>always</updatePolicy>
>                   </snapshots>
>               </repository>
>         </repositories>
>       </profile>
>     </profiles>
> 
> 
> 
> Does anyone have any insight into why the local Maven cache is not being
> updated with the newer numbered artifacts from our Artifactory repository?

Depends on your real numbering scheme. E.g. as Maven n00bs we tried once a 
development scheme like

1.0-SNAPSHOT --> 1.0.0 --> 1.0-SNAPSHOT --> 1.0.1 --> 1.0-SNAPSHOT

This fails miserably, because 1.0-SNAPHSOT is the equivalent of 1.0.0-
SNAPSHOT and therefore the SNAPSHOT is always considered to be of a lesser 
number than any release.

See, what I mean?

- Jörg


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


Mime
View raw message