lib/maven/tools/artifact.rb in maven-tools-1.0.8 vs lib/maven/tools/artifact.rb in maven-tools-1.0.9
- old
+ new
@@ -100,17 +100,26 @@
nil
end
end
def self.from_coordinate( coord )
+ exclusions = nil
+ coord.sub!(/:\[.+\]/) do |s|
+ exclusions = s[1..-1]
+ ''
+ end
args = coord.split( /:/ )
# maven coordinates differ :(
if args.size == 5
classifier = args[ 4 ]
args[ 4 ] = args[ 3 ]
args[ 3 ] = classifier
end
+ if exclusions
+ args[ 4 ] ||= nil
+ args << exclusions
+ end
new( *args )
end
def initialize( group_id, artifact_id, type,
version = nil, classifier = nil, exclusions = nil,
@@ -159,12 +168,12 @@
end
end
end
private :prepare
- unless defined? ATTRS
- ATTRS = :type=, :group_id=, :artifact_id=, :version=, :classifier=, :exclusions=, :scope=
- end
+ unless defined? ATTRS
+ ATTRS = :type=, :group_id=, :artifact_id=, :version=, :classifier=, :exclusions=, :scope=
+ end
def method_missing( m, arg = nil )
if ATTRS.member? m
# setter
self[ m.to_s[ 0..-2].to_sym ] = arg
elsif ATTRS.member?( "#{m}=".to_sym )