Class: Mvnizer::Command::NewProject
- Inherits:
-
Object
- Object
- Mvnizer::Command::NewProject
- Includes:
- Mvnizer::Configuration, TaskHelper
- Defined in:
- lib/mvnizer/commands/new_project.rb
Direct Known Subclasses
Constant Summary
Constants included from TaskHelper
Instance Method Summary collapse
-
#get_dependencies ⇒ Object
Returns the list of dependencies to be added for this type of project.
-
#run(project) ⇒ Object
Creates the Maven project structure, and creates the pom file from the options.
Methods included from TaskHelper
#add_dependency, #create_dir, #generate_file
Methods included from Mvnizer::Configuration
Instance Method Details
#get_dependencies ⇒ Object
Returns the list of dependencies to be added for this type of project. Override this method if extra dependencies are needed.
24 25 26 |
# File 'lib/mvnizer/commands/new_project.rb', line 24 def get_dependencies [] end |
#run(project) ⇒ Object
Creates the Maven project structure, and creates the pom file from the options
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/mvnizer/commands/new_project.rb', line 9 def run(project) create_dir("#{project.artifact_id}/src/main/java", "#{project.artifact_id}/src/test/java") coordinate_parser = CoordinateParser.new get_dependencies.each { |d| project.add_dependency(coordinate_parser.parse_scoped_coordinates(d)) } generate_file(File.join(TEMPLATE_DIR, 'pom.xml.erb'), "#{project.artifact_id}/pom.xml", project) end |