-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
[Java][microprofile] generate a Gradle build #24291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,149 @@ | ||||||||
| apply plugin: 'idea' | ||||||||
| apply plugin: 'eclipse' | ||||||||
| apply plugin: 'java' | ||||||||
| apply plugin: 'maven-publish' | ||||||||
|
|
||||||||
| group = '{{groupId}}' | ||||||||
| version = '{{artifactVersion}}' | ||||||||
|
|
||||||||
| repositories { | ||||||||
| mavenCentral() | ||||||||
| } | ||||||||
|
|
||||||||
| {{#java17}} | ||||||||
| sourceCompatibility = JavaVersion.VERSION_17 | ||||||||
| targetCompatibility = JavaVersion.VERSION_17 | ||||||||
| {{/java17}} | ||||||||
| {{^java17}} | ||||||||
| {{#microprofile3}} | ||||||||
| sourceCompatibility = JavaVersion.VERSION_11 | ||||||||
| targetCompatibility = JavaVersion.VERSION_11 | ||||||||
| {{/microprofile3}} | ||||||||
| {{^microprofile3}} | ||||||||
| sourceCompatibility = JavaVersion.VERSION_1_8 | ||||||||
| targetCompatibility = JavaVersion.VERSION_1_8 | ||||||||
| {{/microprofile3}} | ||||||||
| {{/java17}} | ||||||||
|
|
||||||||
| publishing { | ||||||||
| publications { | ||||||||
| maven(MavenPublication) { | ||||||||
| artifactId = '{{artifactId}}' | ||||||||
| from components.java | ||||||||
| } | ||||||||
| } | ||||||||
| } | ||||||||
|
|
||||||||
| task execute(type:JavaExec) { | ||||||||
| mainClass = System.getProperty('mainClass') | ||||||||
| classpath = sourceSets.main.runtimeClasspath | ||||||||
| } | ||||||||
|
|
||||||||
| task sourcesJar(type: Jar, dependsOn: classes) { | ||||||||
| archiveClassifier = 'sources' | ||||||||
| from sourceSets.main.allSource | ||||||||
| } | ||||||||
|
|
||||||||
| task javadocJar(type: Jar, dependsOn: javadoc) { | ||||||||
| archiveClassifier = 'javadoc' | ||||||||
| from javadoc.destinationDir | ||||||||
| } | ||||||||
|
|
||||||||
| artifacts { | ||||||||
| archives sourcesJar | ||||||||
| archives javadocJar | ||||||||
| } | ||||||||
|
|
||||||||
| ext { | ||||||||
| microprofile_rest_client_api_version = "{{microprofileRestClientVersion}}" | ||||||||
| {{#useBeanValidation}} | ||||||||
| {{#microprofile3}} | ||||||||
| beanvalidation_version = "3.0.1" | ||||||||
| {{/microprofile3}} | ||||||||
| {{^microprofile3}} | ||||||||
| beanvalidation_version = "3.0.2" | ||||||||
| {{/microprofile3}} | ||||||||
| {{/useBeanValidation}} | ||||||||
| {{#useBeanValidationFeature}} | ||||||||
| hibernate_validator_version = "{{#microprofile3}}8.0.3.Final{{/microprofile3}}{{^microprofile3}}5.2.2.Final{{/microprofile3}}" | ||||||||
| {{/useBeanValidationFeature}} | ||||||||
| jackson_jaxrs_version = "2.17.1" | ||||||||
| {{#jackson}} | ||||||||
| jackson_version = "2.17.1" | ||||||||
| {{/jackson}} | ||||||||
| {{#microprofile3}} | ||||||||
| jakarta_activation_version = "2.1.0" | ||||||||
| jakarta_annotation_version = "2.0.0" | ||||||||
| jakarta_json_bind_version = "3.0.0" | ||||||||
| jakarta_json_version = "2.0.1" | ||||||||
| jakarta_ws_rs_version = "3.0.0" | ||||||||
| jakarta_xml_bind_version = "3.0.1" | ||||||||
| jaxb_version = "3.0.2" | ||||||||
| {{/microprofile3}} | ||||||||
| {{^microprofile3}} | ||||||||
| jakarta_activation_version = "1.2.2" | ||||||||
| jakarta_annotation_version = "1.3.5" | ||||||||
| jakarta_json_bind_version = "1.0.2" | ||||||||
| jakarta_json_version = "1.1.6" | ||||||||
| jakarta_ws_rs_version = "2.1.6" | ||||||||
| jakarta_xml_bind_version = "2.3.3" | ||||||||
| jaxb_version = "2.2.11" | ||||||||
| {{/microprofile3}} | ||||||||
| {{#microprofileMutiny}} | ||||||||
| mutiny_version = "1.10.0" | ||||||||
| {{/microprofileMutiny}} | ||||||||
| {{#useReflectionEqualsHashCode}} | ||||||||
| commons_lang3_version = "3.17.0" | ||||||||
| {{/useReflectionEqualsHashCode}} | ||||||||
| junit_version = "5.10.2" | ||||||||
| } | ||||||||
|
|
||||||||
| dependencies { | ||||||||
| // Eclipse MicroProfile Rest Client | ||||||||
| implementation "org.eclipse.microprofile.rest.client:microprofile-rest-client-api:$microprofile_rest_client_api_version" | ||||||||
|
|
||||||||
| // JAX-RS | ||||||||
| compileOnly "jakarta.ws.rs:jakarta.ws.rs-api:$jakarta_ws_rs_version" | ||||||||
|
|
||||||||
| compileOnly "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" | ||||||||
| {{#useBeanValidation}} | ||||||||
| // Bean Validation API support | ||||||||
| compileOnly "jakarta.validation:jakarta.validation-api:$beanvalidation_version" | ||||||||
| {{/useBeanValidation}} | ||||||||
| {{#useBeanValidationFeature}} | ||||||||
| implementation "org.hibernate{{#microprofile3}}.validator{{/microprofile3}}:hibernate-validator:$hibernate_validator_version" | ||||||||
| {{/useBeanValidationFeature}} | ||||||||
| {{#jsonb}} | ||||||||
| implementation "jakarta.json.bind:jakarta.json.bind-api:$jakarta_json_bind_version" | ||||||||
| implementation "jakarta.json:jakarta.json-api:$jakarta_json_version" | ||||||||
| implementation "jakarta.xml.bind:jakarta.xml.bind-api:$jakarta_xml_bind_version" | ||||||||
| implementation "com.sun.xml.bind:jaxb-core:$jaxb_version" | ||||||||
| implementation "com.sun.xml.bind:jaxb-impl:$jaxb_version" | ||||||||
| {{/jsonb}} | ||||||||
| {{#jackson}} | ||||||||
| // JSON processing: jackson | ||||||||
| implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" | ||||||||
| implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" | ||||||||
| implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_version" | ||||||||
| {{#withXml}} | ||||||||
| // XML processing with Jackson | ||||||||
| implementation "jakarta.xml.bind:jakarta.xml.bind-api:$jakarta_xml_bind_version" | ||||||||
| implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jackson_version" | ||||||||
| {{/withXml}} | ||||||||
| {{/jackson}} | ||||||||
| implementation "jakarta.activation:jakarta.activation-api:$jakarta_activation_version" | ||||||||
| implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_jaxrs_version" | ||||||||
| {{#microprofileMutiny}} | ||||||||
| implementation "io.smallrye.reactive:mutiny:$mutiny_version" | ||||||||
| {{/microprofileMutiny}} | ||||||||
| {{#useReflectionEqualsHashCode}} | ||||||||
| // For equals and hashCode using reflection | ||||||||
| implementation "org.apache.commons:commons-lang3:$commons_lang3_version" | ||||||||
| {{/useReflectionEqualsHashCode}} | ||||||||
|
|
||||||||
| testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Generated JUnit tests have no Jupiter engine at runtime, so Gradle cannot execute them under Prompt for AI agents
Suggested change
|
||||||||
| } | ||||||||
|
|
||||||||
| test { | ||||||||
| useJUnitPlatform() | ||||||||
| } | ||||||||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,79 @@ | ||||||||
| apply plugin: 'idea' | ||||||||
| apply plugin: 'eclipse' | ||||||||
| apply plugin: 'java' | ||||||||
| apply plugin: 'maven-publish' | ||||||||
|
|
||||||||
| group = 'org.openapitools' | ||||||||
| version = '1.0.0' | ||||||||
|
|
||||||||
| repositories { | ||||||||
| mavenCentral() | ||||||||
| } | ||||||||
|
|
||||||||
| sourceCompatibility = JavaVersion.VERSION_11 | ||||||||
| targetCompatibility = JavaVersion.VERSION_11 | ||||||||
|
|
||||||||
| publishing { | ||||||||
| publications { | ||||||||
| maven(MavenPublication) { | ||||||||
| artifactId = 'microprofile-oneof-interface' | ||||||||
| from components.java | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: The Gradle artifact omits the Jandex index Maven builds produce, so Quarkus consumers will not automatically scan this dependency and Prompt for AI agents |
||||||||
| } | ||||||||
| } | ||||||||
| } | ||||||||
|
|
||||||||
| task execute(type:JavaExec) { | ||||||||
| mainClass = System.getProperty('mainClass') | ||||||||
| classpath = sourceSets.main.runtimeClasspath | ||||||||
| } | ||||||||
|
|
||||||||
| task sourcesJar(type: Jar, dependsOn: classes) { | ||||||||
| archiveClassifier = 'sources' | ||||||||
| from sourceSets.main.allSource | ||||||||
| } | ||||||||
|
|
||||||||
| task javadocJar(type: Jar, dependsOn: javadoc) { | ||||||||
| archiveClassifier = 'javadoc' | ||||||||
| from javadoc.destinationDir | ||||||||
| } | ||||||||
|
|
||||||||
| artifacts { | ||||||||
| archives sourcesJar | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3: Prompt for AI agents |
||||||||
| archives javadocJar | ||||||||
| } | ||||||||
|
|
||||||||
| ext { | ||||||||
| microprofile_rest_client_api_version = "3.0" | ||||||||
| jackson_jaxrs_version = "2.17.1" | ||||||||
| jackson_version = "2.17.1" | ||||||||
| jakarta_activation_version = "2.1.0" | ||||||||
| jakarta_annotation_version = "2.0.0" | ||||||||
| jakarta_json_bind_version = "3.0.0" | ||||||||
| jakarta_json_version = "2.0.1" | ||||||||
| jakarta_ws_rs_version = "3.0.0" | ||||||||
| jakarta_xml_bind_version = "3.0.1" | ||||||||
| jaxb_version = "3.0.2" | ||||||||
| junit_version = "5.10.2" | ||||||||
| } | ||||||||
|
|
||||||||
| dependencies { | ||||||||
| // Eclipse MicroProfile Rest Client | ||||||||
| implementation "org.eclipse.microprofile.rest.client:microprofile-rest-client-api:$microprofile_rest_client_api_version" | ||||||||
|
|
||||||||
| // JAX-RS | ||||||||
| compileOnly "jakarta.ws.rs:jakarta.ws.rs-api:$jakarta_ws_rs_version" | ||||||||
|
|
||||||||
| compileOnly "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" | ||||||||
| // JSON processing: jackson | ||||||||
| implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" | ||||||||
| implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" | ||||||||
| implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_version" | ||||||||
| implementation "jakarta.activation:jakarta.activation-api:$jakarta_activation_version" | ||||||||
| implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_jaxrs_version" | ||||||||
|
|
||||||||
| testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Prompt for AI agents
Suggested change
|
||||||||
| } | ||||||||
|
|
||||||||
| test { | ||||||||
| useJUnitPlatform() | ||||||||
| } | ||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). | ||
| # To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. | ||
| # | ||
| # Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties | ||
| # For example, uncomment below to build for Android | ||
| #target = android |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| distributionBase=GRADLE_USER_HOME | ||
| distributionPath=wrapper/dists | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip | ||
| networkTimeout=10000 | ||
| validateDistributionUrl=true | ||
| zipStoreBase=GRADLE_USER_HOME | ||
| zipStorePath=wrapper/dists |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P1: MicroProfile 1.x/2.0 clients with
useBeanValidation=truefail compilation: generated sources importjavax.validation, but this dependency resolves Bean Validation 3 underjakarta.validation. Select the javax Validation API for the non-microprofile3branch.Prompt for AI agents