Skip to content

Commit ae7a172

Browse files
authored
shadow jackson deps and remove deprecations (via #615)
1 parent 4c6200e commit ae7a172

47 files changed

Lines changed: 1745 additions & 2427 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
java-version: ${{ matrix.java-version }}
2828

2929
- name: Build with Gradle
30-
run: ./gradlew build -x test
30+
run: ./gradlew build -x test --scan
3131

3232
- name: Run tests
3333
if: always()

allure-bom/build.gradle.kts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
plugins {
2+
`java-platform`
3+
}
4+
5+
description = "Allure Java (Bill of Materials)"
6+
7+
dependencies {
8+
constraints {
9+
rootProject.subprojects.sorted()
10+
.forEach { api("${it.group}:${it.name}:${it.version}") }
11+
}
12+
}
13+
14+
tasks.withType(Jar::class) {
15+
enabled = false
16+
}
17+
18+
configurations.archives {
19+
artifacts.removeAll{ it.extension == "jar" }
20+
}
21+
22+
publishing.publications.named<MavenPublication>("maven") {
23+
pom {
24+
from(components["javaPlatform"])
25+
description.set("This Bill of Materials POM can be used to ease dependency management " +
26+
"when referencing multiple Allure artifacts using Gradle or Maven.")
27+
packaging = "pom"
28+
withXml {
29+
val filteredContent = asString().replace("\\s*<scope>compile</scope>".toRegex(), "")
30+
asString().clear().append(filteredContent)
31+
}
32+
}
33+
}
Lines changed: 48 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
plugins {
2+
id("com.github.johnrengelman.shadow")
3+
}
4+
15
description = "Allure Java Commons"
26

37
val agent: Configuration by configurations.creating
@@ -7,7 +11,7 @@ dependencies {
711
api("org.slf4j:slf4j-api")
812
api(project(":allure-model"))
913
compileOnly("org.aspectj:aspectjrt")
10-
implementation("com.fasterxml.jackson.core:jackson-databind")
14+
internal("com.fasterxml.jackson.core:jackson-databind")
1115
testImplementation("io.github.benas:random-beans")
1216
testImplementation("io.github.glytching:junit-extensions")
1317
testImplementation("org.apache.commons:commons-lang3")
@@ -21,17 +25,51 @@ dependencies {
2125
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
2226
}
2327

24-
tasks.jar {
25-
manifest {
26-
attributes(mapOf(
27-
"Automatic-Module-Name" to "io.qameta.allure.commons"
28-
))
28+
configurations.forEach { configuration ->
29+
configuration.outgoing.apply {
30+
val removed = artifacts.removeAll { it.classifier.isNullOrEmpty() }
31+
if (removed) {
32+
artifact(tasks.shadowJar) {
33+
classifier = ""
34+
}
35+
}
2936
}
3037
}
3138

32-
tasks.test {
33-
useJUnitPlatform()
34-
doFirst {
35-
jvmArgs("-javaagent:${agent.singleFile}")
39+
tasks {
40+
jar {
41+
dependsOn(shadowJar)
42+
enabled = false
43+
}
44+
45+
shadowJar {
46+
archiveClassifier.set("")
47+
relocate("com.fasterxml.jackson", "io.qameta.allure.internal.shadowed.jackson")
48+
dependencies {
49+
include(dependency("com.fasterxml.jackson.core::"))
50+
}
51+
exclude("**/module-info.class")
52+
exclude("META-INF/LICENSE*.md")
53+
mergeServiceFiles()
54+
manifest {
55+
attributes(mapOf(
56+
"Specification-Title" to project.name,
57+
"Implementation-Title" to project.name,
58+
"Implementation-Version" to project.version,
59+
"Automatic-Module-Name" to "io.qameta.allure.commons"
60+
))
61+
}
62+
}
63+
64+
assemble {
65+
dependsOn(shadowJar)
66+
}
67+
68+
test {
69+
dependsOn(shadowJar)
70+
useJUnitPlatform()
71+
doFirst {
72+
jvmArgs("-javaagent:${agent.singleFile}")
73+
}
3674
}
3775
}

allure-java-commons/src/main/java/io/qameta/allure/AllureConstants.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,6 @@ public final class AllureConstants {
3030

3131
public static final String TEST_RESULT_CONTAINER_FILE_GLOB = "*-container.json";
3232

33-
/**
34-
* @deprecated scheduled to remove in 3.0
35-
*/
36-
@Deprecated
37-
public static final String TEST_RUN_FILE_SUFFIX = "-testrun.json";
38-
39-
/**
40-
* @deprecated scheduled to remove in 3.0
41-
*/
42-
@Deprecated
43-
public static final String TEST_RUN_FILE_GLOB = "*-testrun.json";
44-
4533
public static final String ATTACHMENT_FILE_SUFFIX = "-attachment";
4634

4735
public static final String ATTACHMENT_FILE_GLOB = "*-attachment*";

allure-java-commons/src/main/java/io/qameta/allure/AllureUtils.java

Lines changed: 0 additions & 46 deletions
This file was deleted.

allure-java-commons/src/main/java/io/qameta/allure/FileSystemResultsReader.java

Lines changed: 0 additions & 120 deletions
This file was deleted.

allure-java-commons/src/main/java/io/qameta/allure/FileSystemResultsWriter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
package io.qameta.allure;
1717

1818
import com.fasterxml.jackson.databind.ObjectMapper;
19-
import io.qameta.allure.model.Allure2ModelJackson;
19+
import io.qameta.allure.internal.Allure2ModelJackson;
2020
import io.qameta.allure.model.TestResult;
2121
import io.qameta.allure.model.TestResultContainer;
2222

0 commit comments

Comments
 (0)