You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by "Gintas Grigelionis (JIRA)" <ji...@apache.org> on 2017/08/31 20:20:00 UTC

[jira] [Updated] (IVY-1081) Another wrong error message when publishing

     [ https://issues.apache.org/jira/browse/IVY-1081?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gintas Grigelionis updated IVY-1081:
------------------------------------
    Description: 
{code:xml}
  <target name="publish">
...
    <copy file="${jar.dir}/${artifact.name}.jar" todir="." />
    <ivy:publish artifactspattern="${jar.dir}/${artifact.name}" resolver="shared" pubrevision="${ivy.new.revision}" />
...
  </target>
{code}
leads to the following output
{code}
...\build.xml:26: impossible to publish artifacts for mycompany.com#MyComponent;working@MY-PC: java.lang.IllegalStateException: bad ivy file for mycompany.com#MyComponent;working@MY-PC: [...]/MyComponent: java.text.ParseException: [[Fatal Error] :1:1: Content is not allowed in prolog. in file:[...]/MyComponent/
]
{code}
Note that it is the ivy:publish task that fails, whereas the ant copy works as intended. Now, the error message sends you hunting in the ivy file - maybe there is some malformed xml...? However, the problem turns out to be related to the ${jar.dir} variable reference in the 'artifactspattern' parameter. The same variable caused no trouble in the line before (${jar.dir} exists, and the artifact is present both in ${jar.dir} and in the working directory), so what is wrong?

Remove the variable reference, and everything works fine. Nothing is wrong with the ivy file, and it is difficult to see what a typical xml parser exception has to do with the problem.

This is the second bug I've experienced - and reported - in a couple of days, relating to Ivy providing wrong feedback in case of an error. Maybe it is time for a review of the code, related to error handling?


  was:
  <target name="publish">
...
    <copy file="${jar.dir}/${artifact.name}.jar" todir="." />
    <ivy:publish artifactspattern="${jar.dir}/${artifact.name}" resolver="shared" pubrevision="${ivy.new.revision}" />
...
  </target>

leads to the following output

...\build.xml:26: impossible to publish artifacts for mycompany.com#MyComponent;working@MY-PC: java.lang.IllegalStateException: bad ivy file for mycompany.com#MyComponent;working@MY-PC: [...]/MyComponent: java.text.ParseException: [[Fatal Error] :1:1: Content is not allowed in prolog. in file:[...]/MyComponent/
]

Note that it is the ivy:publish task that fails, whereas the ant copy works as intended. Now, the error message sends you hunting in the ivy file - maybe there is some malformed xml...? However, the problem turns out to be related to the ${jar.dir} variable reference in the 'artifactspattern' parameter. The same variable caused no trouble in the line before (${jar.dir} exists, and the artifact is present both in ${jar.dir} and in the working directory), so what is wrong?

Remove the variable reference, and everything works fine. Nothing is wrong with the ivy file, and it is difficult to see what a typical xml parser exception has to do with the problem.

This is the second bug I've experienced - and reported - in a couple of days, relating to Ivy providing wrong feedback in case of an error. Maybe it is time for a review of the code, related to error handling?



> Another wrong error message when publishing
> -------------------------------------------
>
>                 Key: IVY-1081
>                 URL: https://issues.apache.org/jira/browse/IVY-1081
>             Project: Ivy
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.1.0-RC1
>            Reporter: hem006
>
> {code:xml}
>   <target name="publish">
> ...
>     <copy file="${jar.dir}/${artifact.name}.jar" todir="." />
>     <ivy:publish artifactspattern="${jar.dir}/${artifact.name}" resolver="shared" pubrevision="${ivy.new.revision}" />
> ...
>   </target>
> {code}
> leads to the following output
> {code}
> ...\build.xml:26: impossible to publish artifacts for mycompany.com#MyComponent;working@MY-PC: java.lang.IllegalStateException: bad ivy file for mycompany.com#MyComponent;working@MY-PC: [...]/MyComponent: java.text.ParseException: [[Fatal Error] :1:1: Content is not allowed in prolog. in file:[...]/MyComponent/
> ]
> {code}
> Note that it is the ivy:publish task that fails, whereas the ant copy works as intended. Now, the error message sends you hunting in the ivy file - maybe there is some malformed xml...? However, the problem turns out to be related to the ${jar.dir} variable reference in the 'artifactspattern' parameter. The same variable caused no trouble in the line before (${jar.dir} exists, and the artifact is present both in ${jar.dir} and in the working directory), so what is wrong?
> Remove the variable reference, and everything works fine. Nothing is wrong with the ivy file, and it is difficult to see what a typical xml parser exception has to do with the problem.
> This is the second bug I've experienced - and reported - in a couple of days, relating to Ivy providing wrong feedback in case of an error. Maybe it is time for a review of the code, related to error handling?



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)