Skip to content

Commit da2c674

Browse files
committed
remove java-test-fixtures since it was causing pom self-reference
Signed-off-by: garyschulte <garyschulte@gmail.com>
1 parent 695f827 commit da2c674

3 files changed

Lines changed: 52 additions & 44 deletions

File tree

build.gradle

Lines changed: 46 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ plugins {
2121
id 'com.github.jk1.dependency-license-report' version '2.1'
2222
id 'io.spring.dependency-management' version '1.1.0'
2323
id 'net.ltgt.errorprone' version '3.0.1' apply false
24-
id 'maven-publish'
2524
id 'org.jreleaser' version '1.16.0'
2625
id 'java'
2726
id 'application'
@@ -50,19 +49,21 @@ allprojects {
5049
group = project.group
5150
version = project.version
5251
apply plugin: 'java-library'
53-
apply plugin: 'java-test-fixtures'
5452
apply plugin: 'io.spring.dependency-management'
5553
apply plugin: 'net.ltgt.errorprone'
56-
apply plugin: 'maven-publish'
5754
apply from: "${rootDir}/gradle/versions.gradle"
58-
5955
version = rootProject.version
6056

6157
java {
6258
withSourcesJar()
6359
withJavadocJar()
6460
}
6561

62+
test {
63+
// set a runtime shomei version for tests not executing from a jar
64+
systemProperty "shomei.version", project.version
65+
}
66+
6667
sourceCompatibility = '21'
6768
targetCompatibility = '21'
6869

@@ -195,50 +196,53 @@ def groupVal = project.findProperty("groupVal") ?: 'io.consensys.protocols.shome
195196
subprojects {
196197

197198
apply plugin: 'maven-publish'
199+
publishing {
200+
publications {
201+
mavenJava(MavenPublication) {
202+
versionMapping {
203+
allVariants {
204+
fromResolutionResult()
205+
}
206+
}
198207

199-
afterEvaluate { project ->
200-
publishing {
201-
publications {
202-
create("mavenJava", MavenPublication) {
203-
from components.java
204-
artifactId = project.name == 'shomei' ? 'shomei' : "shomei-${project.name}"
205-
groupId = groupVal
206-
version = project.version.toString()
207-
suppressPomMetadataWarningsFor("testFixturesApiElements")
208-
suppressPomMetadataWarningsFor("testFixturesRuntimeElements")
209-
210-
pom {
211-
name.set("Shomei module: ${project.path}")
212-
description.set("Module ${project.name} of shomei")
213-
url.set("https://github.com/consensys/shomei")
214-
licenses {
215-
license {
216-
name.set("Apache-2.0")
217-
url.set("https://www.apache.org/licenses/LICENSE-2.0")
218-
}
208+
from components.java
209+
artifactId = project.name == 'shomei' ? 'shomei' : "shomei-${project.name}"
210+
groupId = groupVal
211+
version = project.version.toString()
212+
suppressPomMetadataWarningsFor("testFixturesApiElements")
213+
suppressPomMetadataWarningsFor("testFixturesRuntimeElements")
214+
215+
pom {
216+
name.set("Shomei module: ${project.path}")
217+
description.set("Module ${project.name} of shomei")
218+
url.set("https://github.com/consensys/shomei")
219+
licenses {
220+
license {
221+
name.set("Apache-2.0")
222+
url.set("https://www.apache.org/licenses/LICENSE-2.0")
219223
}
220-
scm {
221-
connection.set("scm:git:https://github.com/consensys/shomei.git")
222-
developerConnection.set("scm:git:ssh://git@github.com:consensys/shomei.git")
223-
url.set("https://github.com/consensys/shomei")
224-
}
225-
developers {
226-
developer {
227-
id.set("consensys")
228-
name.set("Protocols Team")
229-
email.set("devops@consensys.net")
230-
}
224+
}
225+
scm {
226+
connection.set("scm:git:https://github.com/consensys/shomei.git")
227+
developerConnection.set("scm:git:ssh://git@github.com:consensys/shomei.git")
228+
url.set("https://github.com/consensys/shomei")
229+
}
230+
developers {
231+
developer {
232+
id.set("consensys")
233+
name.set("Protocols Team")
234+
email.set("devops@consensys.net")
231235
}
232236
}
233237
}
234238
}
239+
}
235240

236-
repositories {
237-
// publish to a staging directory for jreleaser to release from:
238-
// ./gradlew publish
239-
maven {
240-
url = rootProject.layout.buildDirectory.dir("staging-deploy")
241-
}
241+
repositories {
242+
// publish to a staging directory for jreleaser to release from:
243+
// ./gradlew publish
244+
maven {
245+
url = rootProject.layout.buildDirectory.dir("staging-deploy")
242246
}
243247
}
244248
}
@@ -297,7 +301,7 @@ tasks.all { t ->
297301
jar { enabled = false }
298302

299303
dependencies {
300-
implementation project(':shomei')
304+
// implementation project(':shomei')
301305
errorprone 'com.google.errorprone:error_prone_core'
302306
}
303307

services/rpc/server/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ dependencies {
3333
implementation 'org.hyperledger.besu.internal:core'
3434
implementation 'org.hyperledger.besu.internal:rlp'
3535
implementation 'org.hyperledger.besu.internal:util'
36-
implementation 'org.hyperledger.besu.internal:util'
3736
implementation 'io.micrometer:micrometer-core'
3837

3938
// Jackson dependencies

services/rpc/server/src/main/java/net/consensys/shomei/rpc/server/ShomeiVersion.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,18 @@
1313

1414
package net.consensys.shomei.rpc.server;
1515

16+
import java.util.Optional;
17+
1618
import org.hyperledger.besu.util.platform.PlatformDetector;
1719

1820
public class ShomeiVersion {
1921

2022
public static final String CLIENT_IDENTITY = "shomei";
2123
public static final String IMPL_VERSION =
22-
ShomeiVersion.class.getPackage().getImplementationVersion();
24+
Optional.ofNullable(System.getProperty("shomei.version"))
25+
.or(() -> Optional.ofNullable(
26+
ShomeiVersion.class.getPackage().getImplementationVersion()))
27+
.orElse("UNPUBLISHED_VERSION");
2328
public static final String OS = PlatformDetector.getOS();
2429
public static final String VM = PlatformDetector.getVM();
2530

0 commit comments

Comments
 (0)