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

Sebastian Nagel commented on IVY-1586:
--------------------------------------

The issue is still reproducible with the attached build.xml:
{noformat}
> wget 
> https://builds.apache.org/view/A/view/Ant/job/Ivy/lastSuccessfulBuild/artifact/build/artifact/org.apache.ivy_2.5.0.cr2_20190908122243.jar

> # cleanup lib/ and caches
> rm -rf lib/* ~/.ivy2/        

> rm -rf lib/* ~/.ivy2/

> # first run
> ant -lib .
Buildfile: .../build.xml

resolve:
[ivy:resolve] :: Apache Ivy 2.5.0-rc2-local-20190908122243 - 20190908122243 :: 
https://ant.apache.org/ivy/ ::
[ivy:resolve] :: loading settings :: url = 
jar:file:..././org.apache.ivy_2.5.0.cr2_20190908122243.jar!/org/apache/ivy/core/settings/ivysettings.xml
[ivy:resolve] :: resolving dependencies :: 
MyOrganisation#IvyResolveBug;working@mymachine
[ivy:resolve]   confs: [default]                                                
                                                                  
[ivy:resolve]   found ch.qos.logback#logback-classic;1.2.3 in public            
                                                                  
[ivy:resolve]   found ch.qos.logback#logback-core;1.2.3 in public               
                                                                  
[ivy:resolve]   found org.slf4j#slf4j-api;1.7.25 in public                      
                                                                  
[ivy:resolve] downloading 
https://repo1.maven.org/maven2/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar
 ...
[ivy:resolve] ............................. (283kB)
[ivy:resolve] .. (0kB)
[ivy:resolve]   [SUCCESSFUL ] 
ch.qos.logback#logback-classic;1.2.3!logback-classic.jar (100ms)
[ivy:resolve] downloading 
https://repo1.maven.org/maven2/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar
 ...
[ivy:resolve] ........................................ (460kB)
[ivy:resolve] .. (0kB)
[ivy:resolve]   [SUCCESSFUL ] 
ch.qos.logback#logback-core;1.2.3!logback-core.jar (96ms)
[ivy:resolve] downloading 
https://repo1.maven.org/maven2/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar 
...
[ivy:resolve] .............. (40kB)
[ivy:resolve] .. (0kB)
[ivy:resolve]   [SUCCESSFUL ] org.slf4j#slf4j-api;1.7.25!slf4j-api.jar (63ms)
[ivy:resolve] :: resolution report :: resolve 1469ms :: artifacts dl 274ms
        ---------------------------------------------------------------------
        |                  |            modules            ||   artifacts   |
        |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
        ---------------------------------------------------------------------
        |      default     |   3   |   3   |   3   |   0   ||   3   |   3   |
        ---------------------------------------------------------------------
[ivy:retrieve] :: retrieving :: MyOrganisation#IvyResolveBug
[ivy:retrieve]  confs: [default]
[ivy:retrieve]  3 artifacts copied, 0 already retrieved (784kB/18ms)

BUILD SUCCESSFUL
Total time: 2 seconds
> ls -lhtr lib
total 792K
-rw------- 1 wastl wastl  41K Mar 16  2017 slf4j-api.jar
-rw------- 1 wastl wastl 461K Mar 31  2017 logback-core.jar
-rw------- 1 wastl wastl 284K Mar 31  2017 logback-classic.jar

> # second run
> ant -lib .
Buildfile: .../build.xml

resolve:
[ivy:resolve] :: Apache Ivy 2.5.0-rc2-local-20190908122243 - 20190908122243 :: 
https://ant.apache.org/ivy/ ::
[ivy:resolve] :: loading settings :: url = 
jar:file:..././org.apache.ivy_2.5.0.cr2_20190908122243.jar!/org/apache/ivy/core/settings/ivysettings.xml
[ivy:resolve] :: resolving dependencies :: 
MyOrganisation#IvyResolveBug;working@mymachine
[ivy:resolve]   confs: [default]
[ivy:resolve]   found ch.qos.logback#logback-classic;1.2.3 in public
[ivy:resolve]   found ch.qos.logback#logback-core;1.2.3 in public
[ivy:resolve]   found org.slf4j#slf4j-api;1.7.25 in public
[ivy:resolve] downloading 
https://repo1.maven.org/maven2/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3-tests.jar
 ...
[ivy:resolve] ................................... (370kB)
[ivy:resolve] .. (0kB)
[ivy:resolve]   [SUCCESSFUL ] 
ch.qos.logback#logback-core;1.2.3!logback-core.jar(test-jar) (445ms)
[ivy:resolve] downloading 
https://repo1.maven.org/maven2/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25-tests.jar
 ...
[ivy:resolve] .............. (31kB)
[ivy:resolve] .. (0kB)
[ivy:resolve]   [SUCCESSFUL ] 
org.slf4j#slf4j-api;1.7.25!slf4j-api.jar(test-jar) (94ms)
[ivy:resolve] :: resolution report :: resolve 142ms :: artifacts dl 563ms
        ---------------------------------------------------------------------
        |                  |            modules            ||   artifacts   |
        |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
        ---------------------------------------------------------------------
        |      default     |   3   |   0   |   0   |   0   ||   3   |   2   |
        ---------------------------------------------------------------------
[ivy:retrieve] :: retrieving :: MyOrganisation#IvyResolveBug
[ivy:retrieve]  confs: [default]
[ivy:retrieve]  3 artifacts copied, 0 already retrieved (686kB/16ms)

BUILD SUCCESSFUL
Total time: 1 second

> ls -lhtr lib
total 688K
-rw------- 1 wastl wastl  32K Mar 16  2017 slf4j-api.jar
-rw------- 1 wastl wastl 371K Mar 31  2017 logback-core.jar
-rw------- 1 wastl wastl 284K Mar 31  2017 logback-classic.jar

> # logback-core.jar has changed !!!
{noformat}
Is there anything to be done additionally, e.g. explicitely define the retrieve 
pattern?

Also running the ivy.xml file fetches the test jar on the second run:
{noformat}
> # first run 
> java -jar ./org.apache.ivy_2.5.0.cr2_20190908122243.jar -ivy ivy.xml -cache 
> ./cache
:: loading settings :: url = 
jar:file:.../org.apache.ivy_2.5.0.cr2_20190908122243.jar!/org/apache/ivy/core/settings/ivysettings.xml
:: resolving dependencies :: MyOrganisation#IvyResolveBug;working@mymachine
        confs: [default]
        found ch.qos.logback#logback-classic;1.2.3 in public
        found ch.qos.logback#logback-core;1.2.3 in public
        found org.slf4j#slf4j-api;1.7.25 in public
downloading 
https://repo1.maven.org/maven2/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar
 ...
............................. (283kB)
.. (0kB)
        [SUCCESSFUL ] ch.qos.logback#logback-classic;1.2.3!logback-classic.jar 
(101ms)
downloading 
https://repo1.maven.org/maven2/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar
 ...
........................................ (460kB)
.. (0kB)
        [SUCCESSFUL ] ch.qos.logback#logback-core;1.2.3!logback-core.jar (106ms)
downloading 
https://repo1.maven.org/maven2/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar 
...
.............. (40kB)
.. (0kB)
        [SUCCESSFUL ] org.slf4j#slf4j-api;1.7.25!slf4j-api.jar (79ms)
:: resolution report :: resolve 2355ms :: artifacts dl 303ms
        ---------------------------------------------------------------------
        |                  |            modules            ||   artifacts   |
        |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
        ---------------------------------------------------------------------
        |      default     |   3   |   3   |   3   |   0   ||   3   |   3   |
        ---------------------------------------------------------------------

> tree ./cache/ch.qos.logback/logback-core/
./cache/ch.qos.logback/logback-core/
├── ivy-1.2.3.xml
├── ivy-1.2.3.xml.original
├── ivydata-1.2.3.properties
└── jars
    └── logback-core-1.2.3.jar


1 directory, 4 files


> # second run
> java -jar ./org.apache.ivy_2.5.0.cr2_20190908122243.jar -ivy ivy.xml -cache 
> ./cache
:: loading settings :: url = 
jar:file:.../org.apache.ivy_2.5.0.cr2_20190908122243.jar!/org/apache/ivy/core/settings/ivysettings.xml
:: resolving dependencies :: MyOrganisation#IvyResolveBug;working@mymachine
        confs: [default]
        found ch.qos.logback#logback-classic;1.2.3 in public
        found ch.qos.logback#logback-core;1.2.3 in public
        found org.slf4j#slf4j-api;1.7.25 in public
downloading 
https://repo1.maven.org/maven2/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3-tests.jar
 ...
................................... (370kB)
.. (0kB)
        [SUCCESSFUL ] 
ch.qos.logback#logback-core;1.2.3!logback-core.jar(test-jar) (534ms)
downloading 
https://repo1.maven.org/maven2/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25-tests.jar
 ...
.............. (31kB)
.. (0kB)
        [SUCCESSFUL ] org.slf4j#slf4j-api;1.7.25!slf4j-api.jar(test-jar) (103ms)
:: resolution report :: resolve 128ms :: artifacts dl 650ms
        ---------------------------------------------------------------------
        |                  |            modules            ||   artifacts   |
        |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
        ---------------------------------------------------------------------
        |      default     |   3   |   0   |   0   |   0   ||   3   |   2   |
        ---------------------------------------------------------------------

> tree ./cache/ch.qos.logback/logback-core/
./cache/ch.qos.logback/logback-core/
├── ivy-1.2.3.xml
├── ivy-1.2.3.xml.original
├── ivydata-1.2.3.properties
├── jars
│   └── logback-core-1.2.3.jar
└── test-jars
    └── logback-core-1.2.3-tests.jar

2 directories, 5 files

{noformat}
I'll also test the Nutch build whether the upgrade fixes NUTCH-2672.

> Retrieves test-library instead of binary-library
> ------------------------------------------------
>
>                 Key: IVY-1586
>                 URL: https://issues.apache.org/jira/browse/IVY-1586
>             Project: Ivy
>          Issue Type: Bug
>          Components: Ant
>    Affects Versions: 2.5.0-rc1
>         Environment: Eclipse Photon 4.8.0 64bit
> Ant 1.10.3.v20180417-1627
> Apache IvyDE 2.2.0.final-201311091524-RELEASE
> Apache Ivy 2.5.0.cr1_20180412005306
>            Reporter: Arni Schulze
>            Assignee: jaikiran pai
>            Priority: Blocker
>         Attachments: Ant_1st_output.txt, Ant_2nd_output.txt, build.xml, 
> ivy.xml
>
>
> If I delete the local Ivy cache and run my Ant script to retrieve 
> "ch.quos.logback logback-classic 1.2.3" I get the correct library and its 
> dependencies (see Ant_1st_output).
> But if I run the Ant script again (now having a local Ivy cache) it retrieves 
> the test-library and the test-library of the dependencies instead of the 
> correct ones (see Ant_2nd_output).
> I added minimalistic ivy.xml and Ant script. Because of the different 
> behavior of the first and every other run, I think this is a bug in Ivy.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to