@CliCommand( value = REPOSITORY_REMOVE_COMMAND, help = "Removes an existing repository from the Maven project object model (POM)") public void removeRepository( @CliOption(key = "id", mandatory = true, help = "The ID of the repository") final String id, @CliOption(key = "url", mandatory = true, help = "The URL of the repository") final String url) { mavenOperations.removeRepository( mavenOperations.getFocusedModuleName(), new Repository(id, null, url)); }
@CliCommand( value = REPOSITORY_ADD_COMMAND, help = "Adds a new repository to the Maven project object model (POM)") public void addRepository( @CliOption(key = "id", mandatory = true, help = "The ID of the repository") final String id, @CliOption(key = "name", mandatory = false, help = "The name of the repository") final String name, @CliOption(key = "url", mandatory = true, help = "The URL of the repository") final String url) { mavenOperations.addRepository( mavenOperations.getFocusedModuleName(), new Repository(id, name, url)); }
@CliCommand(value = MODULE_FOCUS_COMMAND, help = "Changes focus to a different project module") public void focusModule( @CliOption(key = "moduleName", mandatory = true, help = "The module to focus on") final Pom module) { mavenOperations.setModule(module); }
@CliCommand(value = PROJECT_COMMAND, help = "Creates a new Maven project") public void createProject( @CliOption( key = {"", "topLevelPackage"}, mandatory = true, optionContext = "update", help = "The uppermost package name (this becomes the <groupId> in Maven and also the '~' value when using Roo's shell)") final JavaPackage topLevelPackage, @CliOption( key = "projectName", help = "The name of the project (last segment of package name used as default)") final String projectName, @CliOption( key = "java", help = "Forces a particular major version of Java to be used (will be auto-detected if unspecified; specify 5 or 6 or 7 only)") final Integer majorJavaVersion, @CliOption( key = "parent", help = "The Maven coordinates of the parent POM, in the form \"groupId:artifactId:version\"") final GAV parentPom, @CliOption( key = "packaging", help = "The Maven packaging of this project", unspecifiedDefaultValue = JarPackaging.NAME) final PackagingProvider packaging) { mavenOperations.createProject( topLevelPackage, projectName, majorJavaVersion, parentPom, packaging); }
@CliCommand( value = DEPENDENCY_REMOVE_COMMAND, help = "Removes an existing dependency from the Maven project object model (POM)") public void removeDependency( @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) { mavenOperations.removeDependency( mavenOperations.getFocusedModuleName(), groupId, artifactId, version, classifier); }
@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); }
@CliAvailabilityIndicator({ PERFORM_PACKAGE_COMMAND, PERFORM_ECLIPSE_COMMAND, PERFORM_TESTS_COMMAND, PERFORM_CLEAN_COMMAND, PERFORM_ASSEMBLY_COMMAND, PERFORM_COMMAND_COMMAND }) public boolean isPerformCommandAllowed() { return mavenOperations.isFocusedProjectAvailable(); }
@CliCommand( value = {PERFORM_COMMAND_COMMAND}, help = "Executes a user-specified Maven command") public void mvn( @CliOption( key = "mavenCommand", mandatory = true, help = "User-specified Maven command (eg test:test)") final String command) throws IOException { mavenOperations.executeMvnCommand(command); }
@CliAvailabilityIndicator(MODULE_FOCUS_COMMAND) public boolean isModuleFocusAllowed() { return mavenOperations.isModuleFocusAllowed(); }
@CliAvailabilityIndicator({DEPENDENCY_ADD_COMMAND, DEPENDENCY_REMOVE_COMMAND}) public boolean isDependencyModificationAllowed() { return mavenOperations.isFocusedProjectAvailable(); }
@CliAvailabilityIndicator(PROJECT_COMMAND) public boolean isCreateProjectAvailable() { return mavenOperations.isCreateProjectAvailable(); }
@CliAvailabilityIndicator(MODULE_CREATE_COMMAND) public boolean isModuleCreationAllowed() { return mavenOperations.isModuleCreationAllowed(); }