FIX: NPE when specifying both resolveId and inline in an Ivy:Resolve (IVY-776)

git-svn-id: https://svn.apache.org/repos/asf/ant/ivy/core/trunk@638627 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Maarten Coene 2008-03-18 22:53:31 +00:00
parent 66310f5531
commit 51219169df
3 changed files with 23 additions and 4 deletions

View File

@ -73,6 +73,7 @@ for detailed view of each issue, please consult http://issues.apache.org/jira/br
- IMPROVEMENT: Parse description and home page from poms (IVY-767)
- IMPROVEMENT: Smarter determination if an expression is exact or not for RegexpPatternMatcher and GlobPatternMatcher
- FIX: NPE when specifying both resolveId and inline in an Ivy:Resolve (IVY-776)
- FIX: repreport task not working against a repository structured by branches (IVY-716)
- FIX: Ivy reports a conflict when the same file is supposed to be retrieved at the same location twice (or more) (IVY-743)
- FIX: StackOverflowError when configuration extends itself (IVY-696)

View File

@ -299,10 +299,12 @@ public class IvyResolve extends IvyTask {
.setProperty("ivy.resolved.configurations." + resolveId, conf);
settings.setVariable("ivy.resolved.configurations." + resolveId, conf);
}
getProject().setProperty("ivy.resolved.file." + resolveId,
file.getAbsolutePath());
settings
.setVariable("ivy.resolved.file." + resolveId, file.getAbsolutePath());
if (file != null) {
getProject().setProperty("ivy.resolved.file." + resolveId,
file.getAbsolutePath());
settings
.setVariable("ivy.resolved.file." + resolveId, file.getAbsolutePath());
}
}
}
} catch (MalformedURLException e) {

View File

@ -115,6 +115,22 @@ public class IvyResolveTest extends TestCase {
assertTrue(getArchiveFileInCache("org1", "mod1.2", "2.0", "mod1.2", "jar", "jar").exists());
}
public void testInlineWithResolveId() throws Exception {
// same as before, but expressing dependency directly without ivy file
resolve.setOrganisation("org1");
resolve.setModule("mod1.2");
resolve.setRevision("2.0");
resolve.setInline(true);
resolve.setResolveId("testInlineWithResolveId");
resolve.setKeep(true);
resolve.execute();
// dependencies
assertTrue(getIvyFileInCache(ModuleRevisionId.newInstance("org1", "mod1.2", "2.0"))
.exists());
assertTrue(getArchiveFileInCache("org1", "mod1.2", "2.0", "mod1.2", "jar", "jar").exists());
}
public void testInlineForNonExistingModule() throws Exception {
resolve.setOrganisation("org1XX");
resolve.setModule("mod1.2");