aboutsummaryrefslogtreecommitdiffstats
path: root/templates/package/content/maven.tmpl
blob: ff89145fd0023318cb943d090755dc9d99bd8ec5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{{if eq .PackageDescriptor.Package.Type "maven"}}
	<h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4>
	<div class="ui attached segment">
		<div class="ui form">
			<div class="field">
				<label>{{svg "octicon-code"}} {{.locale.Tr "packages.maven.registry" | Safe}}</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;<gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/maven"></gitea-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;<gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/maven"></gitea-origin-url>&lt;/url&gt;
	&lt;/repository&gt;

	&lt;snapshotRepository&gt;
		&lt;id&gt;gitea&lt;/id&gt;
		&lt;url&gt;<gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/maven"></gitea-origin-url>&lt;/url&gt;
	&lt;/snapshotRepository&gt;
&lt;/distributionManagement&gt;</code></pre></div>
			</div>
			<div class="field">
				<label>{{svg "octicon-code"}} {{.locale.Tr "packages.maven.install" | Safe}}</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"}} {{.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"}} {{.locale.Tr "packages.maven.download"}}</label>
				<div class="markup"><pre class="code-block"><code>mvn dependency:get -DremoteRepositories=<gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/maven"></gitea-origin-url> -Dartifact={{.PackageDescriptor.Metadata.GroupID}}:{{.PackageDescriptor.Metadata.ArtifactID}}:{{.PackageDescriptor.Version.Version}}</code></pre></div>
			</div>
			<div class="field">
				<label>{{.locale.Tr "packages.maven.documentation" | Safe}}</label>
			</div>
		</div>
	</div>

	{{if .PackageDescriptor.Metadata.Description}}
		<h4 class="ui top attached header">{{.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">{{.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}}