Skip to content

Commit

Permalink
#314 Add jar build configuration
Browse files Browse the repository at this point in the history
The final jar needs to contain several files built by
and for Maven as it is required for Maven plugins.
  • Loading branch information
ascheman committed Jan 24, 2025
1 parent 1c0810b commit 19537cc
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions htmlSanityCheck-maven-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,30 @@ java {
withJavadocJar()
}

jar.configure {
dependsOn(generateMavenPlugin, "generatePomFileForMavenJavaPublication")
doFirst {
copy {
from('build/maven') {
include 'pom.properties'
}
into "build/classes/java/main/META-INF/maven/${project.group}/${project.name}"
}
copy {
from 'build/publications/mavenJava/pom-default.xml'
into "build/classes/java/main/META-INF/maven/${project.group}/${project.name}"
rename { 'pom.xml' }
}
copy {
from('build/maven/target/classes') {
include '**/*.xml'
exclude '**/*.class'
}
into 'build/classes/java/main'
}
}
}

publishing {
publications {
mavenJava(MavenPublication) {
Expand Down

0 comments on commit 19537cc

Please sign in to comment.