Class: Tetra::Mvn

Inherits:
Object
  • Object
show all
Defined in:
lib/tetra/facades/mvn.rb

Overview

encapsulates tetra-specific Maven commandline options

Class Method Summary collapse

Class Method Details

.commandline(project_path, mvn_path) ⇒ Object

returns a command line for running Maven



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/tetra/facades/mvn.rb', line 6

def self.commandline(project_path, mvn_path)
  executable = if mvn_path
                 File.join(project_path, mvn_path, "mvn")
               else
                 "mvn" # use system-provided executable
               end

  repo_path = File.join(project_path, "kit", "m2")
  config_path = File.join(project_path, "kit", "m2", "settings.xml")

  options = [
    "-Dmaven.repo.local=#{repo_path}",
    "--settings #{config_path}",
    "--strict-checksums"
  ]

  "#{executable} #{options.join(' ')}"
end