Skip to content

Commit 159e6de

Browse files
committed
fix root project publishing
1 parent ba99470 commit 159e6de

1 file changed

Lines changed: 28 additions & 26 deletions

File tree

build.gradle

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,6 @@ plugins {
99

1010
setUpJar(project)
1111

12-
publishing {
13-
publications {
14-
mavenJava(MavenPublication) {
15-
pom.withXml {
16-
asNode().appendNode('dependencies')
17-
}
18-
}
19-
}
20-
repositories {
21-
def ENV = System.getenv()
22-
23-
if (ENV.MAVEN_URL) {
24-
maven {
25-
url ENV.MAVEN_URL
26-
27-
credentials {
28-
username ENV.MAVEN_USERNAME
29-
password ENV.MAVEN_PASSWORD
30-
}
31-
}
32-
} else {
33-
mavenLocal()
34-
}
35-
}
36-
}
37-
3812
def setUpJar(project) {
3913
project.apply plugin: 'java-library'
4014
project.apply plugin: 'eclipse'
@@ -86,6 +60,34 @@ def setUpJar(project) {
8660
rename { "${it}_${project.base.archivesName.get()}" }
8761
}
8862
}
63+
64+
project.publishing {
65+
publications {
66+
mavenJava(MavenPublication) {
67+
artifactId project.mod_artifact_id
68+
69+
pom.withXml {
70+
asNode().appendNode('dependencies')
71+
}
72+
}
73+
}
74+
repositories {
75+
def ENV = System.getenv()
76+
77+
if (ENV.MAVEN_URL) {
78+
maven {
79+
url ENV.MAVEN_URL
80+
81+
credentials {
82+
username ENV.MAVEN_USERNAME
83+
password ENV.MAVEN_PASSWORD
84+
}
85+
}
86+
} else {
87+
mavenLocal()
88+
}
89+
}
90+
}
8991
}
9092

9193
def addPomDependency(project) {

0 commit comments

Comments
 (0)