Sha256: 429d1641cf980ec19f854c11c1d607686467e686e3d00433cb374ad2008335ca

Contents?: true

Size: 1.1 KB

Versions: 1

Compression:

Stored size: 1.1 KB

Contents

# encoding: UTF-8

module Gjp
  # gjp get-source
  class GetSourceCommand < Gjp::BaseCommand
    parameter "POM", "a pom file path or URI"

    def execute
      checking_exceptions do
        project = Gjp::Project.new(".")
        source_getter = Gjp::SourceGetter.new

        puts "Attempting to find source through Maven..."
        if source_getter.get_maven_source_jar(project, pom)
          puts "Source jar found and added to Maven repository."
        else
          effective_pom_path = Gjp::MavenRunner.new(project).get_effective_pom(pom)
          puts "Source jar not found in Maven. Try looking here:"
          pom = Gjp::Pom.new(effective_pom_path)
          puts "Website: #{pom.url}" unless pom.url.empty?
          puts "SCM connection: #{pom.scm_connection}" unless pom.scm_connection.empty?
          puts "SCM connection: #{pom.scm_url}" unless pom.scm_url.empty?
          puts "The effective POM: #{effective_pom_path}"
          name = !pom.name.empty? ? pom.name : pom.artifact_id
          puts "Google: http://google.com/#q=#{URI.encode("#{name} sources")}"
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gjp-0.39.0 lib/gjp/commands/get_source.rb