Skip to content

Instantly share code, notes, and snippets.

@ALRubinger
Created May 19, 2012 05:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ALRubinger/2729351 to your computer and use it in GitHub Desktop.
Save ALRubinger/2729351 to your computer and use it in GitHub Desktop.
Is there anything you would do to make this read simpler? Please post in the Gist comments your thoughts!
Proposed Code:
final File[] shorthand = Maven.resolver().addDependency("G:A:V").addExclusion().groupId("G1").artifactId("A1")
.endExclusion().addExclusion("G2:A2").resolve().withTransitivity().as(File.class);
...is equivalent to:
<dependency>
<groupId>G</groupId>
<artifactId>A</artifactId>
<version>V</version>
<exclusions>
<exclusion>
<groupId>G1</groupId>
<artifactId>A1</artifactId>
</exclusion>
<exclusion>
<groupId>G2</groupId>
<artifactId>A2</artifactId>
</exclusion>
</exclusions>
</dependency>
@jclouds
Copy link

jclouds commented May 19, 2012 via email

@jclouds
Copy link

jclouds commented May 19, 2012 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment