shadowJar {
dependsOn buildAgent, compileAttacher
group = "Distribution"
description = "Builds the universal attacher + agent suite"
archiveBaseName.set('profiler-all-in-one')
archiveClassifier.set('all') // Prevents "mainClassName" lookup errors in some versions
// Reusing classes from your existing agent and the new attacher
from compileAgent.destinationDirectory
from compileAttacher.destinationDirectory
// This line solves the "mainClass" error by manually setting the Manifest
manifest {
attributes(
'Main-Class': 'comet.agent.UniversalAttacher',
'Premain-Class': 'comet.agent.ProfilerAgent',
'Agent-Class': 'comet.agent.ProfilerAgent',
'Can-Redefine-Classes': 'true',
'Can-Retransform-Classes': 'true'
)
}
// Merge dependencies (ByteBuddy)
configurations = [project.configurations.runtimeClasspath]
// Relocate to avoid conflicts in CPLS/COMET
relocate 'net.bytebuddy', 'comet.shaded.bytebuddy'
}
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)