capistrano-maven 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -41,6 +41,10 @@ Following options are available to manage your Maven build.
41
41
  * `:mvn_update_snapshots` - add `--update-snapshots` if Maven commands. false by default.
42
42
  * `:mvn_update_settings` - update `settings.xml` or not. false by default.
43
43
  * `:mvn_update_settings_locally` - udate `settings.xml` or not on local compilation. false by default.
44
+ * `:mvn_settings` - list of your optional setting files for Maven. use `%w(settings.xml)` by default.
45
+ * `:mvn_settings_local` - list of your optional setting files for Maven. use `%w(settings.xml)` by default.
46
+ * `:mvn_settings_path` - the destination path of the optional `settings.xml` file. use `:release_path` by default.
47
+ * `:mvn_settings_path_local` - the destination path of the optional `settings.xml` file. use `pwd` by default.
44
48
  * `:mvn_template_path` - specify ERB template path for settings.xml.
45
49
  * `:mvn_java_home` - optional `JAVA_HOME` settings for Maven commands.
46
50
  * `:mvn_java_home_local` - optional `JAVA_HOME` settings for Maven commands in localhost.
@@ -49,19 +49,17 @@ module Capistrano
49
49
  File.join(mvn_path_local, 'bin', 'mvn')
50
50
  }
51
51
  _cset(:mvn_cmd) {
52
- settings = "--settings=#{mvn_settings_path}/settings.xml" if mvn_update_settings
53
52
  if fetch(:mvn_java_home, nil)
54
- "env JAVA_HOME=#{mvn_java_home} #{mvn_bin} #{mvn_options.join(' ')} #{settings}"
53
+ "env JAVA_HOME=#{mvn_java_home} #{mvn_bin} #{mvn_options.join(' ')}"
55
54
  else
56
- "#{mvn_bin} #{mvn_options.join(' ')} #{settings}"
55
+ "#{mvn_bin} #{mvn_options.join(' ')}"
57
56
  end
58
57
  }
59
58
  _cset(:mvn_cmd_local) {
60
- settings = "--settings=#{mvn_settings_path_local}/settings.xml" if mvn_update_settings_locally
61
59
  if fetch(:mvn_java_home_local, nil)
62
- "env JAVA_HOME=#{mvn_java_home_local} #{mvn_bin_local} #{mvn_options_local.join(' ')} #{settings}"
60
+ "env JAVA_HOME=#{mvn_java_home_local} #{mvn_bin_local} #{mvn_options_local.join(' ')}"
63
61
  else
64
- "#{mvn_bin_local} #{mvn_options_local.join(' ')} #{settings}"
62
+ "#{mvn_bin_local} #{mvn_options_local.join(' ')}"
65
63
  end
66
64
  }
67
65
  _cset(:mvn_project_path) {
@@ -79,12 +77,8 @@ module Capistrano
79
77
  _cset(:mvn_template_path, File.join(File.dirname(__FILE__), 'templates'))
80
78
  _cset(:mvn_update_settings, false)
81
79
  _cset(:mvn_update_settings_locally, false)
82
- _cset(:mvn_settings_path) {
83
- mvn_project_path
84
- }
85
- _cset(:mvn_settings_path_local) {
86
- mvn_project_path_local
87
- }
80
+ _cset(:mvn_settings_path) { mvn_project_path }
81
+ _cset(:mvn_settings_path_local) { mvn_project_path_local }
88
82
  _cset(:mvn_settings, %w(settings.xml))
89
83
  _cset(:mvn_settings_local, %w(settings.xml))
90
84
  _cset(:mvn_cleanup_settings, [])
@@ -100,10 +94,20 @@ module Capistrano
100
94
  options
101
95
  }
102
96
  _cset(:mvn_options) {
103
- mvn_common_options + fetch(:mvn_extra_options, [])
97
+ options = mvn_common_options + fetch(:mvn_extra_options, [])
98
+ if mvn_update_settings
99
+ settings = File.join(mvn_settings_path, mvn_settings.first)
100
+ options << "--settings=#{settings}"
101
+ end
102
+ options
104
103
  }
105
104
  _cset(:mvn_options_local) {
106
- mvn_common_options + fetch(:mvn_extra_options_local, [])
105
+ options = mvn_common_options + fetch(:mvn_extra_options_local, [])
106
+ if mvn_update_settings_locally
107
+ settings = File.join(mvn_settings_path_local, mvn_settings_local.first)
108
+ options << "--settings=#{settings}"
109
+ end
110
+ options
107
111
  }
108
112
 
109
113
  desc("Setup maven.")
@@ -177,7 +181,7 @@ module Capistrano
177
181
  if File.file?(file)
178
182
  File.read(file)
179
183
  elsif File.file?("#{file}.erb")
180
- ERB.new(File.read(file)).result(binding)
184
+ ERB.new(File.read("#{file}.erb")).result(binding)
181
185
  else
182
186
  abort("No such template: #{file} or #{file}.erb")
183
187
  end
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Maven
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-maven
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-18 00:00:00.000000000 Z
12
+ date: 2012-11-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano