FIX: Ivy generates wrong revision in URL for Maven snapshots (IVY-1396) (merged from trunk)

git-svn-id: https://svn.apache.org/repos/asf/ant/ivy/core/branches/2.3.x@1424748 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Maarten Coene 2012-12-20 23:16:22 +00:00
parent 305ae20935
commit 99c953a63a
6 changed files with 65 additions and 2 deletions

View File

@ -130,6 +130,7 @@ for detailed view of each issue, please consult http://issues.apache.org/jira/br
2.3.x
=====================================
- FIX: Ivy generates wrong revision in URL for Maven snapshots (IVY-1396)
- FIX: Maven2: resolve failure when parent has <dependencyManagement> with dependency in 'import' scope (IVY-1376)
- FIX: IvyPublish fails when using extend tags with no explicit location attribute (IVY-1391)
- FIX: *.lck files created by "artifact-lock" lock strategy are not cleaned up if ivy quits abruptly (IVY-1388) (thanks to Wei Chen)

View File

@ -400,14 +400,16 @@ public class IBiblioResolver extends URLResolver {
for (Iterator iter = revs.iterator(); iter.hasNext();) {
String rev = (String) iter.next();
ModuleRevisionId historicalMrid = ModuleRevisionId.newInstance(mrid, rev);
String patternForRev = pattern;
if (rev.endsWith("SNAPSHOT")) {
String snapshotVersion = findSnapshotVersion(historicalMrid);
if (snapshotVersion != null) {
pattern = pattern.replaceFirst("\\-\\[revision\\]", "-" + snapshotVersion);
patternForRev = pattern.replaceFirst("\\-\\[revision\\]", "-" + snapshotVersion);
}
}
String resolvedPattern = IvyPatternHelper.substitute(
pattern, historicalMrid, artifact);
patternForRev, historicalMrid, artifact);
try {
Resource res = repository.getResource(resolvedPattern);
if ((res != null) && res.exists()) {

View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<metadata>
<groupId>org.apache</groupId>
<artifactId>test-SNAPSHOT1</artifactId>
<version>2.0.0-SNAPSHOT</version>
<versioning>
<snapshot>
<timestamp>20070310.181613</timestamp>
<buildNumber>3</buildNumber>
</snapshot>
<lastUpdated>20070310181754</lastUpdated>
</versioning>
</metadata>

View File

@ -0,0 +1,26 @@
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache</groupId>
<artifactId>test-SNAPSHOT1</artifactId>
<name>Test Module for Ivy M2 parsing</name>
<version>2.0.0-SNAPSHOT</version>
</project>

View File

@ -23,6 +23,7 @@
<version>2.0.2-SNAPSHOT</version>
<versioning>
<versions>
<version>2.0.0-SNAPSHOT</version>
<version>2.0.2-SNAPSHOT</version>
</versions>