Flatten stable classpath for bundle

Review Request #3261 - Created Dec. 15, 2015 and submitted

Information
Peiyu Wang
pants
peiyuwang:peiyu/flatten-bundle-libs2
2729
f1d4264...
Reviewers
pants-reviews
nhoward_tw, patricklaw, stuhood

This is to continue the recent work on bundle, for making the bundle fat jar
slimmer by switching to use stable classpath.

Turns out many tools, hadoop in particular, assume a flatten directory
structure for jars under libs/, and jar names are used for caching purpose and
need to be unique. This review is to solve this problem by switching to a flat
structure, external jars under libs/, internal jars under internal-libs/.

Since maven namings (a-b-1.2.3.jar) and pants target.id based naming (a.b-0.jar)
are in different styles: pants' always have a dot before the dash. Very unlikely
there is name conflict between them.

Now app-bundle/ directory will include

app-bundle.jar // this only sets Class-Path + other Manifest entries
libs/
libs/x-1.2.3.jar
libs/others-4.5.6.jar
internal-libs/a.b.c-0.jar
internal-libs/a.b.c-1 // this could be a resource directory, there will be another review to make this a jar (only for performance benefit)
internal-libs/a.b.c-classpath.txt
...

This change includes:
- Place internal jars under internal-libs/ and 3rdparty jars under libs/
- Append an unique index for multiple classpath entries belong to the same target
- Continue to handle legacy naming used only by intellij plugin vs target.id
based naming, code will be simplified once we deprecate the former

https://travis-ci.org/peiyuwang/pants/builds/97395450

Issues

  • 0
  • 6
  • 0
  • 6
Description From Last Updated
Patrick Lawson
Stu Hood
Nick Howard (Twitter)
Peiyu Wang
Stu Hood
Peiyu Wang
Review request changed

Status: Closed (submitted)

Loading...