mirror of
https://github.com/go-gitea/gitea.git
synced 2024-11-27 20:49:33 +08:00
de9bcd1d23
PackageDescriptor.Metadata might be nil (and maybe not only for maven). This is only a quick fix. The new `if` block is written intentionally to avoid unnecessary indenting to the existing code.
76 lines
3.4 KiB
Handlebars
76 lines
3.4 KiB
Handlebars
{{if and (eq .PackageDescriptor.Package.Type "maven") (not .PackageDescriptor.Metadata)}}
|
|
<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4>
|
|
<div class="ui attached segment">{{ctx.Locale.Tr "packages.no_metadata"}}</div>
|
|
{{end}}
|
|
{{if and (eq .PackageDescriptor.Package.Type "maven") .PackageDescriptor.Metadata}}
|
|
<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><repositories>
|
|
<repository>
|
|
<id>gitea</id>
|
|
<url><origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/maven"></origin-url></url>
|
|
</repository>
|
|
</repositories>
|
|
|
|
<distributionManagement>
|
|
<repository>
|
|
<id>gitea</id>
|
|
<url><origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/maven"></origin-url></url>
|
|
</repository>
|
|
|
|
<snapshotRepository>
|
|
<id>gitea</id>
|
|
<url><origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/maven"></origin-url></url>
|
|
</snapshotRepository>
|
|
</distributionManagement></code></pre></div>
|
|
</div>
|
|
<div class="field">
|
|
<label>{{svg "octicon-code"}} {{ctx.Locale.Tr "packages.maven.install"}}</label>
|
|
<div class="markup"><pre class="code-block"><code><dependency>
|
|
<groupId>{{.PackageDescriptor.Metadata.GroupID}}</groupId>
|
|
<artifactId>{{.PackageDescriptor.Metadata.ArtifactID}}</artifactId>
|
|
<version>{{.PackageDescriptor.Version.Version}}</version>
|
|
</dependency></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://docs.gitea.com/usage/packages/maven/"}}</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{{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}}
|