Created
May 19, 2012 05:24
-
-
Save ALRubinger/2729351 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
commented
May 19, 2012
via email
Gotcha. I see what you mean. The phases are succinct
…On May 18, 2012 10:45 PM, "Andrew Lee Rubinger" < ***@***.***> wrote:
WRT your comments on the "withTransitivity" earlier in the example: the
current prototype is built in "phases" to follow the grammar:
"I want to (optionally configure from X) and resolve THESE COORDINATES
using THIS RESOLUTION STRATEGY, obtaining the result in THIS FORMAT"
...which:
1) Allows us to address all use cases with the same flow
2) Minimizes the places that users will have to supply arguments (like
"resolver(TransitiveResolutionFilter)") thus keeping fluency
I _may_ very well be overlooking ways to make this simpler, but this is
the current POC, based on broader discussion:
https://community.jboss.org/thread/198974#733112
Thanks as always Adrian; love having your eyes around.
---
Reply to this email directly or view it on GitHub:
https://gist.github.com/2729351
+1 for stringified coordinate syntax.
…On May 19, 2012 5:21 AM, "Andrew Lee Rubinger" < ***@***.***> wrote:
Agreed Guillaume; the code you've got there _is_ currently supported as
well.
It actually makes me wonder what exactly the use case is for having
the builder (for groupId(), artifactId(), etc.)...
---
Reply to this email directly or view it on GitHub:
https://gist.github.com/2729351
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment