You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by "Scott Hebert (JIRA)" <ji...@apache.org> on 2008/10/01 21:23:44 UTC
[jira] Created: (IVY-929) Extra Attributes specified in the
Dependency's Module Descriptor are not available to resolvers
Extra Attributes specified in the Dependency's Module Descriptor are not available to resolvers
-----------------------------------------------------------------------------------------------
Key: IVY-929
URL: https://issues.apache.org/jira/browse/IVY-929
Project: Ivy
Issue Type: Bug
Components: Core
Affects Versions: 2.0-RC1
Environment: Windows
Java 6
Reporter: Scott Hebert
Priority: Critical
{quote}This is a follow up to IVY-773{quote}
Consider the following IVY file:
{code:xml}<ivy-module version="1.0">
<info organisation="apache" module="extra-att" revision="1.0"/>
<dependencies>
<dependency name="mymodule" rev="1748" />
</dependencies>
</ivy-module>
{code}
and the corresponding dependency's IVY file:
{code:xml}
<ivy-module version="1.0">
<info
organisation="apache"
module="mymodule"
myextraattrib="abc123"
revision="1748"
status="integration"/>
<publications>
<artifact name="mymodule" platform="windows" type="jar"/>
<artifact name="mymodule" platform="linux" type="jar"/>
</publications>
</ivy-module>
{code}
When a resolver resolves to determine the revision of dependency, it seems that the extra attribute *myextraattrib* is not available.
I've narrowed it down to the method in *BasicResolver*:
{code:java}
public ResolvedModuleRevision getDependency(DependencyDescriptor dd, ResolveData data) {}
{code}
where at this point:
{code:java}
rmr = parse(ivyRef, systemDd, data);
{code}
*rmr* contains the extra attributes... but at this point:
{code:xml}
if (systemMd instanceof DefaultModuleDescriptor) {
DefaultModuleDescriptor defaultMd = (DefaultModuleDescriptor) systemMd;
ModuleRevisionId revision = getRevision(ivyRef, systemMrid, systemMd);
defaultMd.setModuleRevisionId(revision);
defaultMd.setResolvedModuleRevisionId(revision);
{code}
{code:xml}
ModuleRevisionId revision = getRevision(ivyRef, systemMrid, systemMd);
{code}
*revision* is missing the extra attributes.
I am not familiar enough with the meanings of each of the objects to be able to fix this.
Thanks
Scott
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (IVY-929) Extra Attributes specified in the
Dependency's Module Descriptor are not available to resolvers
Posted by "Maarten Coene (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/IVY-929?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Maarten Coene updated IVY-929:
------------------------------
Fix Version/s: (was: trunk)
2.0-RC2
> Extra Attributes specified in the Dependency's Module Descriptor are not available to resolvers
> -----------------------------------------------------------------------------------------------
>
> Key: IVY-929
> URL: https://issues.apache.org/jira/browse/IVY-929
> Project: Ivy
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.0-RC1
> Environment: Windows
> Java 6
> Reporter: Scott Hebert
> Assignee: Maarten Coene
> Priority: Critical
> Fix For: 2.0-RC2
>
>
> {quote}This is a follow up to IVY-773{quote}
> Consider the following IVY file:
> {code:xml}<ivy-module version="1.0">
> <info organisation="apache" module="extra-att" revision="1.0"/>
> <dependencies>
> <dependency name="mymodule" rev="1748" />
> </dependencies>
> </ivy-module>
> {code}
> and the corresponding dependency's IVY file:
> {code:xml}
> <ivy-module version="1.0">
> <info
> organisation="apache"
> module="mymodule"
> myextraattrib="abc123"
> revision="1748"
> status="integration"/>
> <publications>
> <artifact name="mymodule" platform="windows" type="jar"/>
> <artifact name="mymodule" platform="linux" type="jar"/>
> </publications>
> </ivy-module>
> {code}
> When a resolver resolves to determine the revision of dependency, it seems that the extra attribute *myextraattrib* is not available.
> I've narrowed it down to the method in *BasicResolver*:
> {code:java}
> public ResolvedModuleRevision getDependency(DependencyDescriptor dd, ResolveData data) {}
> {code}
> where at this point:
> {code:java}
> rmr = parse(ivyRef, systemDd, data);
> {code}
> *rmr* contains the extra attributes... but at this point:
> {code:xml}
> if (systemMd instanceof DefaultModuleDescriptor) {
> DefaultModuleDescriptor defaultMd = (DefaultModuleDescriptor) systemMd;
> ModuleRevisionId revision = getRevision(ivyRef, systemMrid, systemMd);
> defaultMd.setModuleRevisionId(revision);
> defaultMd.setResolvedModuleRevisionId(revision);
> {code}
> {code:xml}
> ModuleRevisionId revision = getRevision(ivyRef, systemMrid, systemMd);
> {code}
> *revision* is missing the extra attributes.
> I am not familiar enough with the meanings of each of the objects to be able to fix this.
> Thanks
> Scott
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (IVY-929) Extra Attributes specified in the
Dependency's Module Descriptor are not available to resolvers
Posted by "Scott Hebert (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/IVY-929?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12641074#action_12641074 ]
Scott Hebert commented on IVY-929:
----------------------------------
Hi,
The problem seems to be here:
{code}
private ModuleRevisionId getRevision(ResolvedResource ivyRef, ModuleRevisionId askedMrid,
ModuleDescriptor md) throws ParseException {
String revision = ivyRef.getRevision();
if (revision == null) {
Message.debug("no revision found in reference for " + askedMrid);
if (getSettings().getVersionMatcher().isDynamic(askedMrid)) {
if (md.getModuleRevisionId().getRevision() == null) {
return ModuleRevisionId.newInstance(askedMrid, "working@" + getName());
} else {
Message.debug("using " + askedMrid);
return askedMrid;
}
} else {
Message.debug("using " + askedMrid);
return askedMrid;
}
} else {
//return ModuleRevisionId.newInstance(askedMrid, revision);
return ModuleRevisionId.newInstance(askedMrid.getOrganisation(), askedMrid.getName(), askedMrid.getBranch(), revision, md.getExtraAttributes());
}
}
{code}
With this being the fix:
{code}
//return ModuleRevisionId.newInstance(askedMrid, revision);
return ModuleRevisionId.newInstance(askedMrid.getOrganisation(), askedMrid.getName(), askedMrid.getBranch(), revision, md.getExtraAttributes());
{code}
Essentially, this method was returning a ModuleRevisionId which did not have any ExtraAttributes. Later this "revision" was being used to set the ModuleRevisionId of *defaultMd* which would in turn set it for *systemMd*.
{code}
ModuleRevisionId revision = getRevision(ivyRef, systemMrid, systemMd);
defaultMd.setModuleRevisionId(revision);
defaultMd.setResolvedModuleRevisionId(revision);
{code}
*systemMd* was then being used here:
{code}
rmr = new ResolvedModuleRevision(
this, this, systemMd, toSystem(rmr.getReport()), isForce());
{code}
and *rmr* was being used as the return ResolvedModuleRevision.
> Extra Attributes specified in the Dependency's Module Descriptor are not available to resolvers
> -----------------------------------------------------------------------------------------------
>
> Key: IVY-929
> URL: https://issues.apache.org/jira/browse/IVY-929
> Project: Ivy
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.0-RC1
> Environment: Windows
> Java 6
> Reporter: Scott Hebert
> Priority: Critical
>
> {quote}This is a follow up to IVY-773{quote}
> Consider the following IVY file:
> {code:xml}<ivy-module version="1.0">
> <info organisation="apache" module="extra-att" revision="1.0"/>
> <dependencies>
> <dependency name="mymodule" rev="1748" />
> </dependencies>
> </ivy-module>
> {code}
> and the corresponding dependency's IVY file:
> {code:xml}
> <ivy-module version="1.0">
> <info
> organisation="apache"
> module="mymodule"
> myextraattrib="abc123"
> revision="1748"
> status="integration"/>
> <publications>
> <artifact name="mymodule" platform="windows" type="jar"/>
> <artifact name="mymodule" platform="linux" type="jar"/>
> </publications>
> </ivy-module>
> {code}
> When a resolver resolves to determine the revision of dependency, it seems that the extra attribute *myextraattrib* is not available.
> I've narrowed it down to the method in *BasicResolver*:
> {code:java}
> public ResolvedModuleRevision getDependency(DependencyDescriptor dd, ResolveData data) {}
> {code}
> where at this point:
> {code:java}
> rmr = parse(ivyRef, systemDd, data);
> {code}
> *rmr* contains the extra attributes... but at this point:
> {code:xml}
> if (systemMd instanceof DefaultModuleDescriptor) {
> DefaultModuleDescriptor defaultMd = (DefaultModuleDescriptor) systemMd;
> ModuleRevisionId revision = getRevision(ivyRef, systemMrid, systemMd);
> defaultMd.setModuleRevisionId(revision);
> defaultMd.setResolvedModuleRevisionId(revision);
> {code}
> {code:xml}
> ModuleRevisionId revision = getRevision(ivyRef, systemMrid, systemMd);
> {code}
> *revision* is missing the extra attributes.
> I am not familiar enough with the meanings of each of the objects to be able to fix this.
> Thanks
> Scott
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (IVY-929) Extra Attributes specified in the
Dependency's Module Descriptor are not available to resolvers
Posted by "Scott Hebert (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/IVY-929?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12641026#action_12641026 ]
Scott Hebert commented on IVY-929:
----------------------------------
Hi,
I was just wondering if anyone has had a chance to look into this? If you could point me in the right direction, I could look into it as well.
Thanks,
Scott
> Extra Attributes specified in the Dependency's Module Descriptor are not available to resolvers
> -----------------------------------------------------------------------------------------------
>
> Key: IVY-929
> URL: https://issues.apache.org/jira/browse/IVY-929
> Project: Ivy
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.0-RC1
> Environment: Windows
> Java 6
> Reporter: Scott Hebert
> Priority: Critical
>
> {quote}This is a follow up to IVY-773{quote}
> Consider the following IVY file:
> {code:xml}<ivy-module version="1.0">
> <info organisation="apache" module="extra-att" revision="1.0"/>
> <dependencies>
> <dependency name="mymodule" rev="1748" />
> </dependencies>
> </ivy-module>
> {code}
> and the corresponding dependency's IVY file:
> {code:xml}
> <ivy-module version="1.0">
> <info
> organisation="apache"
> module="mymodule"
> myextraattrib="abc123"
> revision="1748"
> status="integration"/>
> <publications>
> <artifact name="mymodule" platform="windows" type="jar"/>
> <artifact name="mymodule" platform="linux" type="jar"/>
> </publications>
> </ivy-module>
> {code}
> When a resolver resolves to determine the revision of dependency, it seems that the extra attribute *myextraattrib* is not available.
> I've narrowed it down to the method in *BasicResolver*:
> {code:java}
> public ResolvedModuleRevision getDependency(DependencyDescriptor dd, ResolveData data) {}
> {code}
> where at this point:
> {code:java}
> rmr = parse(ivyRef, systemDd, data);
> {code}
> *rmr* contains the extra attributes... but at this point:
> {code:xml}
> if (systemMd instanceof DefaultModuleDescriptor) {
> DefaultModuleDescriptor defaultMd = (DefaultModuleDescriptor) systemMd;
> ModuleRevisionId revision = getRevision(ivyRef, systemMrid, systemMd);
> defaultMd.setModuleRevisionId(revision);
> defaultMd.setResolvedModuleRevisionId(revision);
> {code}
> {code:xml}
> ModuleRevisionId revision = getRevision(ivyRef, systemMrid, systemMd);
> {code}
> *revision* is missing the extra attributes.
> I am not familiar enough with the meanings of each of the objects to be able to fix this.
> Thanks
> Scott
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (IVY-929) Extra Attributes specified in the
Dependency's Module Descriptor are not available to resolvers
Posted by "Maarten Coene (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/IVY-929?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Maarten Coene resolved IVY-929.
-------------------------------
Resolution: Fixed
Fix Version/s: trunk
Assignee: Maarten Coene
Thank you for your contribution!
I've applied a modified version of your patch (your change broke another junit tests) into SVN trunk and added a junit test for it.
Could you please verify it is does solve your problem?
> Extra Attributes specified in the Dependency's Module Descriptor are not available to resolvers
> -----------------------------------------------------------------------------------------------
>
> Key: IVY-929
> URL: https://issues.apache.org/jira/browse/IVY-929
> Project: Ivy
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.0-RC1
> Environment: Windows
> Java 6
> Reporter: Scott Hebert
> Assignee: Maarten Coene
> Priority: Critical
> Fix For: trunk
>
>
> {quote}This is a follow up to IVY-773{quote}
> Consider the following IVY file:
> {code:xml}<ivy-module version="1.0">
> <info organisation="apache" module="extra-att" revision="1.0"/>
> <dependencies>
> <dependency name="mymodule" rev="1748" />
> </dependencies>
> </ivy-module>
> {code}
> and the corresponding dependency's IVY file:
> {code:xml}
> <ivy-module version="1.0">
> <info
> organisation="apache"
> module="mymodule"
> myextraattrib="abc123"
> revision="1748"
> status="integration"/>
> <publications>
> <artifact name="mymodule" platform="windows" type="jar"/>
> <artifact name="mymodule" platform="linux" type="jar"/>
> </publications>
> </ivy-module>
> {code}
> When a resolver resolves to determine the revision of dependency, it seems that the extra attribute *myextraattrib* is not available.
> I've narrowed it down to the method in *BasicResolver*:
> {code:java}
> public ResolvedModuleRevision getDependency(DependencyDescriptor dd, ResolveData data) {}
> {code}
> where at this point:
> {code:java}
> rmr = parse(ivyRef, systemDd, data);
> {code}
> *rmr* contains the extra attributes... but at this point:
> {code:xml}
> if (systemMd instanceof DefaultModuleDescriptor) {
> DefaultModuleDescriptor defaultMd = (DefaultModuleDescriptor) systemMd;
> ModuleRevisionId revision = getRevision(ivyRef, systemMrid, systemMd);
> defaultMd.setModuleRevisionId(revision);
> defaultMd.setResolvedModuleRevisionId(revision);
> {code}
> {code:xml}
> ModuleRevisionId revision = getRevision(ivyRef, systemMrid, systemMd);
> {code}
> *revision* is missing the extra attributes.
> I am not familiar enough with the meanings of each of the objects to be able to fix this.
> Thanks
> Scott
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.