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

ASF GitHub Bot commented on TWILL-182:
--------------------------------------

GitHub user serranom opened a pull request:

    https://github.com/apache/incubator-twill/pull/83

    TWILL-182, make jar name unique when creating bundle

    These code changes add a test for the same jar issue and update the jar 
name saved to the bundle if it is no longer unique.  To uniquify the name, 
parts of the path are progressively prefixed onto the original name.  We know 
at some point the full path is unique (because it is present in a set) so 
eventually the prepending must end up with a unique jar name.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/serranom/incubator-twill master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-twill/pull/83.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 #83
    
----
commit 0ae5df6cb21d1eede4482615fb07cc4870df5c73
Author: martin <mar...@attivio.com>
Date:   2016-08-09T19:21:30Z

    TWILL-182, failing test which demonstrates issue

commit 2208baa4ece8c947e0e6b9320d635376ecbed7ff
Author: martin <mar...@attivio.com>
Date:   2016-08-10T00:10:56Z

    TWILL-181, uniquify included jars by using dir names

commit 01623e81137215db2d188a1fb6f7c98acdce483f
Author: martin <mar...@attivio.com>
Date:   2016-08-10T00:15:43Z

    TWILL-181, fix warnings for style

commit 1bc367b459cf97f5d92391b89164c4f0baeac7ee
Author: martin <mar...@attivio.com>
Date:   2016-08-10T00:18:54Z

    Merge commit '0ae5df6'

commit 421e0f44f592a992a374500537b4c42d9c32a180
Author: martin <mar...@attivio.com>
Date:   2016-08-10T00:20:06Z

    Merge commit '2208baa'

commit a6cfceb6c4db6e5e8daab953f4dae9ae5995db3a
Author: martin <mar...@attivio.com>
Date:   2016-08-10T00:20:20Z

    Merge commit '01623e8'

----


> ApplicationBundler will overwrite dependencies with identical names
> -------------------------------------------------------------------
>
>                 Key: TWILL-182
>                 URL: https://issues.apache.org/jira/browse/TWILL-182
>             Project: Apache Twill
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 0.7.0-incubating
>            Reporter: Martin Serrano
>             Fix For: 0.8.0
>
>
> If two jars obtained from *different* classpath locations have the same name 
> but different contents, one will overwrite the other.  The dependency code 
> correctly finds the jars (uses the full path in the HashSet which accumulates 
> the deps) but when the bundle is created the jars are written to {{/lib}} 
> under their name.  This results in one overwriting the other.
> While this is not a likely occurrence, it occurs for us in our development 
> environment because our published jar names are built up from their project 
> hierarchy.  For example the model project for our sdk is in {{.../sdk/model}} 
> and will be on the classpath as {{.../sdk/model.jar}} and published as 
> {{sdk-model.jar}}.  
> In practice however this could occur with any jar name and would be more 
> likely over time.
> The {{ApplicationBundler}} could detect this and re-write the name with some 
> part of the path or suffix to ensure the name is unique.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to