diff --git a/templates/package/content/maven.tmpl b/templates/package/content/maven.tmpl
index 49ada6a3a3..7f7e3fafcc 100644
--- a/templates/package/content/maven.tmpl
+++ b/templates/package/content/maven.tmpl
@@ -23,49 +23,53 @@
</snapshotRepository>
</distributionManagement>
-
-
- {{range .PackageDescriptor.Metadata.Dependencies}}
-
-
{{svg "octicon-package-dependencies" 16 ""}}
-
-
- {{end}}
+ {{if .PackageDescriptor.Metadata}}
+ {{if .PackageDescriptor.Metadata.Description}}
+
+
+ {{.PackageDescriptor.Metadata.Description}}
-
+ {{end}}
+
+ {{if .PackageDescriptor.Metadata.Dependencies}}
+
+
+
+ {{range .PackageDescriptor.Metadata.Dependencies}}
+
+
{{svg "octicon-package-dependencies" 16 ""}}
+
+
+ {{end}}
+
+
+ {{end}}
{{end}}
{{end}}
diff --git a/templates/package/metadata/maven.tmpl b/templates/package/metadata/maven.tmpl
index 548be61790..62573a146a 100644
--- a/templates/package/metadata/maven.tmpl
+++ b/templates/package/metadata/maven.tmpl
@@ -1,4 +1,4 @@
-{{if eq .PackageDescriptor.Package.Type "maven"}}
+{{if and (eq .PackageDescriptor.Package.Type "maven") .PackageDescriptor.Metadata}}
{{if .PackageDescriptor.Metadata.Name}}
{{svg "octicon-note" 16 "tw-mr-2"}} {{.PackageDescriptor.Metadata.Name}}
{{end}}
{{if .PackageDescriptor.Metadata.ProjectURL}}
{{end}}
{{range .PackageDescriptor.Metadata.Licenses}}
{{svg "octicon-law" 16 "tw-mr-2"}} {{.}}
{{end}}
diff --git a/tests/integration/api_packages_maven_test.go b/tests/integration/api_packages_maven_test.go
index c7ed554a9d..4a1a5645d9 100644
--- a/tests/integration/api_packages_maven_test.go
+++ b/tests/integration/api_packages_maven_test.go
@@ -241,4 +241,15 @@ func TestPackageMaven(t *testing.T) {
putFile(t, fmt.Sprintf("/%s/maven-metadata.xml", snapshotVersion), "test", http.StatusCreated)
putFile(t, fmt.Sprintf("/%s/maven-metadata.xml", snapshotVersion), "test-overwrite", http.StatusCreated)
})
+
+ t.Run("Partial upload", func(t *testing.T) {
+ defer tests.PrintCurrentTest(t)()
+
+ partialVersion := packageVersion + "-PARTIAL"
+ putFile(t, fmt.Sprintf("/%s/%s", partialVersion, filename), "test", http.StatusCreated)
+ pkgUIURL := fmt.Sprintf("/%s/-/packages/maven/%s-%s/%s", user.Name, groupID, artifactID, partialVersion)
+ req := NewRequest(t, "GET", pkgUIURL)
+ resp := MakeRequest(t, req, http.StatusOK)
+ assert.NotContains(t, resp.Body.String(), "Internal server error")
+ })
}