[ 
http://jira.codehaus.org/browse/MNG-3092?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_121117
 ] 

Richard Ziegler commented on MNG-3092:
--------------------------------------

We have worked around this issue in the following way:

   # Setup multiple repositories internally - one for SNAPSHOT builds, and one 
for release builds.  (We use Artifactory)
   # Configured maven profiles to select whether the SNAPSHOT repository is 
active.  
   # Created scripts to rid the local repository of SNAPSHOTS under certain 
conditions, like when performing a release.

Here is the script we use to perform a release of an artifact.
Notice it just moves one small part of the local repo out of the way.

{code}
#!/bin/zsh
[ -z "$2" ] && {
   echo
   echo "Usage: $0 scmCommentPrefix tag [additional maven opts]"
   echo
   echo "Where:"
   echo " scmCommentPrefix should be the JIRA ID of the release issue, like 
KWE-55"
   echo " tag is the release number, like 1.1"
   echo " optional additional maven opts, like -Paxis"
   exit 1;
}

d=$(dirname `which $0`)
. $d/fixenv.sh

# maven chokes on cygwin svn in path prior to native port... so fix path if on 
cygwin
[ -d /cygdrive/c/opt/svn-win32-1.4.5/bin ] && 
PATH="/cygdrive/c/opt/svn-win32-1.4.5/bin:$PATH"

pre=$1
tag=$2
shift 2

# Swap out qa dir of local repo that may have snapshots for one that doesn't
qar=${qar:-~/.qa-release}
qas=${qas:-~/.qa-snaps}
ciq="$ILM2_REPO/com/company/qa"

echo MOVING AWAY SNAPSHOT CONTAMINATED LOCAL REPO
[ -d $qas -a -d $ciq ] && rm -rf $qas
[ -d $ciq ] && mv -v $ciq $qas
[ -d $qar ] && mv -v $qar $ciq

export MAVEN_OPTS="$MAVEN_OPTS -DSNAPS=false"

mvn clean install ${=*} && \
mvn release:prepare -DscmCommentPrefix="$pre " -Dtag=$tag ${=*} && \
mvn release:perform -DscmCommentPrefix="$pre " -Dtag=$tag -Dgoals=deploy ${=*}

# restore qa dir of local repo
echo RESTORING SNAPSHOTS TO LOCAL REPO
[ -d $qar -a -d $ciq ] && rm -rf $qar
[ -d $ciq ] && mv -v $ciq $qar
[ -d $qas ] && mv -v $qas
{code}

Good luck-

> Version ranges with non-snapshot bounds can contain snapshot versions
> ---------------------------------------------------------------------
>
>                 Key: MNG-3092
>                 URL: http://jira.codehaus.org/browse/MNG-3092
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Dependencies
>            Reporter: Mark Hobson
>            Assignee: Mark Hobson
>             Fix For: 2.0.x
>
>         Attachments: MNG-3092.patch
>
>
> Contrary to the 2.0 design docs:
> "Resolution of dependency ranges should not resolve to a snapshot 
> (development version) unless it is included as an explicit boundary."
> -- from 
> http://docs.codehaus.org/display/MAVEN/Dependency+Mediation+and+Conflict+Resolution#DependencyMediationandConflictResolution-Incorporating%7B%7BSNAPSHOT%7D%7Dversionsintothespecification
> The following is equates to true:
> VersionRange.createFromVersionSpec( "[1.0,1.1]" ).containsVersion( new 
> DefaultArtifactVersion( "1.1-SNAPSHOT" ) )
> The attached patch only allows snapshot versions to be contained in a range 
> if they are equal to one of the boundaries.  Note that this is a strict 
> equality, so [1.0,1.2-SNAPSHOT] will not contain 1.1-SNAPSHOT.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to