@@ -9,6 +9,15 @@ plugins {
99 id(" checkstyle" )
1010}
1111
12+ compileJava. options. encoding = " UTF-8"
13+ compileJava. options. compilerArgs + = ' -Xlint:unchecked'
14+ compileTestJava. options. encoding = " UTF-8"
15+
16+ repositories {
17+ // Use Maven Central for resolving dependencies.
18+ mavenCentral()
19+ }
20+
1221java {
1322 sourceCompatibility = ' 17'
1423 targetCompatibility = ' 17'
@@ -17,6 +26,21 @@ java {
1726 withJavadocJar()
1827}
1928
29+ model {
30+ tasks. generatePomFileForMavenPublication {
31+ destination = file(" $buildDir /pom.xml" )
32+ }
33+ }
34+
35+ jar {
36+ dependsOn(" :generatePomFileForMavenPublication" )
37+ archiveBaseName = " ${ artifactId} "
38+
39+ into(" META-INF/maven/io.github.open-policy-agent/opa" ) {
40+ from(" $buildDir /pom.xml" )
41+ }
42+ }
43+
2044configurations {
2145 compileOnly {
2246 extendsFrom annotationProcessor
@@ -31,10 +55,6 @@ tasks.named("jar") {
3155 archiveClassifier = ' '
3256}
3357
34- repositories {
35- mavenCentral()
36- }
37-
3858javadoc {
3959 options. addBooleanOption(" Xdoclint:-missing" , true )
4060 options. links + = [
@@ -101,6 +121,7 @@ test {
101121 // events "passed", "skipped", "failed", "standard_out", "standard_error"
102122 }
103123}
124+
104125tasks. register(" testModifiedSystemEnvProperties" , Test ) {
105126 useJUnitPlatform()
106127 group = " verification"
@@ -114,6 +135,7 @@ tasks.register("testModifiedSystemEnvProperties", Test) {
114135 environment. remove(' OPA_PATH' )
115136 }
116137}
138+
117139test. finalizedBy(testModifiedSystemEnvProperties)
118140
119141gradle. projectsEvaluated {
0 commit comments