This does appear to be the issue. I removed the optional branch markups and
created a second svn resolver with the branch parts listed as non-optional (so,
I had two svn resolvers one with branches as non-optional and the other without
any reference to branches).
When I tried the ant task, I got the correct content from both. When I try it
from the API, I just get content from branches (some of which is duplicated).
I suspect this is just the way that I'm calling it though.
Here is the code that I've got:
Ivy ivy = new Ivy();
File settingsFile = new File(System.getProperty("IvySettings"));
ivy.configure(settingsFile);
IvySettings settings = ivy.getSettings();
ModuleRevisionId[] ids =
ivy.listModules(ModuleRevisionId.newInstance(
"myOrg", "myModule",
PatternMatcher.ANY_EXPRESSION,
"*"),
settings.getMatcher(PatternMatcher.EXACT_OR_REGEXP));
System.out.println("Module Summary (" + ids.length + "):");
for (ModuleRevisionId id : ids)
{
System.out.println("\tModule: " + id.toString());
System.out.println("\tBranch: " + id.getBranch());
}
This gives me 30 results, when there should only be 11 (8 non-branch, 3
branch). After looking through this, listModules seems to be hitting some of
my resolvers a couple of times. If I add ids to a HashSet<ModuleRevisionId>,
it seems to work correctly.
James Davis • QA Engineer II/Software Engineer
Applied Technical Systems, Inc. • Information Engineering
web: www.atsid.com • e-mail: [email protected]
(p) 360.698.7100 x241 • (f) 360.698.7200
-----Original Message-----
From: Maarten Coene [mailto:[email protected]]
Sent: Monday, May 03, 2010 1:21 PM
To: [email protected]
Subject: Re: Issues with listModules & Branches
I think your problem might be related to IVY-1122.
https://issues.apache.org/jira/browse/IVY-1122
If you could avoid making your [branch] token optional, I think it might work.
Maybe you could try with 2 ivy/artifact patterns? (I'm not sure the svn
resolver supports this though)
<svn ...>
<ivy
pattern="[organisation]/[module]/[revision]/ivy.xml" />
<ivy pattern="[organisation]/branches/[branch]/[module]/[revision]/ivy.xml"
/>
<artifact
pattern="[organisation]/[module]/[revision]/[type]s(/[platform])(/[variant])/[artifact](.[ext])"
/>
<artifact
pattern="[organisation]/branches/[branch]/[module]/[revision]/[type]s(/[platform])(/[variant])/[artifact](.[ext])"
/>
</svn>
regards,
Maarten
----- Original Message ----
From: James Davis <[email protected]>
To: "[email protected]" <[email protected]>
Sent: Mon, May 3, 2010 10:05:49 PM
Subject: RE: Issues with listModules & Branches
I just tried both routes with the latest snapshot (was built 9 days ago
according to Hudson). No changes.
Here is the resolver patterns that I'm using:
<property name="ivy.ats.ivysvn.root"
value="svn+ssh://<server_name>/storage/svn/dependency/" />
<property name="ivy.ats.ivysvn.repo.path" value="ivyrepo/dotnet/" />
<property name="ivy.ats.ivy.pattern"
value="[organisation](/branches/[branch])/[module]/[revision]/ivy.xml" />
<property name="ivy.ats.artifact.pattern"
value="[organisation](/branches/[branch])/[module]/[revision]/[type]s(/[platform])(/[variant])/[artifact](.[ext])"
/>
<svn name="shared" repositoryRoot="${ivy.ats.ivysvn.root}" binaryDiff="false"
checkmodified="true" changingPattern=".*"
userName="${ssh.user.name}"
keyFile="${ssh.keyfile}" >
<ivy pattern="${ivy.ats.ivysvn.repo.path}${ivy.ats.ivy.pattern}"/>
<artifact pattern="${ivy.ats.ivysvn.repo.path}${ivy.ats.artifact.pattern}"/>
</svn>
James Davis • QA Engineer II/Software Engineer
Applied Technical Systems, Inc. • Information Engineering
web: www.atsid.com • e-mail: [email protected]
(p) 360.698.7100 x241 • (f) 360.698.7200
-----Original Message-----
From: Maarten Coene [mailto:[email protected]]
Sent: Monday, May 03, 2010 12:53 AM
To: [email protected]
Subject: Re: Issues with listModules & Branches
Could you try again with the latest Ivy snapshot?
If I remember correctly, we fixed some branch-related issues. So it might solve
your problem.
Maarten
----- Original Message ----
From: James Davis <[email protected]>
To: "[email protected]" <[email protected]>
Sent: Mon, May 3, 2010 9:27:30 AM
Subject: RE: Issues with listModules & Branches
Yes, it does. As I stated, it works correctly when I specify branches in the
ivy.xml and resolve dependencies (and publish dependencies). It's just when I
try and list modules through the API or the ant tasks.
Also, when I list them through the API, I get duplicates of some of the
revisions (which makes sense because those are the ones from branches). I
don't have the actual resolver patterns at the moment, I can attach those
tomorrow.
James Davis • QA Engineer II/Software Engineer
Applied Technical Systems, Inc. • Systems Division
web: www.atsid.com • e-mail: [email protected]
(p) 360.698.7100 x241 • (f) 360.698.7200
________________________________________
From: Maarten Coene [[email protected]]
Sent: Sunday, May 02, 2010 10:58 PM
To: [email protected]
Subject: Re: Issues with listModules & Branches
Does the patterns of your resolvers contains the [branch] token?
Maarten
----- Original Message ----
From: James Davis <[email protected]>
To: "[email protected]" <[email protected]>
Sent: Sat, May 1, 2010 1:57:31 AM
Subject: Issues with listModules & Branches
I'm working with ivy 2.1.0 and seem to be having some issues getting at some of
the metadata that is supposed to be available.
Currently I'm trying to get a list of all modules in the repository regardless
of what branch they are in (and I want to know what branch they are in). I
have tried this with two methods, both of which seem to bring me to a dead-end
(through the ivy ant-tasks and through direct access to the ivy API).
Here is the ant task call that I use:
<ivy:listmodules organisation="MyOrg" module="*" revision="*" branch="*"
property="ivy.modules.[module].[branch].[revision]" value="found"/>
When I try to print out all of the ivy.modules.* properties I get one for each
module, but it ignores the branches.
When I try a similar call through the API:
ModuleRevisionId[] ids = ivy.listModules(ModuleRevisionId
.newInstance("MyOrg", "*",
PatternMatcher.ANY_EXPRESSION, "*"),
ivy.getSettings()
.getMatcher(PatternMatcher.EXACT_OR_REGEXP));
I get back a list of module ids. Some of which are duplicated (I'm assuming
these are ones from the branches as well as non-branches). However, when I
loop through them and use getBranch() on each of the ids it returns null.
Also, if I use ivy.findModule(id) and look for the branch in there, it also has
null for the branch.
Any ideas on how to do this? Is there a way I can query the repo for a list of
branches? I know our settings work with branching because all of our projects
that use the branches work correctly. It is only when we try and get some
report information from the ivy repository that we seem to be having trouble.
Thanks.
James Davis * QA Engineer II/Software Engineer
Applied Technical Systems, Inc. * Information Engineering
web: www.atsid.com * e-mail: [email protected]
(p) 360.698.7100 x241 * (f) 360.698.7200