Closed ronshapiro closed 7 years ago
Hm, I didn't realize that pants was generating the POM, so this might be more complicated than I thought.
Regardless, as our README states, we maintain this clone of the original jarjar google code project strictly for pants use. It is trivial fwiw to run jarjar using pants. This BUILD file:
jar_library(
name='jarjar',
jars=[
jar('org.pantsbuild', 'jarjar', '1.6.3'),
]
)
jvm_binary(
name='jarjar-main',
dependencies=[
': jarjar',
],
main='org.pantsbuild.jarjar.Main',
)
Can be run with: ./pants run //:jarjar-main -- [jarjar args]
Using the BUILD file above you can also create a runnable fat jar with: ./pants binary //:jarjar-main
. The all-inclusive jar will be plopped in dist and you can run with: java -jar dist/jarjar-main.jar ...
. We would never publish a fat jar though out of principle.
Since there are lots of deps for jarjar, it makes it challenging to run from the command-line. Can you use the maven-shade-plugin to create a version of the build that bundles all the deps together? Google Java Format does this and it's relatively trivial. Happy to send a pull-request if you'd like.