You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-user@ant.apache.org by Carlton Brown <cb...@silverpop.com> on 2009/12/03 12:25:56 UTC

Multiple artifacts error for modules that don't have multiple artifacts

All,

 

I've got a very annoying Ivy issue where I get the error " Multiple
artifacts of the module [whatever] are retrieved to the same file!"
This is for an internally published module which I know for a fact does
not have more than just a vanilla jar file.

 

This seems to happen only when the module has evicted another module in
a version conflict.   In the ivy report, the winning module reports that
it has 2 artifacts with the same name, type, extension although this
module definitely publishes just one artifact.

 

This is causing a lot of headaches, any help is appreciated.   Tried it
using Ivy revisions 2.1.0 and trunk.

 

Thanks,

Carlton

 

 



***CONFIDENTIALITY NOTICE and DISCLAIMER*** 
This message and any attachment are confidential and may be
privileged or otherwise protected from disclosure and solely for
the use of the person(s) or entity to whom it is intended. If you
have received this message in error and are not the intended
recipient, please notify the sender immediately and delete this
message and any attachment from your system. If you are not the
intended recipient, be advised that any use of this message is
prohibited and may be unlawful, and you must not copy this
message or attachment or disclose the contents to any other person.

RE: Multiple artifacts error for modules that don't have multiple artifacts

Posted by Carlton Brown <cb...@silverpop.com>.
Maarten,

I've found the problem.   ArtifactDownloadReport.hashCode() is not
sufficiently consistent with equals(), so we were getting duplicates
inserted into the HashSet when we shouldn't have.   If I make hashCode()
return 1, it works.   Now we just have to figure out what an appropriate
hashCode() method would look like.   I will open a JIRA issue.

Thanks,
Carlton

> -----Original Message-----
> From: Maarten Coene [mailto:maarten_coene@yahoo.com]
> Sent: Thursday, December 03, 2009 5:09 PM
> To: ivy-user@ant.apache.org
> Subject: Re: Multiple artifacts error for modules that don't have
> multiple artifacts
> 
> Carlton,
> 
> could you open a JIRA issue for this and attach (if possible) a simple
> example so we can easily reproduce the problem (I've made a few
> attempts, but I failed to reproduce the problem)
> 
> Maarten
> 
> 
> 
> 
> ----- Original Message ----
> From: Carlton Brown <cb...@silverpop.com>
> To: ivy-user@ant.apache.org
> Sent: Thu, December 3, 2009 8:21:59 PM
> Subject: RE: Multiple artifacts error for modules that don't have
> multiple artifacts
> 
> > -----Original Message-----
> > From: Carlton Brown [mailto:cbrown@silverpop.com]
> > Sent: Thursday, December 03, 2009 6:26 AM
> > To: ivy-user@ant.apache.org
> > Subject: Multiple artifacts error for modules that don't have
> multiple
> > artifacts
> >
> > I've got a very annoying Ivy issue where I get the error " Multiple
> > artifacts of the module [whatever] are retrieved to the same file!"
> > This is for an internally published module which I know for a fact
> does
> > not have more than just a vanilla jar file.
> 
> I looked through the code, and what I found is that in
> RetrieveEngine.determineArtifactsToCopy, where it builds a map of
> retrieval conflicts, the same artifact is getting inserted twice in
the
> conflict map for the same revision.   I don't believe this is correct.
> 
> This happens because one of the artifacts has an extra "qualified
> attribute" called 'merged', which the other artifact does not have.
> Since AbstractArtifact.equals() considers artifacts unequal if any of
> the qualified attributes are different, the artifacts are considered
> unequal and it causes a collision in
> RetrieveEngine.determineArtifactsToCopy.
> 
> I am not sure the purpose of the 'merged' attribute, but should it
> really determine equality of artifacts for retrieval?   I don't think
> it
> should, but I'm not an expert.  Xavier?  Anyone?
> 
> Thanks,
> Carlton
> 
> 
> ***CONFIDENTIALITY NOTICE and DISCLAIMER***
> This message and any attachment are confidential and may be
> privileged or otherwise protected from disclosure and solely for
> the use of the person(s) or entity to whom it is intended. If you
> have received this message in error and are not the intended
> recipient, please notify the sender immediately and delete this
> message and any attachment from your system. If you are not the
> intended recipient, be advised that any use of this message is
> prohibited and may be unlawful, and you must not copy this
> message or attachment or disclose the contents to any other person.
> 
> 
> 
> 

***CONFIDENTIALITY NOTICE and DISCLAIMER*** 
This message and any attachment are confidential and may be
privileged or otherwise protected from disclosure and solely for
the use of the person(s) or entity to whom it is intended. If you
have received this message in error and are not the intended
recipient, please notify the sender immediately and delete this
message and any attachment from your system. If you are not the
intended recipient, be advised that any use of this message is
prohibited and may be unlawful, and you must not copy this
message or attachment or disclose the contents to any other person.

RE: Multiple artifacts error for modules that don't have multiple artifacts

Posted by Carlton Brown <cb...@silverpop.com>.
https://issues.apache.org/jira/browse/IVY-1148 has been opened and a
patch attached.

> -----Original Message-----
> From: Maarten Coene [mailto:maarten_coene@yahoo.com]
> Sent: Thursday, December 03, 2009 5:09 PM
> To: ivy-user@ant.apache.org
> Subject: Re: Multiple artifacts error for modules that don't have
> multiple artifacts
> 
> Carlton,
> 
> could you open a JIRA issue for this and attach (if possible) a simple
> example so we can easily reproduce the problem (I've made a few
> attempts, but I failed to reproduce the problem)
> 
> Maarten
> 
> 
> 
> 
> ----- Original Message ----
> From: Carlton Brown <cb...@silverpop.com>
> To: ivy-user@ant.apache.org
> Sent: Thu, December 3, 2009 8:21:59 PM
> Subject: RE: Multiple artifacts error for modules that don't have
> multiple artifacts
> 
> > -----Original Message-----
> > From: Carlton Brown [mailto:cbrown@silverpop.com]
> > Sent: Thursday, December 03, 2009 6:26 AM
> > To: ivy-user@ant.apache.org
> > Subject: Multiple artifacts error for modules that don't have
> multiple
> > artifacts
> >
> > I've got a very annoying Ivy issue where I get the error " Multiple
> > artifacts of the module [whatever] are retrieved to the same file!"
> > This is for an internally published module which I know for a fact
> does
> > not have more than just a vanilla jar file.
> 
> I looked through the code, and what I found is that in
> RetrieveEngine.determineArtifactsToCopy, where it builds a map of
> retrieval conflicts, the same artifact is getting inserted twice in
the
> conflict map for the same revision.   I don't believe this is correct.
> 
> This happens because one of the artifacts has an extra "qualified
> attribute" called 'merged', which the other artifact does not have.
> Since AbstractArtifact.equals() considers artifacts unequal if any of
> the qualified attributes are different, the artifacts are considered
> unequal and it causes a collision in
> RetrieveEngine.determineArtifactsToCopy.
> 
> I am not sure the purpose of the 'merged' attribute, but should it
> really determine equality of artifacts for retrieval?   I don't think
> it
> should, but I'm not an expert.  Xavier?  Anyone?
> 
> Thanks,
> Carlton
> 
> 
> ***CONFIDENTIALITY NOTICE and DISCLAIMER***
> This message and any attachment are confidential and may be
> privileged or otherwise protected from disclosure and solely for
> the use of the person(s) or entity to whom it is intended. If you
> have received this message in error and are not the intended
> recipient, please notify the sender immediately and delete this
> message and any attachment from your system. If you are not the
> intended recipient, be advised that any use of this message is
> prohibited and may be unlawful, and you must not copy this
> message or attachment or disclose the contents to any other person.
> 
> 
> 
> 

***CONFIDENTIALITY NOTICE and DISCLAIMER*** 
This message and any attachment are confidential and may be
privileged or otherwise protected from disclosure and solely for
the use of the person(s) or entity to whom it is intended. If you
have received this message in error and are not the intended
recipient, please notify the sender immediately and delete this
message and any attachment from your system. If you are not the
intended recipient, be advised that any use of this message is
prohibited and may be unlawful, and you must not copy this
message or attachment or disclose the contents to any other person.

Re: Multiple artifacts error for modules that don't have multiple artifacts

Posted by Maarten Coene <ma...@yahoo.com>.
Carlton,

could you open a JIRA issue for this and attach (if possible) a simple example so we can easily reproduce the problem (I've made a few attempts, but I failed to reproduce the problem)

Maarten




----- Original Message ----
From: Carlton Brown <cb...@silverpop.com>
To: ivy-user@ant.apache.org
Sent: Thu, December 3, 2009 8:21:59 PM
Subject: RE: Multiple artifacts error for modules that don't have multiple artifacts

> -----Original Message-----
> From: Carlton Brown [mailto:cbrown@silverpop.com]
> Sent: Thursday, December 03, 2009 6:26 AM
> To: ivy-user@ant.apache.org
> Subject: Multiple artifacts error for modules that don't have multiple
> artifacts
>
> I've got a very annoying Ivy issue where I get the error " Multiple
> artifacts of the module [whatever] are retrieved to the same file!"
> This is for an internally published module which I know for a fact
does
> not have more than just a vanilla jar file.

I looked through the code, and what I found is that in
RetrieveEngine.determineArtifactsToCopy, where it builds a map of
retrieval conflicts, the same artifact is getting inserted twice in the
conflict map for the same revision.   I don't believe this is correct.  

This happens because one of the artifacts has an extra "qualified
attribute" called 'merged', which the other artifact does not have.
Since AbstractArtifact.equals() considers artifacts unequal if any of
the qualified attributes are different, the artifacts are considered
unequal and it causes a collision in
RetrieveEngine.determineArtifactsToCopy.

I am not sure the purpose of the 'merged' attribute, but should it
really determine equality of artifacts for retrieval?   I don't think it
should, but I'm not an expert.  Xavier?  Anyone?

Thanks,
Carlton


***CONFIDENTIALITY NOTICE and DISCLAIMER***
This message and any attachment are confidential and may be
privileged or otherwise protected from disclosure and solely for
the use of the person(s) or entity to whom it is intended. If you
have received this message in error and are not the intended
recipient, please notify the sender immediately and delete this
message and any attachment from your system. If you are not the
intended recipient, be advised that any use of this message is
prohibited and may be unlawful, and you must not copy this
message or attachment or disclose the contents to any other person.



      

RE: Multiple artifacts error for modules that don't have multiple artifacts

Posted by Carlton Brown <cb...@silverpop.com>.
> -----Original Message-----
> From: Carlton Brown [mailto:cbrown@silverpop.com]
> Sent: Thursday, December 03, 2009 6:26 AM
> To: ivy-user@ant.apache.org
> Subject: Multiple artifacts error for modules that don't have multiple
> artifacts
>
> I've got a very annoying Ivy issue where I get the error " Multiple
> artifacts of the module [whatever] are retrieved to the same file!"
> This is for an internally published module which I know for a fact
does
> not have more than just a vanilla jar file.

I looked through the code, and what I found is that in
RetrieveEngine.determineArtifactsToCopy, where it builds a map of
retrieval conflicts, the same artifact is getting inserted twice in the
conflict map for the same revision.   I don't believe this is correct.  

This happens because one of the artifacts has an extra "qualified
attribute" called 'merged', which the other artifact does not have.
Since AbstractArtifact.equals() considers artifacts unequal if any of
the qualified attributes are different, the artifacts are considered
unequal and it causes a collision in
RetrieveEngine.determineArtifactsToCopy.

I am not sure the purpose of the 'merged' attribute, but should it
really determine equality of artifacts for retrieval?   I don't think it
should, but I'm not an expert.  Xavier?  Anyone?

Thanks,
Carlton


***CONFIDENTIALITY NOTICE and DISCLAIMER*** 
This message and any attachment are confidential and may be
privileged or otherwise protected from disclosure and solely for
the use of the person(s) or entity to whom it is intended. If you
have received this message in error and are not the intended
recipient, please notify the sender immediately and delete this
message and any attachment from your system. If you are not the
intended recipient, be advised that any use of this message is
prohibited and may be unlawful, and you must not copy this
message or attachment or disclose the contents to any other person.