Class | JavaClass::Classpath::MavenArtefact |
In: |
lib/javaclass/classpath/maven_artefact.rb
|
Parent: | Object |
A reference to a Maven artefact. This is a group/artefact/version tuple that points to a single Jar in the Maven repository.
Author: | Peter Kofler |
group | [R] | |
name | [R] | |
title | [R] | |
version | [R] |
Create a Maven artefact with given group , name and version .
# File lib/javaclass/classpath/maven_artefact.rb, line 13 def initialize(group, name, version, title=nil) @group = group @name = name @version = version @title = title || make_title end
Return this Maven artefact‘s JavaClass::Classpath. This is a single Jar in the Maven repository.
# File lib/javaclass/classpath/maven_artefact.rb, line 28 def classpath cp = CompositeClasspath.new(basename) cp.add_file_name(repository_path) cp end
Kind of hack function to call Maven to download the current artefact if it does not exist.
# File lib/javaclass/classpath/maven_artefact.rb, line 21 def download_if_needed unless File.exist? repository_path puts `#{download_command}` end end