lib/pom_license_check.rb
def traverse_project_and_check root
        initial_path = String.new root
        if !initial_path.end_with? "/"
            initial_path << "/"
        end
        puts "Validating license node in pom.xml for #{initial_path}"
        pom_path = "#{initial_path}pom.xml"
        check_pom pom_path
        pom_file = File.new(pom_path)
        pom_xml = Document.new(pom_file)

        xml_root = pom_xml.root

        xml_root.elements.each("modules/module") do |mvn_module|
            traverse_project_and_check "#{initial_path}#{mvn_module.get_text}"
        end
    end
# will use module declarations in poms and check for licenses in each one
will use module declarations in poms and check for licenses in each one
will use module declarations in poms and check for licenses in each one
def traverse_project_and_check root
        initial_path = String.new root
        if !initial_path.end_with? "/"
            initial_path << "/"
        end
        puts "Validating license node in pom.xml for #{initial_path}"
        pom_path = "#{initial_path}pom.xml"
        check_pom pom_path
        pom_file = File.new(pom_path)
        pom_xml = Document.new(pom_file)
        xml_root = pom_xml.root
        xml_root.elements.each("modules/module") do |mvn_module|
            traverse_project_and_check "#{initial_path}#{mvn_module.get_text}"
        end
    end
def traverse_project_and_check root initial_path = String . new root if ! initial_path . end_with? "/" initial_path << "/" end puts "Validating license node in pom.xml for #{initial_path}" pom_path = "#{initial_path}pom.xml" check_pom pom_path pom_file = File . new ( pom_path ) pom_xml = Document . new ( pom_file ) xml_root = pom_xml . root xml_root . elements . each ( "modules/module" ) do | mvn_module | traverse_project_and_check "#{initial_path}#{mvn_module.get_text}" end end
will use module declarations in poms and check for licenses in each one
will use module declarations in poms and check for licenses in each one
root