lib/maven/tools/artifact.rb in maven-tools-0.34.1 vs lib/maven/tools/artifact.rb in maven-tools-0.34.2

- old
+ new

@@ -16,11 +16,15 @@ # FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR # COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -require 'maven/tools/coordinate' +begin + require 'maven/tools/coordinate' +rescue LoadError + # that gives an load error on jruby-maven-plugin/gem-maven-plugin ITs +end module Maven module Tools class Artifact < Hash class Helper @@ -91,9 +95,15 @@ end end def self.from_coordinate( coord ) args = coord.split( /:/ ) + # maven coordinates differ :( + if args.size == 5 + classifier = args[ 4 ] + args[ 4 ] = args[ 3 ] + args[ 3 ] = classifier + end new( *args ) end def initialize( group_id, artifact_id, type, version = nil, classifier = nil, exclusions = nil,