36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
# File 'lib/maven_pom.rb', line 36
def parse_pom(pom_doc, options = {})
$LOG.debug "Processing POM"
pom = OpenStruct.new
doc = REXML::Document.new(pom_doc)
pom.group = xpath_group(doc)
pom.artifact = xpath_text(doc, '/project/artifactId')
pom.version = xpath_text(doc, '/project/version') || xpath_text(doc, '/project/parent/version')
pom.description = xpath_text(doc, '/project/description')
pom.url = xpath_text(doc, '/project/url')
pom.dependencies = xpath_dependencies(doc)
pom.authors = xpath_authors(doc)
pom.name = "#{pom.group}.#{pom.artifact}"
pom.lib_name = "#{pom.artifact}.rb"
pom.gem_name = "#{pom.name}-#{pom.version}"
pom.jar_file = "#{pom.artifact}-#{pom.maven_version}.jar"
pom.remote_dir = "#{pom.group.gsub('.', '/')}/#{pom.artifact}/#{pom.version}"
pom
end
|