Skip to content

Instantly share code, notes, and snippets.

@dungdm93
Last active May 4, 2020 05:54
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 dungdm93/433ae55cd3e4264fc7350ea8a180718d to your computer and use it in GitHub Desktop.
Save dungdm93/433ae55cd3e4264fc7350ea8a180718d to your computer and use it in GitHub Desktop.
maven commands
plugins {
  id "com.dorongold.task-tree" version "1.5"
}

task resolveDependencies {
    setDescription "Resolves all projects dependencies from the repository."
    setGroup "Build Server"

    doLast {
        rootProject.allprojects { project ->
            def configurations = project.configurations + project.buildscript.configurations
            configurations
                .findAll { c -> c.canBeResolved }
                .forEach { c -> c.resolve() }
        }
    }
}
gradle taskTree <tasks>

# e.g
gradle taskTree build

gradle resolveDependencies
# `-Ddest` transitive dependencies won't be copied.
mvn dependency:get -Dartifact=groupId:artifactId:version[:packaging[:classifier]] -Ddest=/path/to/folder/

mvn dependency:resolve
mvn dependency:tree
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment