From 2062359003b17eae08d0a2a2f41a5814cd8e647d Mon Sep 17 00:00:00 2001 From: Voomra Date: Tue, 19 Aug 2025 15:22:14 +0300 Subject: [PATCH] =?UTF-8?q?build:=20=D0=B8=D0=BD=D1=81=D1=82=D1=80=D1=83?= =?UTF-8?q?=D0=BA=D1=86=D0=B8=D0=B8=20=D0=BF=D1=83=D0=B1=D0=BB=D0=B8=D0=BA?= =?UTF-8?q?=D0=B0=D1=86=D0=B8=D0=B8=20Maven?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 685d08d..41a6550 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,6 @@ plugins { id 'java' + id 'maven-publish' } wrapper { @@ -7,11 +8,6 @@ wrapper { distributionType = Wrapper.DistributionType.BIN } -def publishScript = file(rootProject.getProjectDir().getPath() + '/publish.gradle') -if (publishScript.exists()) { - apply from: publishScript.path -} - project.group = projectGroup project.version = projectVersion @@ -40,3 +36,32 @@ dependencies { testCompileOnly (group: 'org.projectlombok', name: 'lombok', version: lombok_version) testImplementation (group: 'junit', name: 'junit', version: '4.12') } + +publishing { + publications { + mavenBinary(MavenPublication) { + groupId = project.group + artifactId = project.name + version = project.version + + from components.java + } + } + + repositories { + maven { + name = 'Di9' + url = uri('https://di9.ru/git/api/packages/Voomra/maven') + def giteaToken = System.getenv('GITEA_TOKEN') + + credentials(HttpHeaderCredentials) { + name = 'Authorization' + value = "token ${giteaToken}" + } + + authentication { + header(HttpHeaderAuthentication) + } + } + } +}