lib/maven/tools/dsl/jarfile.rb in maven-tools-1.0.13 vs lib/maven/tools/dsl/jarfile.rb in maven-tools-1.1.0
- old
+ new
@@ -52,10 +52,15 @@
end
def dependencies
@deps
end
+
+ def basedir
+ # assume the lock file is inside the project dir
+ File.dirname(@lock.file)
+ end
end
def artifacts
# TODO remove this part
@artifacts ||= []
@@ -111,10 +116,12 @@
warn "\n# Jarfile DSL #\n"
warn self.class.help_block( :local => "path-to-local-jar", :jar => nil, :pom => nil, :repository => nil, :snapshot_repository => nil, :scope => nil)[0..-2]
end
def local( path )
- a = Artifact.new_local( ::File.expand_path( path ), :jar )
+ jar_path = ::File.expand_path( path )
+ jar_path.sub!( /#{@parent.basedir}/, '${basedir}' )
+ a = Artifact.new_local( jar_path, :jar )
add( a )
# TODO remove this part
artifacts << a
a
end