[
https://issues.apache.org/jira/browse/IVY-1478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16015252#comment-16015252
]
ASF GitHub Bot commented on IVY-1478:
-------------------------------------
GitHub user jaikiran opened a pull request:
https://github.com/apache/ant-ivy/pull/17
Fix IVY-1478
The commit here fixes the issue reported in
https://issues.apache.org/jira/browse/IVY-1478 and also includes a test case to
verify the changes.
The fix involves setting the unpacked artifact reference within the
`ArtifactDownloadReport` when the unpacking happens. In the absence of
reference to the unpacked artifact in the `ArtifactDownloadReport`, the
`RetrieveEngine` while dealing with unpacked artifacts, explicitly uses the
`PackagingManager` for getting hold of the unpacked artifact.
This commit includes a change in the method signature of
`PackagingManager.unpackArtifact` which now returns a reference to the unpacked
`Artifact` whereas previously the method return type was `void`. This change
however is still binary compatible.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/jaikiran/ant-ivy ivy-1478
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/ant-ivy/pull/17.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #17
----
commit 850a888c546bab897542a2d89ff76ca9debce0ee
Author: Jaikiran Pai <[email protected]>
Date: 2017-05-18T05:55:24Z
IVY-1478 Fix RetrieveEngine to take into account the correct extension
while dealing with unpacked artifacts
----
> Missing extension in RETRIEVE task in combination with updatesite resolver
> --------------------------------------------------------------------------
>
> Key: IVY-1478
> URL: https://issues.apache.org/jira/browse/IVY-1478
> Project: Ivy
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.4.0-RC1
> Environment: Windows 7, 64bit
> Reporter: Alexander Ziller
> Priority: Blocker
> Labels: extensions, resolver, retrieve, updateresolver
>
> Using the updatesite resolver and the retrieve ant task, I do not get the
> correct filenames in the retrieve destination. The retrieve task cuts away
> the extension (.jar) of the bundles that I fetched.
> *Steps to reproduce:*
> * Download demo files from
> https://ant.apache.org/ivy/history/latest-milestone/osgi/target-platform.html
> * add the following dependencies:
> {quote}
> <dependency org="bundle" name="org.eclipse.osgi"
> rev="3.8.2.v20130124-134944"/>
> <dependency org="bundle" name="org.eclipse.equinox.ds"
> rev="1.4.1.v20120926-201320"/>
> {quote}
> * run "ant update-dependencies"
> * run "ant generate-retrieved-target-platform"
> *Reason of bug:*
> _org.apache.ivy.core.retrieve.RetrieveEngine:342_
> checks against ArtifactDownloadReport.getUnpackedLocalFile() and if present,
> sets a String representing the extension to EMPTY instead of NULL.
> _org.apache.ivy.core.IvyPatternHelper:162_
> uses the extension unless set to NULL, in which case "jar" would be correctly
> used.
> Settings the extension string to EMPTY when
> ArtifactDownloadReport.getUnpackedLocalFile() returns NOT NULL is IMO wrong
> when there is only 1 decision for the final extension based on whether the
> extension string has a value or is NULL, in which case the extension is "jar"
> *Possible solution:*
> In _org.apache.ivy.core.IvyPatternHelper_:
> When ArtifactDownloadReport.getUnpackedLocalFile() returns NOT NULL, try to
> retrieve the extension from the File object OR set the extension to NULL,
> expecting "jar" as extension (highly risky)
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)