You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by "Björn Kautler (Jira)" <ji...@apache.org> on 2021/02/05 11:38:00 UTC

[jira] [Updated] (IVY-1624) log4j-core is missing the log4j-api dependency when resolving

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

Björn Kautler updated IVY-1624:
-------------------------------
    Description: 
This is probably related to IVY-1625

 

Given the {{ivy.xml}}
{code:xml}
<ivy-module version="2.0">
    <info organisation="foo" module="bar"/>
    <dependencies>
        <dependency org="org.apache.logging.log4j" name="log4j-core" rev="2.14.0" conf="default"/>
    </dependencies>
</ivy-module>{code}
And the {{build.xml}}
{code:xml}
<project default="retrieve" xmlns:ivy="antlib:org.apache.ivy.ant">
    <target name="check-ivy">
        <available property="ivy.jar.present"
                   file="lib/ivy/ivy-2.5.0.jar"
                   type="file"/>
    </target>
    <target name="download-ivy"
            depends="check-ivy"
            unless="ivy.jar.present">
        <mkdir dir="lib/ivy"/>
        <get src="https://repo1.maven.org/maven2/org/apache/ivy/ivy/2.5.0/ivy-2.5.0.jar"
             dest="lib/ivy/ivy-2.5.0.jar"
             usetimestamp="true"/>
    </target>
    <target name="init-ivy"
            depends="download-ivy">
        <property name="ivy.retrieve.pattern"
                  value="lib/[conf]/[artifact](-[classifier]).[ext]"/>
        <taskdef resource="org/apache/ivy/ant/antlib.xml"
                 classpath="lib/ivy/ivy-2.5.0.jar"
                 loaderref="ivy.loader"
                 uri="antlib:org.apache.ivy.ant"/>
    </target>
    <target name="retrieve"
            depends="init-ivy">
        <ivy:retrieve sync="true"/>
    </target>
</project>{code}
When you now execute Ant, you only get {{lib/default/log4j-core.jar}} while you should also get {{lib/default/log4j-api.jar}} which works fine in Maven and Gradle.

The problem is most probably that there is a second dependency on {{log4j-api}}  where a different (additional) artifact is depended upon in the {{test}} scope.

  was:
Given the {{ivy.xml}}
{code:xml}
<ivy-module version="2.0">
    <info organisation="foo" module="bar"/>
    <dependencies>
        <dependency org="org.apache.logging.log4j" name="log4j-core" rev="2.14.0" conf="default"/>
    </dependencies>
</ivy-module>{code}
And the {{build.xml}}
{code:xml}
<project default="retrieve" xmlns:ivy="antlib:org.apache.ivy.ant">
    <target name="check-ivy">
        <available property="ivy.jar.present"
                   file="lib/ivy/ivy-2.5.0.jar"
                   type="file"/>
    </target>
    <target name="download-ivy"
            depends="check-ivy"
            unless="ivy.jar.present">
        <mkdir dir="lib/ivy"/>
        <get src="https://repo1.maven.org/maven2/org/apache/ivy/ivy/2.5.0/ivy-2.5.0.jar"
             dest="lib/ivy/ivy-2.5.0.jar"
             usetimestamp="true"/>
    </target>
    <target name="init-ivy"
            depends="download-ivy">
        <property name="ivy.retrieve.pattern"
                  value="lib/[conf]/[artifact](-[classifier]).[ext]"/>
        <taskdef resource="org/apache/ivy/ant/antlib.xml"
                 classpath="lib/ivy/ivy-2.5.0.jar"
                 loaderref="ivy.loader"
                 uri="antlib:org.apache.ivy.ant"/>
    </target>
    <target name="retrieve"
            depends="init-ivy">
        <ivy:retrieve sync="true"/>
    </target>
</project>{code}
When you now execute Ant, you only get {{lib/default/log4j-core.jar}} while you should also get {{lib/default/log4j-api.jar}} which works fine in Maven and Gradle.

The problem is most probably that there is a second dependency on {{log4j-api}}  where a different (additional) artifact is depended upon in the {{test}} scope.


> log4j-core is missing the log4j-api dependency when resolving
> -------------------------------------------------------------
>
>                 Key: IVY-1624
>                 URL: https://issues.apache.org/jira/browse/IVY-1624
>             Project: Ivy
>          Issue Type: Bug
>    Affects Versions: 2.5.0
>            Reporter: Björn Kautler
>            Priority: Major
>
> This is probably related to IVY-1625
>  
> Given the {{ivy.xml}}
> {code:xml}
> <ivy-module version="2.0">
>     <info organisation="foo" module="bar"/>
>     <dependencies>
>         <dependency org="org.apache.logging.log4j" name="log4j-core" rev="2.14.0" conf="default"/>
>     </dependencies>
> </ivy-module>{code}
> And the {{build.xml}}
> {code:xml}
> <project default="retrieve" xmlns:ivy="antlib:org.apache.ivy.ant">
>     <target name="check-ivy">
>         <available property="ivy.jar.present"
>                    file="lib/ivy/ivy-2.5.0.jar"
>                    type="file"/>
>     </target>
>     <target name="download-ivy"
>             depends="check-ivy"
>             unless="ivy.jar.present">
>         <mkdir dir="lib/ivy"/>
>         <get src="https://repo1.maven.org/maven2/org/apache/ivy/ivy/2.5.0/ivy-2.5.0.jar"
>              dest="lib/ivy/ivy-2.5.0.jar"
>              usetimestamp="true"/>
>     </target>
>     <target name="init-ivy"
>             depends="download-ivy">
>         <property name="ivy.retrieve.pattern"
>                   value="lib/[conf]/[artifact](-[classifier]).[ext]"/>
>         <taskdef resource="org/apache/ivy/ant/antlib.xml"
>                  classpath="lib/ivy/ivy-2.5.0.jar"
>                  loaderref="ivy.loader"
>                  uri="antlib:org.apache.ivy.ant"/>
>     </target>
>     <target name="retrieve"
>             depends="init-ivy">
>         <ivy:retrieve sync="true"/>
>     </target>
> </project>{code}
> When you now execute Ant, you only get {{lib/default/log4j-core.jar}} while you should also get {{lib/default/log4j-api.jar}} which works fine in Maven and Gradle.
> The problem is most probably that there is a second dependency on {{log4j-api}}  where a different (additional) artifact is depended upon in the {{test}} scope.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)