Ejemplo n.º 1
0
  @CliCommand(
      value = DEPENDENCY_ADD_COMMAND,
      help = "Adds a new dependency to the Maven project object model (POM)")
  public void addDependency(
      @CliOption(key = "groupId", mandatory = true, help = "The group ID of the dependency")
          final String groupId,
      @CliOption(key = "artifactId", mandatory = true, help = "The artifact ID of the dependency")
          final String artifactId,
      @CliOption(key = "version", mandatory = true, help = "The version of the dependency")
          final String version,
      @CliOption(key = "classifier", help = "The classifier of the dependency")
          final String classifier,
      @CliOption(key = "scope", help = "The scope of the dependency") final DependencyScope scope) {

    mavenOperations.addDependency(
        mavenOperations.getFocusedModuleName(), groupId, artifactId, version, scope, classifier);
  }