Class: Maven::Model::Build

Inherits:
Tag
  • Object
show all
Defined in:
lib/maven/model/model.rb

Instance Method Summary collapse

Methods inherited from Tag

#_name, _tags, #comment, #initialize, prepend_tags, tags

Constructor Details

This class inherits a constructor from Maven::Model::Tag

Instance Method Details

#plugin?(name) ⇒ Boolean

Returns:

  • (Boolean)


85
86
87
# File 'lib/maven/model/model.rb', line 85

def plugin?(name)
  plugins.key?(name)
end

#plugin_management(&block) ⇒ Object



89
90
91
92
93
94
95
# File 'lib/maven/model/model.rb', line 89

def plugin_management(&block)
  @plugin_management ||= PluginManagement.new
  if block
    block.call(@plugin_management)
  end
  @plugin_management
end

#plugins(&block) ⇒ Object



77
78
79
80
81
82
83
# File 'lib/maven/model/model.rb', line 77

def plugins(&block)
  @plugins ||= PluginHash.new
  if block
    block.call(@plugins)
  end
  @plugins
end

#resources(&block) ⇒ Object



61
62
63
64
65
66
67
# File 'lib/maven/model/model.rb', line 61

def resources(&block)
  @resources ||= ResourceArray.new
  if block
    block.call(@resources)
  end        
  @resources
end

#test_resources(&block) ⇒ Object



69
70
71
72
73
74
75
# File 'lib/maven/model/model.rb', line 69

def test_resources(&block)
  @test_resources ||= ResourceArray.new( 'testResources', TestResource )
  if block
    block.call(@test_resources)
  end        
  @test_resources
end

#to_xml(buf = "", indent = "") ⇒ Object



97
98
99
100
101
102
103
# File 'lib/maven/model/model.rb', line 97

def to_xml(buf = "", indent = "")
  if @final_name.nil? && (@resources.nil? || @resources.size == 0) && (@test_resources.nil? || @test_resources.size == 0) && (@plugins.nil? || @plugins.size == 0) && @plugin_management.nil? #TODO check the rest
    ""
  else
    super
  end
end