You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by "Shikhar Bhushan (JIRA)" <ji...@apache.org> on 2014/04/28 19:34:17 UTC

[jira] [Commented] (IVY-1457) XmlModuleDescriptorWritter doesn't support fully extra infos elements

    [ https://issues.apache.org/jira/browse/IVY-1457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13983258#comment-13983258 ] 

Shikhar Bhushan commented on IVY-1457:
--------------------------------------

Hi [~jboudart],

Following up from IVY-1465

I'm seeing resolve fails with this patch. I am certain that there was a regression in this particular change after running git bisect. After reverting it, resolve works fine.

While it was difficult for me to setup a reproducible test environment for this, maybe you have some idea about what could be broken based on my description:
-> we have a multi-module build with inter-module dependencies on "latest.integration"
-> we use a parent ivy file, that defines {{<info organisation="org.example" module="parent-ivy"/>}} -- we aren't really using the extra infos stuff that this patch was about
-> we are fetching deps from an internal m2compatible repository (Archiva)
-> seeing resolution fails on certain dependencies ("org.apache.solr" "solr-core" "4.7.1") -- fwiw this particular project makes use of grandparent POM's
-> when resolve fails, it looks like this: https://issues.apache.org/jira/browse/IVY-1465?focusedCommentId=13973308&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13973308 -- for some reason it determines the revision as {{"working@machine.name"}}

> XmlModuleDescriptorWritter doesn't support fully extra infos elements
> ---------------------------------------------------------------------
>
>                 Key: IVY-1457
>                 URL: https://issues.apache.org/jira/browse/IVY-1457
>             Project: Ivy
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.3.0
>            Reporter: Jean-Louis Boudart
>             Fix For: 2.4.0-RC1
>
>
> Ivy supports a way to add your own elements into extends tag. 
> Exemple :
> {code:xml}
> <info organisation="org.apache.easyant" module="standard-java-app" revision="0.1" status="integration" >
>         <ea:build organisation="org.apache.easyant.buildtypes" module="build-std-java" revision="0.9">
>             <ea:property name="run.main.classname" value="org.apache.easyant.example.Example"/>
>             <ea:plugin organisation="org.apache.easyant.plugins" module="run-java" revision="0.9" />
>         </ea:build>
>     </info>
> {code}
> After invoking XmlModuleDescriptorWritter.write()
> We get the following :
> {code:xml}
> <info organisation="org.apache.easyant"
>                 module="standard-java-app"
>                 revision="0.1"
>                 status="integration"
>                 publication="20131231193827"
>         >
>               <ea:property>
>             </ea:property>
>         </info>
> {code}
> We can notice a few things :
>  * <ea:plugin> element is missing
>  * <ea:build> element is missing
>  *  wrong identation on ending <ea:property> (probably due to nested elements)
>  * attributes from <ea:property> gets wiped
> Here is the code form XmlModuleDescriptorParser.endElement() method :
> {code:java}
> else if (state == State.EXTRA_INFO) {
>                 getMd().addExtraInfo(qName, buffer == null ? "" : buffer.toString());
>                 buffer = null;
>                 state = State.INFO;
>             } 
> {code}
> Unfortunatly buffer doesn't contains attributes and doesn't seems to handle nested element.
> Here is the code writting extra infos elements from XmlModuleDescriptorWritter :
> {code:java}
>             for (Iterator it = md.getExtraInfo().entrySet().iterator(); it.hasNext();) {
>                 Map.Entry extraDescr = (Map.Entry) it.next();
>                 if (extraDescr.getValue() == null 
>                         || ((String) extraDescr.getValue()).length() == 0) {
>                     continue;
>                 }
>                 out.print("\t\t<");
>                 out.print(extraDescr.getKey());
>                 out.print(">");
>                 out.print(XMLHelper.escape((String) extraDescr.getValue()));
>                 out.print("</");
>                 out.print(extraDescr.getKey());
>                 out.println(">");
>             }
> {code}
> Still no attributes support and all "contents" will be escaped.
> I don't know how much this feature is used by the community but fixing this bug could break backward compatibility.



--
This message was sent by Atlassian JIRA
(v6.2#6252)