Skip to content

Latest commit

 

History

History
32 lines (18 loc) · 1.81 KB

DependenciesTutorial.md

File metadata and controls

32 lines (18 loc) · 1.81 KB

Dependencies

First, make sure you understand dependencies and their role in Ply by reading Dependencies.

Utilizing the electric-chilly project made in Project Setup, let's add a dependency to the Google Guava project.

  $ ply dep add com.google.guava:guava-collections:r03 -Pply.log.levels=info

The -Pply.log.levels=info property override is unnecessary but added to give more detailed feedback about what transitive dependencies are being downloaded, see Changing Log Levels for details about available log levels. Your output should be similar to the following:

dep guava

We can see that four dependencies were downloaded even though we only added one. Let's issue the ply dep tree command to visualize the dependencies of electric-chilly:

  $ ply dep tree

dep tree

It's now apparent that electric-chilly has the one direct dependency which we added com.google.guava:guava-collections:r03 but that the guava-collections dependency itself depends upon two other projects: com.google.guava:guava-primitives:r03 and com.google.guava:guava-annotations:r03. The guava-primitives itself depends upon com.google.guava:guava-base:r03.

Test Scoped Dependency

Let's now add junit to our electric-chilly project as a test dependency.

  $ ply test:dep add junit:junit:4.10

Note, adding a test dependency is the same except the dep script is run within scope test (i.e., test:dep). See Scopes for more information on their usage in ply.

Continue on to Repositories