summaryrefslogtreecommitdiffstats
path: root/templates/package/content/maven.tmpl
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2024-10-18 20:33:49 +0200
committerDaniel Baumann <daniel@debian.org>2024-12-12 23:57:56 +0100
commite68b9d00a6e05b3a941f63ffb696f91e554ac5ec (patch)
tree97775d6c13b0f416af55314eb6a89ef792474615 /templates/package/content/maven.tmpl
parentInitial commit. (diff)
downloadforgejo-e68b9d00a6e05b3a941f63ffb696f91e554ac5ec.tar.xz
forgejo-e68b9d00a6e05b3a941f63ffb696f91e554ac5ec.zip
Adding upstream version 9.0.3.
Signed-off-by: Daniel Baumann <daniel@debian.org>
Diffstat (limited to 'templates/package/content/maven.tmpl')
-rw-r--r--templates/package/content/maven.tmpl75
1 files changed, 75 insertions, 0 deletions
diff --git a/templates/package/content/maven.tmpl b/templates/package/content/maven.tmpl
new file mode 100644
index 0000000..7f7e3fa
--- /dev/null
+++ b/templates/package/content/maven.tmpl
@@ -0,0 +1,75 @@
+{{if eq .PackageDescriptor.Package.Type "maven"}}
+ <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4>
+ <div class="ui attached segment">
+ <div class="ui form">
+ <div class="field">
+ <label>{{svg "octicon-code"}} {{ctx.Locale.Tr "packages.maven.registry"}}</label>
+ <div class="markup"><pre class="code-block"><code>&lt;repositories&gt;
+ &lt;repository&gt;
+ &lt;id&gt;gitea&lt;/id&gt;
+ &lt;url&gt;<origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/maven"></origin-url>&lt;/url&gt;
+ &lt;/repository&gt;
+&lt;/repositories&gt;
+
+&lt;distributionManagement&gt;
+ &lt;repository&gt;
+ &lt;id&gt;gitea&lt;/id&gt;
+ &lt;url&gt;<origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/maven"></origin-url>&lt;/url&gt;
+ &lt;/repository&gt;
+
+ &lt;snapshotRepository&gt;
+ &lt;id&gt;gitea&lt;/id&gt;
+ &lt;url&gt;<origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/maven"></origin-url>&lt;/url&gt;
+ &lt;/snapshotRepository&gt;
+&lt;/distributionManagement&gt;</code></pre></div>
+ </div>
+ {{if .PackageDescriptor.Metadata}}
+ <div class="field">
+ <label>{{svg "octicon-code"}} {{ctx.Locale.Tr "packages.maven.install"}}</label>
+ <div class="markup"><pre class="code-block"><code>&lt;dependency&gt;
+ &lt;groupId&gt;{{.PackageDescriptor.Metadata.GroupID}}&lt;/groupId&gt;
+ &lt;artifactId&gt;{{.PackageDescriptor.Metadata.ArtifactID}}&lt;/artifactId&gt;
+ &lt;version&gt;{{.PackageDescriptor.Version.Version}}&lt;/version&gt;
+&lt;/dependency&gt;</code></pre></div>
+ </div>
+ <div class="field">
+ <label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.maven.install2"}}</label>
+ <div class="markup"><pre class="code-block"><code>mvn install</code></pre></div>
+ </div>
+ <div class="field">
+ <label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.maven.download"}}</label>
+ <div class="markup"><pre class="code-block"><code>mvn dependency:get -DremoteRepositories=<origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/maven"></origin-url> -Dartifact={{.PackageDescriptor.Metadata.GroupID}}:{{.PackageDescriptor.Metadata.ArtifactID}}:{{.PackageDescriptor.Version.Version}}</code></pre></div>
+ </div>
+ <div class="field">
+ <label>{{ctx.Locale.Tr "packages.registry.documentation" "Maven" "https://forgejo.org/docs/latest/user/packages/maven/"}}</label>
+ </div>
+ {{end}}
+ </div>
+ </div>
+
+ {{if .PackageDescriptor.Metadata}}
+ {{if .PackageDescriptor.Metadata.Description}}
+ <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4>
+ <div class="ui attached segment">
+ {{.PackageDescriptor.Metadata.Description}}
+ </div>
+ {{end}}
+
+ {{if .PackageDescriptor.Metadata.Dependencies}}
+ <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.dependencies"}}</h4>
+ <div class="ui attached segment">
+ <div class="ui list">
+ {{range .PackageDescriptor.Metadata.Dependencies}}
+ <div class="item">
+ <i class="icon">{{svg "octicon-package-dependencies" 16 ""}}</i>
+ <div class="content">
+ <div class="header">{{.GroupID}}:{{.ArtifactID}}</div>
+ <div class="description text small">{{.Version}}</div>
+ </div>
+ </div>
+ {{end}}
+ </div>
+ </div>
+ {{end}}
+ {{end}}
+{{end}}