diff --git a/maven/lib/dependabot/maven.rb b/maven/lib/dependabot/maven.rb index cf9f2a23901..fc173f91e3c 100644 --- a/maven/lib/dependabot/maven.rb +++ b/maven/lib/dependabot/maven.rb @@ -23,6 +23,6 @@ "maven", lambda { |name| _group_id, artifact_id, _classifier = name.split(":") - %w(bom library).include?(artifact_id) ? name : artifact_id + name.length <= 100 ? name : artifact_id } ) diff --git a/maven/spec/dependabot/maven_spec.rb b/maven/spec/dependabot/maven_spec.rb index 83a1eca66a2..254ea3e1127 100644 --- a/maven/spec/dependabot/maven_spec.rb +++ b/maven/spec/dependabot/maven_spec.rb @@ -17,15 +17,15 @@ end context "normal dependency" do - let(:name) { "group.com:dep" } + let(:name) { "group.com:dep:mule-plugin" } - it { is_expected.to eq("dep") } + it { is_expected.to eq("group.com:dep:mule-plugin") } end context "dependency with classifier" do let(:name) { "group.com:dep:mule-plugin" } - it { is_expected.to eq("dep") } + it { is_expected.to eq("group.com:dep:mule-plugin") } end context "with a special-cased name" do @@ -33,5 +33,10 @@ it { is_expected.to eq("group.com:bom") } end + + context "with a 100+ character name" do + let(:name) { "com.long-domain-name-that-should-be-replaced-by-ellipsis.this-is-longer-group-id:the-longest-artifact-id" } # rubocop:disable Layout/LineLength + it { is_expected.to eq("the-longest-artifact-id") } + end end end