This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch gradle in repository https://gitbox.apache.org/repos/asf/camel.git
commit ca4badfdf660e8cd7926a8815cf6b06a948cc154 Author: Claus Ibsen <[email protected]> AuthorDate: Sat Feb 28 09:22:32 2026 +0100 CAMEL-22801: camel-jbang - Remove deprecated export to gradle --- .../ROOT/pages/camel-4x-upgrade-guide-4_19.adoc | 13 +- .../modules/ROOT/pages/camel-jbang.adoc | 33 +--- .../camel-jbang-dependency-copy.adoc | 4 +- .../camel-jbang-dependency-list.adoc | 4 +- .../camel-jbang-dependency-update.adoc | 4 +- .../pages/jbang-commands/camel-jbang-export.adoc | 4 +- .../pages/jbang-commands/camel-jbang-sbom.adoc | 4 +- .../META-INF/camel-jbang-commands-metadata.json | 6 +- .../camel-jbang-configuration-metadata.json | 2 - .../camel/dsl/jbang/core/commands/Export.java | 7 - .../dsl/jbang/core/commands/ExportBaseCommand.java | 41 +---- .../dsl/jbang/core/commands/ExportCamelMain.java | 18 +- .../dsl/jbang/core/commands/ExportQuarkus.java | 139 +--------------- .../dsl/jbang/core/commands/ExportSpringBoot.java | 111 +------------ .../apache/camel/dsl/jbang/core/commands/Run.java | 8 +- .../camel/dsl/jbang/core/commands/RunHelper.java | 2 +- .../dsl/jbang/core/common/CamelJBangConstants.java | 8 - .../resources/gradle-wrapper/gradle-wrapper.jar | Bin 58910 -> 0 bytes .../gradle-wrapper/gradle-wrapper.properties | 21 --- .../src/main/resources/gradle-wrapper/gradlew | 185 --------------------- .../src/main/resources/gradle-wrapper/gradlew.bat | 104 ------------ .../resources/templates/quarkus-build-gradle.tmpl | 39 ----- .../templates/quarkus-gradle-properties.tmpl | 6 - .../templates/quarkus-settings-gradle.tmpl | 11 -- .../templates/spring-boot-build-gradle.tmpl | 31 ---- 25 files changed, 39 insertions(+), 766 deletions(-) diff --git a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_19.adoc b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_19.adoc index 6545038b6f4c..f05528b0cb61 100644 --- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_19.adoc +++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_19.adoc @@ -171,10 +171,6 @@ Should be changed to have semicolons as shown below: orderId=$sku,total=$sum ---- -=== camel-json-patch - -The `camel-json-patch` is now deprecated - the library it uses is not active maintained and this module does not work with Jackon 3. - === camel-test-infra The test infrastructure modules no longer produce `test-jar` artifacts. All classes (service interfaces, @@ -220,6 +216,11 @@ commonly used at in the top. EIPs such as `circuitBreaker` now has `onFallback` This order is also the same order that UI builders like Camel Karavan and Kaoto do as well. +=== camel-jbang + +Support for exporting to use Gradle as build tool has been removed (it was deprecated and not working well) +The deprecated options `buildToool` and `gradleWrapper` has been removed. + === camel-kafka The Kafka client library has been upgraded from 3.9.1 to 4.2.0. This is a major version upgrade of Apache Kafka with several notable changes: @@ -241,6 +242,10 @@ Google recommends migrating your Pub/Sub Lite workloads to either: * **Google Cloud Pub/Sub** → use the `camel-google-pubsub` component * **Google Cloud Managed Service for Apache Kafka** → use the `camel-kafka` component +=== camel-json-patch + +The `camel-json-patch` is now deprecated - the library it uses is not active maintained and this module does not work with Jackon 3. + === camel-mail When configured a custom `IdempotentRepository` on `camel-mail` endpoint, then Camel will now auto-start diff --git a/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc b/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc index ae2d6fb3cc60..f8337ba60480 100644 --- a/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc +++ b/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc @@ -234,10 +234,10 @@ camel run * TIP: The run goal can also detect files that are `properties`, such as `application.properties`. -=== Running a Maven or Gradle based project +=== Running a Maven based project Camel JBang is intended for flat-file-based projects, where you run small integrations. -However, Camel JBang may be used as a tool for migrating existing Maven or Gradle based projects. +However, Camel JBang may be used as a tool for migrating existing Maven based projects. To make the migration easier, then JBang can do _best effort_ to run, export, or transform these projects. For example, if you have a Maven-based project, you can execute @@ -247,13 +247,6 @@ For example, if you have a Maven-based project, you can execute camel run pom.xml ---- -or for a Gradle project - -[source,bash] ----- -camel run build.gradle ----- - Camel JBang will then scan in `src/main/java` and `src/main/resources` for files to include (recursive). NOTE: Using `camel run pom.xml` is not intended as a fully compatible way of running an existing Maven-based project. It cannot start Quarkus or Spring Boot applications; instead, use the proper plugins/commands. The command is mainly used to migrate from old projects. @@ -2218,7 +2211,7 @@ The plugin uses the capabilities of the Open Source test framework https://citru The automated test is able to prepare required infrastructure (e.g. PostgreSQL database, Kafka message broker) using containers and Camel infra services. Also, the test is able to automatically start the Camel integration locally with Camel JBang. Following from that the test is able to invoke exposed services of the Camel integration and verify its outcome. Once the prototyping phase with Camel JBang is complete you can include the automated tests into the project export. -Usually, the export creates a Maven/Gradle project on top of Quarkus or SpringBoot and the automated tests become part of this project, so the tests are run with the project build lifecycle. +Usually, the export creates a Maven project on top of Quarkus or SpringBoot and the automated tests become part of this project, so the tests are run with the project build lifecycle. Read about the plugin in the xref:camel-jbang-test.adoc[Camel Testing plugin] documentation. @@ -3796,7 +3789,7 @@ See the https://github.com/apache/camel-kamelets-examples/tree/main/jbang/open-a == Gathering list of dependencies When working with Camel JBang, then dependencies are automatically resolved. This means that -you do not have to use a build system like Maven or Gradle to add every Camel component +you do not have to use a build system like Maven to add every Camel component as a dependency. However, you may want to know what dependencies are required to run the Camel integration. @@ -3984,7 +3977,7 @@ To export to another directory (copies the files), you execute: camel export --runtime=spring-boot --gav=com.foo:acme:1.0-SNAPSHOT --directory=../myproject ---- -When exporting to Spring Boot then the Camel version defined in the `pom.xml` or `build.gradle` is +When exporting to Spring Boot then the Camel version defined in the `pom.xml` is the same version as Camel JBang uses. However, you can specify the Camel version as shown below: [source,bash] @@ -4099,16 +4092,6 @@ As you can see the first export command will only include `Foo.java`, and then 2 NOTE: If you have `application.properties` in the folder as well, then this will be included in both exports. -=== Exporting as Gradle Project - -Camel JBang exports by default as a Maven-based project. To use Gradle instead, you can -specify the `--build-tool=gradle` when exporting, such as: - -[source,bash] ----- -camel export --build-tool=gradle --runtime=spring-boot --gav=com.foo:acme:1.0-SNAPSHOT --directory=../myproject ----- - === Exporting with JMX management included Usually when exporting to Spring Boot, Quarkus or Camel Main, then JMX management is not included out of the box. @@ -4149,12 +4132,11 @@ The follow options related to _exporting_ or _running_, can be configured in `ap // jbang options: START === Camel JBang configurations -The camel.jbang supports 47 options, which are listed below. +The camel.jbang supports 45 options, which are listed below. [width="100%",cols="2,5,^1,2",options="header"] |=== | Name | Description | Default | Type -| *camel.jbang.buildTool* | Build tool to use (Maven or Gradle) | Maven | String | *camel.jbang.camel-version* | The version of Apache Camel to use | | String | *camel.jbang.camelSpringBoot{zwsp}Version* | To use a custom Camel version when running or export to Spring Boot | | String | *camel.jbang.classpathFiles* | Additional files to add to classpath (Use commas to separate multiple files). | | String @@ -4168,7 +4150,6 @@ The camel.jbang supports 47 options, which are listed below. | *camel.jbang.excludes* | Exclude files by name or pattern (Use commas to separate multiple files) | | String | *camel.jbang.exportDir* | Directory where the project will be exported | . | String | *camel.jbang.gav* | Maven coordinate (groupId:artifactId:version) | | String -| *camel.jbang.gradleWrapper* | Include Gradle Wrapper files in the exported project | true | boolean | *camel.jbang.groovyFiles* | Additional groovy source files to export to src/main/resources/camel-groovy directory (Use commas to separate multiple files) | | String | *camel.jbang.health* | Health check at /observe/health on local HTTP server (port 8080 by default) | false | boolean | *camel.jbang.ignoreLoadingError* | Whether to ignore route loading and compilation errors (use this with care!) | false | boolean @@ -4343,7 +4324,7 @@ IMPORTANT: This feature is only intended to include smaller groovy sources as sm that makes it easier to use together with Camel for low-code integrations. It is not intended to support Groovy as a general purpose programming language for Camel. For this kind then you can use groovy and Java together and follow best practices for this, such as -using the joint-compilation via Maven / Gradle plugins during build. +using the joint-compilation via Maven plugins during build. == Troubleshooting diff --git a/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-dependency-copy.adoc b/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-dependency-copy.adoc index d0d3a850f05e..9d7b3e80d7d2 100644 --- a/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-dependency-copy.adoc +++ b/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-dependency-copy.adoc @@ -19,8 +19,7 @@ camel dependency copy [options] [cols="2,5,1,2",options="header"] |=== | Option | Description | Default | Type -| `--build-property` | Maven/Gradle build properties, ex. --build-property=prop1=foo | | List -| `--build-tool` _(deprecated)_ | DEPRECATED: Build tool to use (maven or gradle) (gradle is deprecated) | maven | String +| `--build-property` | Maven build properties, ex. --build-property=prop1=foo | | List | `--camel-spring-boot-version` | Camel version to use with Spring Boot | | String | `--camel-version` | To export using a different Camel version than the default version. | | String | `--clean-dir` | If exporting to current directory (default) then all existing files are preserved. Enabling this option will force cleaning current directory including all sub dirs (use this with care) | false | boolean @@ -30,7 +29,6 @@ camel dependency copy [options] | `--exclude` | Exclude files by name or pattern | | List | `--fresh` | Make sure we use fresh (i.e. non-cached) resources | false | boolean | `--gav` | The Maven group:artifact:version | | String -| `--gradle-wrapper` _(deprecated)_ | DEPRECATED: Include Gradle Wrapper files in exported project | true | boolean | `--groovy-pre-compiled` | Whether to include pre-compiled Groovy classes in the export (only supported with runtime=camel-main) | false | boolean | `--hawtio` | Whether to include Hawtio web console (only available for exporting to Spring Boot or Quarkus) | false | boolean | `--hawtio-version` | Version of the Hawtio web console | HawtioVersion.HAWTIO_VERSION | String diff --git a/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-dependency-list.adoc b/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-dependency-list.adoc index cd7e75dda8f9..2f5bcdbcf93f 100644 --- a/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-dependency-list.adoc +++ b/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-dependency-list.adoc @@ -19,8 +19,7 @@ camel dependency list [options] [cols="2,5,1,2",options="header"] |=== | Option | Description | Default | Type -| `--build-property` | Maven/Gradle build properties, ex. --build-property=prop1=foo | | List -| `--build-tool` _(deprecated)_ | DEPRECATED: Build tool to use (maven or gradle) (gradle is deprecated) | maven | String +| `--build-property` | Maven build properties, ex. --build-property=prop1=foo | | List | `--camel-spring-boot-version` | Camel version to use with Spring Boot | | String | `--camel-version` | To export using a different Camel version than the default version. | | String | `--clean-dir` | If exporting to current directory (default) then all existing files are preserved. Enabling this option will force cleaning current directory including all sub dirs (use this with care) | false | boolean @@ -30,7 +29,6 @@ camel dependency list [options] | `--exclude` | Exclude files by name or pattern | | List | `--fresh` | Make sure we use fresh (i.e. non-cached) resources | false | boolean | `--gav` | The Maven group:artifact:version | | String -| `--gradle-wrapper` _(deprecated)_ | DEPRECATED: Include Gradle Wrapper files in exported project | true | boolean | `--groovy-pre-compiled` | Whether to include pre-compiled Groovy classes in the export (only supported with runtime=camel-main) | false | boolean | `--hawtio` | Whether to include Hawtio web console (only available for exporting to Spring Boot or Quarkus) | false | boolean | `--hawtio-version` | Version of the Hawtio web console | HawtioVersion.HAWTIO_VERSION | String diff --git a/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-dependency-update.adoc b/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-dependency-update.adoc index bc004afa5d61..f90aa9e28f13 100644 --- a/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-dependency-update.adoc +++ b/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-dependency-update.adoc @@ -19,8 +19,7 @@ camel dependency update [options] [cols="2,5,1,2",options="header"] |=== | Option | Description | Default | Type -| `--build-property` | Maven/Gradle build properties, ex. --build-property=prop1=foo | | List -| `--build-tool` _(deprecated)_ | DEPRECATED: Build tool to use (maven or gradle) (gradle is deprecated) | maven | String +| `--build-property` | Maven build properties, ex. --build-property=prop1=foo | | List | `--camel-spring-boot-version` | Camel version to use with Spring Boot | | String | `--camel-version` | To export using a different Camel version than the default version. | | String | `--clean` | Regenerate list of dependencies (do not keep existing dependencies). Not supported for pom.xml | | boolean @@ -31,7 +30,6 @@ camel dependency update [options] | `--exclude` | Exclude files by name or pattern | | List | `--fresh` | Make sure we use fresh (i.e. non-cached) resources | false | boolean | `--gav` | The Maven group:artifact:version | | String -| `--gradle-wrapper` _(deprecated)_ | DEPRECATED: Include Gradle Wrapper files in exported project | true | boolean | `--groovy-pre-compiled` | Whether to include pre-compiled Groovy classes in the export (only supported with runtime=camel-main) | false | boolean | `--hawtio` | Whether to include Hawtio web console (only available for exporting to Spring Boot or Quarkus) | false | boolean | `--hawtio-version` | Version of the Hawtio web console | HawtioVersion.HAWTIO_VERSION | String diff --git a/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-export.adoc b/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-export.adoc index 23dbb66d6c15..516845c858c7 100644 --- a/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-export.adoc +++ b/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-export.adoc @@ -19,8 +19,7 @@ camel export [options] [cols="2,5,1,2",options="header"] |=== | Option | Description | Default | Type -| `--build-property` | Maven/Gradle build properties, ex. --build-property=prop1=foo | | List -| `--build-tool` _(deprecated)_ | DEPRECATED: Build tool to use (maven or gradle) (gradle is deprecated) | maven | String +| `--build-property` | Maven build properties, ex. --build-property=prop1=foo | | List | `--camel-spring-boot-version` | Camel version to use with Spring Boot | | String | `--camel-version` | To export using a different Camel version than the default version. | | String | `--clean-dir` | If exporting to current directory (default) then all existing files are preserved. Enabling this option will force cleaning current directory including all sub dirs (use this with care) | false | boolean @@ -30,7 +29,6 @@ camel export [options] | `--exclude` | Exclude files by name or pattern | | List | `--fresh` | Make sure we use fresh (i.e. non-cached) resources | false | boolean | `--gav` | The Maven group:artifact:version | | String -| `--gradle-wrapper` _(deprecated)_ | DEPRECATED: Include Gradle Wrapper files in exported project | true | boolean | `--groovy-pre-compiled` | Whether to include pre-compiled Groovy classes in the export (only supported with runtime=camel-main) | false | boolean | `--hawtio` | Whether to include Hawtio web console (only available for exporting to Spring Boot or Quarkus) | false | boolean | `--hawtio-version` | Version of the Hawtio web console | HawtioVersion.HAWTIO_VERSION | String diff --git a/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-sbom.adoc b/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-sbom.adoc index e82f8f7b9ae4..bb869a20c6bc 100644 --- a/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-sbom.adoc +++ b/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-sbom.adoc @@ -19,8 +19,7 @@ camel sbom [options] [cols="2,5,1,2",options="header"] |=== | Option | Description | Default | Type -| `--build-property` | Maven/Gradle build properties, ex. --build-property=prop1=foo | | List -| `--build-tool` _(deprecated)_ | DEPRECATED: Build tool to use (maven or gradle) (gradle is deprecated) | maven | String +| `--build-property` | Maven build properties, ex. --build-property=prop1=foo | | List | `--camel-spring-boot-version` | Camel version to use with Spring Boot | | String | `--camel-version` | To export using a different Camel version than the default version. | | String | `--clean-dir` | If exporting to current directory (default) then all existing files are preserved. Enabling this option will force cleaning current directory including all sub dirs (use this with care) | false | boolean @@ -31,7 +30,6 @@ camel sbom [options] | `--exclude` | Exclude files by name or pattern | | List | `--fresh` | Make sure we use fresh (i.e. non-cached) resources | false | boolean | `--gav` | The Maven group:artifact:version | | String -| `--gradle-wrapper` _(deprecated)_ | DEPRECATED: Include Gradle Wrapper files in exported project | true | boolean | `--groovy-pre-compiled` | Whether to include pre-compiled Groovy classes in the export (only supported with runtime=camel-main) | false | boolean | `--hawtio` | Whether to include Hawtio web console (only available for exporting to Spring Boot or Quarkus) | false | boolean | `--hawtio-version` | Version of the Hawtio web console | HawtioVersion.HAWTIO_VERSION | String diff --git a/dsl/camel-jbang/camel-jbang-core/src/generated/resources/META-INF/camel-jbang-commands-metadata.json b/dsl/camel-jbang/camel-jbang-core/src/generated/resources/META-INF/camel-jbang-commands-metadata.json index 040138e6926b..5af741efc0b4 100644 --- a/dsl/camel-jbang/camel-jbang-core/src/generated/resources/META-INF/camel-jbang-commands-metadata.json +++ b/dsl/camel-jbang/camel-jbang-core/src/generated/resources/META-INF/camel-jbang-commands-metadata.json @@ -6,12 +6,12 @@ { "name": "completion", "fullName": "completion", "description": "Generate completion script for bash\/zsh", "sourceClass": "org.apache.camel.dsl.jbang.core.commands.Complete", "options": [ { "names": "-h,--help", "description": "Display the help and sub-commands", "javaType": "boolean", "type": "boolean" } ] }, { "name": "config", "fullName": "config", "description": "Get and set user configuration values", "sourceClass": "org.apache.camel.dsl.jbang.core.commands.config.ConfigCommand", "options": [ { "names": "-h,--help", "description": "Display the help and sub-commands", "javaType": "boolean", "type": "boolean" } ], "subcommands": [ { "name": "get", "fullName": "config get", "description": "Display user configuration value", "sourceClass": "org.apache.camel.dsl.jbang.core.commands.config. [...] { "name": "debug", "fullName": "debug", "description": "Debug local Camel integration", "sourceClass": "org.apache.camel.dsl.jbang.core.commands.Debug", "options": [ { "names": "--ago", "description": "Use ago instead of yyyy-MM-dd HH:mm:ss in timestamp.", "javaType": "boolean", "type": "boolean" }, { "names": "--background", "description": "Run in the background", "defaultValue": "false", "javaType": "boolean", "type": "boolean" }, { "names": "--background-wait", "description": "To [...] - { "name": "dependency", "fullName": "dependency", "description": "Displays all Camel dependencies required to run", "sourceClass": "org.apache.camel.dsl.jbang.core.commands.DependencyCommand", "options": [ { "names": "-h,--help", "description": "Display the help and sub-commands", "javaType": "boolean", "type": "boolean" } ], "subcommands": [ { "name": "copy", "fullName": "dependency copy", "description": "Copies all Camel dependencies required to run to a specific directory", "sourc [...] + { "name": "dependency", "fullName": "dependency", "description": "Displays all Camel dependencies required to run", "sourceClass": "org.apache.camel.dsl.jbang.core.commands.DependencyCommand", "options": [ { "names": "-h,--help", "description": "Display the help and sub-commands", "javaType": "boolean", "type": "boolean" } ], "subcommands": [ { "name": "copy", "fullName": "dependency copy", "description": "Copies all Camel dependencies required to run to a specific directory", "sourc [...] { "name": "dirty", "fullName": "dirty", "description": "Check if there are dirty files from previous Camel runs that did not terminate gracefully", "sourceClass": "org.apache.camel.dsl.jbang.core.commands.process.Dirty", "options": [ { "names": "--clean", "description": "Clean dirty files which are no longer in use", "defaultValue": "false", "javaType": "boolean", "type": "boolean" }, { "names": "-h,--help", "description": "Display the help and sub-commands", "javaType": "boolean", " [...] { "name": "doc", "fullName": "doc", "description": "Shows documentation for kamelet, component, and other Camel resources", "sourceClass": "org.apache.camel.dsl.jbang.core.commands.catalog.CatalogDoc", "options": [ { "names": "--camel-version", "description": "To use a different Camel version than the default version", "javaType": "java.lang.String", "type": "string" }, { "names": "--download", "description": "Whether to allow automatic downloading JAR dependencies (over the internet [...] { "name": "eval", "fullName": "eval", "description": "Evaluate Camel expressions and scripts", "sourceClass": "org.apache.camel.dsl.jbang.core.commands.EvalCommand", "options": [ { "names": "-h,--help", "description": "Display the help and sub-commands", "javaType": "boolean", "type": "boolean" } ], "subcommands": [ { "name": "expression", "fullName": "eval expression", "description": "Evaluates Camel expression", "sourceClass": "org.apache.camel.dsl.jbang.core.commands.action.EvalEx [...] { "name": "explain", "fullName": "explain", "description": "Explain what a Camel route does using AI\/LLM", "sourceClass": "org.apache.camel.dsl.jbang.core.commands.Explain", "options": [ { "names": "--api-key", "description": "API key for authentication. Also reads OPENAI_API_KEY or LLM_API_KEY env vars", "javaType": "java.lang.String", "type": "string" }, { "names": "--api-type", "description": "API type: 'ollama' or 'openai' (OpenAI-compatible)", "defaultValue": "ollama", "javaTyp [...] - { "name": "export", "fullName": "export", "description": "Export to other runtimes (Camel Main, Spring Boot, or Quarkus)", "sourceClass": "org.apache.camel.dsl.jbang.core.commands.Export", "options": [ { "names": "--build-property", "description": "Maven\/Gradle build properties, ex. --build-property=prop1=foo", "javaType": "java.util.List", "type": "array" }, { "names": "--build-tool", "description": "DEPRECATED: Build tool to use (maven or gradle) (gradle is deprecated)", "defaultV [...] + { "name": "export", "fullName": "export", "description": "Export to other runtimes (Camel Main, Spring Boot, or Quarkus)", "sourceClass": "org.apache.camel.dsl.jbang.core.commands.Export", "options": [ { "names": "--build-property", "description": "Maven build properties, ex. --build-property=prop1=foo", "javaType": "java.util.List", "type": "array" }, { "names": "--camel-spring-boot-version", "description": "Camel version to use with Spring Boot", "javaType": "java.lang.String", "ty [...] { "name": "get", "fullName": "get", "description": "Get status of Camel integrations", "sourceClass": "org.apache.camel.dsl.jbang.core.commands.process.CamelStatus", "options": [ { "names": "--watch", "description": "Execute periodically and showing output fullscreen", "javaType": "boolean", "type": "boolean" }, { "names": "-h,--help", "description": "Display the help and sub-commands", "javaType": "boolean", "type": "boolean" } ], "subcommands": [ { "name": "bean", "fullName": "get [...] { "name": "harden", "fullName": "harden", "description": "Suggest security hardening for Camel routes using AI\/LLM", "sourceClass": "org.apache.camel.dsl.jbang.core.commands.Harden", "options": [ { "names": "--api-key", "description": "API key for authentication. Also reads OPENAI_API_KEY or LLM_API_KEY env vars", "javaType": "java.lang.String", "type": "string" }, { "names": "--api-type", "description": "API type: 'ollama' or 'openai' (OpenAI-compatible)", "defaultValue": "ollama", [...] { "name": "hawtio", "fullName": "hawtio", "description": "Launch Hawtio web console", "sourceClass": "org.apache.camel.dsl.jbang.core.commands.process.Hawtio", "options": [ { "names": "--openUrl", "description": "To automatic open Hawtio web console in the web browser", "defaultValue": "true", "javaType": "boolean", "type": "boolean" }, { "names": "--port", "description": "Port number to use for Hawtio web console (port 8888 by default)", "defaultValue": "8888", "javaType": "int", "t [...] @@ -23,7 +23,7 @@ { "name": "plugin", "fullName": "plugin", "description": "Manage plugins that add sub-commands to this CLI", "sourceClass": "org.apache.camel.dsl.jbang.core.commands.plugin.PluginCommand", "options": [ { "names": "-h,--help", "description": "Display the help and sub-commands", "javaType": "boolean", "type": "boolean" } ], "subcommands": [ { "name": "add", "fullName": "plugin add", "description": "Add new plugin", "sourceClass": "org.apache.camel.dsl.jbang.core.commands.plugin.PluginA [...] { "name": "ps", "fullName": "ps", "description": "List running Camel integrations", "sourceClass": "org.apache.camel.dsl.jbang.core.commands.process.ListProcess", "options": [ { "names": "--json", "description": "Output in JSON Format", "javaType": "boolean", "type": "boolean" }, { "names": "--pid", "description": "List only pid in the output", "javaType": "boolean", "type": "boolean" }, { "names": "--remote", "description": "Break down counters into remote\/total pairs", "javaType": [...] { "name": "run", "fullName": "run", "description": "Run as local Camel integration", "sourceClass": "org.apache.camel.dsl.jbang.core.commands.Run", "options": [ { "names": "--background", "description": "Run in the background", "defaultValue": "false", "javaType": "boolean", "type": "boolean" }, { "names": "--background-wait", "description": "To wait for run in background to startup successfully, before returning", "defaultValue": "true", "javaType": "boolean", "type": "boolean" }, { [...] - { "name": "sbom", "fullName": "sbom", "description": "Generate a CycloneDX or SPDX SBOM for a specific project", "sourceClass": "org.apache.camel.dsl.jbang.core.commands.SBOMGenerator", "options": [ { "names": "--build-property", "description": "Maven\/Gradle build properties, ex. --build-property=prop1=foo", "javaType": "java.util.List", "type": "array" }, { "names": "--build-tool", "description": "DEPRECATED: Build tool to use (maven or gradle) (gradle is deprecated)", "defaultValu [...] + { "name": "sbom", "fullName": "sbom", "description": "Generate a CycloneDX or SPDX SBOM for a specific project", "sourceClass": "org.apache.camel.dsl.jbang.core.commands.SBOMGenerator", "options": [ { "names": "--build-property", "description": "Maven build properties, ex. --build-property=prop1=foo", "javaType": "java.util.List", "type": "array" }, { "names": "--camel-spring-boot-version", "description": "Camel version to use with Spring Boot", "javaType": "java.lang.String", "type" [...] { "name": "script", "fullName": "script", "description": "Run Camel integration as shell script for terminal scripting", "sourceClass": "org.apache.camel.dsl.jbang.core.commands.Script", "options": [ { "names": "--logging", "description": "Can be used to turn on logging (logs to file in <user home>\/.camel directory)", "defaultValue": "false", "javaType": "boolean", "type": "boolean" }, { "names": "--logging-level", "description": "Logging level ()", "defaultValue": "info", "javaType [...] { "name": "shell", "fullName": "shell", "description": "Interactive Camel JBang shell.", "sourceClass": "org.apache.camel.dsl.jbang.core.commands.Shell", "options": [ { "names": "-h,--help", "description": "Display the help and sub-commands", "javaType": "boolean", "type": "boolean" } ] }, { "name": "stop", "fullName": "stop", "description": "Shuts down running Camel integrations", "sourceClass": "org.apache.camel.dsl.jbang.core.commands.process.StopProcess", "options": [ { "names": "--kill", "description": "To force killing the process (SIGKILL)", "javaType": "boolean", "type": "boolean" }, { "names": "-h,--help", "description": "Display the help and sub-commands", "javaType": "boolean", "type": "boolean" } ] }, diff --git a/dsl/camel-jbang/camel-jbang-core/src/generated/resources/META-INF/camel-jbang-configuration-metadata.json b/dsl/camel-jbang/camel-jbang-core/src/generated/resources/META-INF/camel-jbang-configuration-metadata.json index 22ca438bb84d..01c0f4bbcdec 100644 --- a/dsl/camel-jbang/camel-jbang-core/src/generated/resources/META-INF/camel-jbang-configuration-metadata.json +++ b/dsl/camel-jbang/camel-jbang-core/src/generated/resources/META-INF/camel-jbang-configuration-metadata.json @@ -3,7 +3,6 @@ { "name": "camel.jbang", "description": "Camel JBang configurations" } ], "properties": [ - { "name": "camel.jbang.buildTool", "required": false, "description": "Build tool to use (Maven or Gradle)", "type": "string", "javaType": "String", "defaultValue": "Maven", "secret": false }, { "name": "camel.jbang.camel-version", "required": false, "description": "The version of Apache Camel to use", "type": "string", "javaType": "String", "secret": false }, { "name": "camel.jbang.camelSpringBootVersion", "required": false, "description": "To use a custom Camel version when running or export to Spring Boot", "label": "spring-boot", "type": "string", "javaType": "String", "secret": false }, { "name": "camel.jbang.classpathFiles", "required": false, "description": "Additional files to add to classpath (Use commas to separate multiple files).", "type": "string", "javaType": "String", "secret": false }, @@ -17,7 +16,6 @@ { "name": "camel.jbang.excludes", "required": false, "description": "Exclude files by name or pattern (Use commas to separate multiple files)", "type": "string", "javaType": "String", "secret": false }, { "name": "camel.jbang.exportDir", "required": false, "description": "Directory where the project will be exported", "type": "string", "javaType": "String", "defaultValue": ".", "secret": false }, { "name": "camel.jbang.gav", "required": false, "description": "Maven coordinate (groupId:artifactId:version)", "type": "string", "javaType": "String", "secret": false }, - { "name": "camel.jbang.gradleWrapper", "required": false, "description": "Include Gradle Wrapper files in the exported project", "type": "boolean", "javaType": "boolean", "defaultValue": true, "secret": false }, { "name": "camel.jbang.groovyFiles", "required": false, "description": "Additional groovy source files to export to src\/main\/resources\/camel-groovy directory (Use commas to separate multiple files)", "type": "string", "javaType": "String", "secret": false }, { "name": "camel.jbang.health", "required": false, "description": "Health check at \/observe\/health on local HTTP server (port 8080 by default)", "type": "boolean", "javaType": "boolean", "defaultValue": false, "secret": false, "deprecated": true }, { "name": "camel.jbang.ignoreLoadingError", "required": false, "description": "Whether to ignore route loading and compilation errors (use this with care!)", "label": "advanced", "type": "boolean", "javaType": "boolean", "defaultValue": false, "secret": false }, diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Export.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Export.java index 8f6e5a735374..7ac476c14e9b 100644 --- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Export.java +++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Export.java @@ -37,13 +37,11 @@ import org.apache.camel.util.FileUtil; import org.apache.camel.util.IOHelper; import picocli.CommandLine.Command; -import static org.apache.camel.dsl.jbang.core.common.CamelJBangConstants.BUILD_TOOL; import static org.apache.camel.dsl.jbang.core.common.CamelJBangConstants.CAMEL_SPRING_BOOT_VERSION; import static org.apache.camel.dsl.jbang.core.common.CamelJBangConstants.CAMEL_VERSION; import static org.apache.camel.dsl.jbang.core.common.CamelJBangConstants.EXCLUDES; import static org.apache.camel.dsl.jbang.core.common.CamelJBangConstants.EXPORT_DIR; import static org.apache.camel.dsl.jbang.core.common.CamelJBangConstants.GAV; -import static org.apache.camel.dsl.jbang.core.common.CamelJBangConstants.GRADLE_WRAPPER; import static org.apache.camel.dsl.jbang.core.common.CamelJBangConstants.JAVA_VERSION; import static org.apache.camel.dsl.jbang.core.common.CamelJBangConstants.KAMELETS_VERSION; import static org.apache.camel.dsl.jbang.core.common.CamelJBangConstants.LOCAL_KAMELET_DIR; @@ -186,10 +184,7 @@ public class Export extends ExportBaseCommand { this.springBootVersion = props.getProperty(SPRING_BOOT_VERSION, this.springBootVersion); this.mavenWrapper = "true".equals(props.getProperty(MAVEN_WRAPPER, this.mavenWrapper ? "true" : "false")); - this.gradleWrapper - = "true".equals(props.getProperty(GRADLE_WRAPPER, this.gradleWrapper ? "true" : "false")); this.exportDir = props.getProperty(EXPORT_DIR, this.exportDir); - this.buildTool = props.getProperty(BUILD_TOOL, this.buildTool); this.openapi = props.getProperty(OPEN_API, this.openapi); this.repositories = props.getProperty(REPOS, this.repositories); this.mavenSettings = props.getProperty(MAVEN_SETTINGS, this.mavenSettings); @@ -249,8 +244,6 @@ public class Export extends ExportBaseCommand { cmd.quarkusVersion = this.quarkusVersion; cmd.springBootVersion = this.springBootVersion; cmd.mavenWrapper = this.mavenWrapper; - cmd.gradleWrapper = this.gradleWrapper; - cmd.buildTool = this.buildTool; cmd.quiet = this.quiet; cmd.buildProperties = this.buildProperties; cmd.openapi = this.openapi; diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ExportBaseCommand.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ExportBaseCommand.java index cadd13b095a6..261bf91a6b8f 100644 --- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ExportBaseCommand.java +++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ExportBaseCommand.java @@ -203,16 +203,6 @@ public abstract class ExportBaseCommand extends CamelCommand { description = "Include Maven Wrapper files in exported project") protected boolean mavenWrapper = true; - @CommandLine.Option(names = { "--gradle-wrapper" }, defaultValue = "true", - description = "DEPRECATED: Include Gradle Wrapper files in exported project") - @Deprecated - protected boolean gradleWrapper = true; - - @CommandLine.Option(names = { "--build-tool" }, defaultValue = "maven", - description = "DEPRECATED: Build tool to use (maven or gradle) (gradle is deprecated)") - @Deprecated - protected String buildTool = "maven"; - @CommandLine.Option(names = { "--open-api" }, description = "Adds an OpenAPI spec from the given file (json or yaml file)") protected String openapi; @@ -250,7 +240,7 @@ public abstract class ExportBaseCommand extends CamelCommand { protected boolean packageScanJars; @CommandLine.Option(names = { "--build-property" }, - description = "Maven/Gradle build properties, ex. --build-property=prop1=foo") + description = "Maven build properties, ex. --build-property=prop1=foo") protected List<String> buildProperties = new ArrayList<>(); @CommandLine.Option(names = { "--prop", "--property" }, @@ -936,35 +926,6 @@ public abstract class ExportBaseCommand extends CamelCommand { FileUtil.setPosixFilePermissions(mvnwCmdPath, "rwxr-xr-x"); } - protected void copyGradleWrapper() throws Exception { - Path wrapperPath = Paths.get(BUILD_DIR, "gradle/wrapper"); - Files.createDirectories(wrapperPath); - // copy files - Path gradlewPath = Paths.get(BUILD_DIR, "gradlew"); - Path gradlewBatPath = Paths.get(BUILD_DIR, "gradlew.bat"); - Path wrapperJarPath = wrapperPath.resolve("gradle-wrapper.jar"); - Path wrapperPropsPath = wrapperPath.resolve("gradle-wrapper.properties"); - - try (InputStream is = ExportBaseCommand.class.getClassLoader().getResourceAsStream("gradle-wrapper/gradlew")) { - Files.copy(is, gradlewPath, StandardCopyOption.REPLACE_EXISTING); - } - try (InputStream is = ExportBaseCommand.class.getClassLoader().getResourceAsStream("gradle-wrapper/gradlew.bat")) { - Files.copy(is, gradlewBatPath, StandardCopyOption.REPLACE_EXISTING); - } - try (InputStream is - = ExportBaseCommand.class.getClassLoader().getResourceAsStream("gradle-wrapper/gradle-wrapper.jar")) { - Files.copy(is, wrapperJarPath, StandardCopyOption.REPLACE_EXISTING); - } - try (InputStream is - = ExportBaseCommand.class.getClassLoader().getResourceAsStream("gradle-wrapper/gradle-wrapper.properties")) { - Files.copy(is, wrapperPropsPath, StandardCopyOption.REPLACE_EXISTING); - } - - // set execute file permission on gradlew/gradlew.bat files - FileUtil.setPosixFilePermissions(gradlewPath, "rwxr-xr-x"); - FileUtil.setPosixFilePermissions(gradlewBatPath, "rwxr-xr-x"); - } - protected String applicationPropertyLine(String key, String value) { return key + "=" + value; } diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ExportCamelMain.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ExportCamelMain.java index a68728e1da25..0d9fe58cc3ec 100644 --- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ExportCamelMain.java +++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ExportCamelMain.java @@ -55,14 +55,6 @@ class ExportCamelMain extends Export { printer().printErr("--gav must be in syntax: groupId:artifactId:version"); return 1; } - if (!buildTool.equals("maven") && !buildTool.equals("gradle")) { - printer().printErr("--build-tool must either be maven or gradle, was: " + buildTool); - return 1; - } - if (buildTool.equals("gradle")) { - printer().printErr("--build-tool=gradle is not support yet for camel-main runtime."); - return 1; - } // the settings file has information what to export Path settings = CommandLineHelper.getWorkDir().resolve(Run.RUN_SETTINGS_FILE); @@ -163,12 +155,10 @@ class ExportCamelMain extends Export { // copy agent JARs and remove as dependency copyAgentDependencies(deps); deps.removeIf(d -> d.startsWith("agent:")); - if ("maven".equals(buildTool)) { - createMavenPom(settings, profile, - buildDir.resolve("pom.xml"), deps, srcPackageName); - if (mavenWrapper) { - copyMavenWrapper(); - } + createMavenPom(settings, profile, + buildDir.resolve("pom.xml"), deps, srcPackageName); + if (mavenWrapper) { + copyMavenWrapper(); } copyDockerFiles(BUILD_DIR); String appJar = Paths.get("target", ids[1] + "-" + ids[2] + ".jar").toString(); diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ExportQuarkus.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ExportQuarkus.java index 029ae2d7d4fd..bd3b4366ec51 100644 --- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ExportQuarkus.java +++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ExportQuarkus.java @@ -60,13 +60,6 @@ class ExportQuarkus extends Export { printer().printErr("--gav must be in syntax: groupId:artifactId:version"); return 1; } - if (!buildTool.equals("maven") && !buildTool.equals("gradle")) { - printer().printErr("--build-tool must either be maven or gradle, was: " + buildTool); - return 1; - } - if (buildTool.equals("gradle")) { - printer().println("WARN: --build-tool=gradle is deprecated."); - } exportBaseDir = exportBaseDir != null ? exportBaseDir : Path.of("."); Path profile = exportBaseDir.resolve("application.properties"); @@ -142,18 +135,9 @@ class ExportQuarkus extends Export { Set<String> deps = resolveDependencies(settings, profile); // copy local lib JARs copyLocalLibDependencies(deps); - if ("maven".equals(buildTool)) { - createMavenPom(settings, buildDir.resolve("pom.xml"), deps); - if (mavenWrapper) { - copyMavenWrapper(); - } - } else if ("gradle".equals(buildTool)) { - createGradleProperties(buildDir.resolve("gradle.properties")); - createSettingsGradle(buildDir.resolve("settings.gradle")); - createBuildGradle(settings, buildDir.resolve("build.gradle"), deps); - if (gradleWrapper) { - copyGradleWrapper(); - } + createMavenPom(settings, buildDir.resolve("pom.xml"), deps); + if (mavenWrapper) { + copyMavenWrapper(); } if (cleanExportDir || !exportDir.equals(".")) { @@ -243,123 +227,6 @@ class ExportQuarkus extends Export { return fileName; } - private void createGradleProperties(Path output) throws Exception { - InputStream is = ExportQuarkus.class.getClassLoader().getResourceAsStream("templates/quarkus-gradle-properties.tmpl"); - String context = IOHelper.loadText(is); - IOHelper.close(is); - - context = context.replaceFirst("\\{\\{ \\.QuarkusGroupId }}", quarkusGroupId); - context = context.replaceFirst("\\{\\{ \\.QuarkusArtifactId }}", quarkusArtifactId); - context = context.replaceAll("\\{\\{ \\.QuarkusVersion }}", quarkusVersion); - - Files.writeString(output, context); - } - - private void createSettingsGradle(Path output) throws Exception { - String[] ids = gav.split(":"); - - InputStream is = ExportQuarkus.class.getClassLoader().getResourceAsStream("templates/quarkus-settings-gradle.tmpl"); - String context = IOHelper.loadText(is); - IOHelper.close(is); - - context = context.replaceFirst("\\{\\{ \\.GroupId }}", ids[0]); - context = context.replaceFirst("\\{\\{ \\.ArtifactId }}", ids[1]); - context = context.replaceFirst("\\{\\{ \\.Version }}", ids[2]); - - Files.writeString(output, context); - } - - private void createBuildGradle(Path settings, Path gradleBuild, Set<String> deps) throws Exception { - String[] ids = gav.split(":"); - - InputStream is = ExportSpringBoot.class.getClassLoader().getResourceAsStream("templates/quarkus-build-gradle.tmpl"); - String context = IOHelper.loadText(is); - IOHelper.close(is); - - Properties prop = new CamelCaseOrderedProperties(); - RuntimeUtil.loadProperties(prop, settings.toFile()); - // quarkus controls the camel version - String repos = getMavenRepositories(settings, prop, quarkusVersion); - - CamelCatalog catalog = CatalogLoader.loadQuarkusCatalog(repos, quarkusVersion, quarkusGroupId, download); - if (camelVersion == null) { - camelVersion = catalog.getCatalogVersion(); - } - - context = context.replaceFirst("\\{\\{ \\.GroupId }}", ids[0]); - context = context.replaceFirst("\\{\\{ \\.ArtifactId }}", ids[1]); - context = context.replaceFirst("\\{\\{ \\.Version }}", ids[2]); - context = context.replaceFirst("\\{\\{ \\.QuarkusGroupId }}", quarkusGroupId); - context = context.replaceFirst("\\{\\{ \\.QuarkusArtifactId }}", quarkusArtifactId); - context = context.replaceAll("\\{\\{ \\.QuarkusVersion }}", quarkusVersion); - context = context.replaceAll("\\{\\{ \\.JavaVersion }}", javaVersion); - context = context.replaceAll("\\{\\{ \\.CamelVersion }}", camelVersion); - - if (repos == null || repos.isEmpty()) { - context = context.replaceFirst("\\{\\{ \\.MavenRepositories }}", ""); - } else { - StringBuilder sb = new StringBuilder(); - for (String repo : repos.split(",")) { - sb.append(" maven {\n"); - sb.append(" url '").append(repo).append("'\n"); - if (repo.contains("snapshots")) { - sb.append(" mavenContent {\n"); - sb.append(" snapshotsOnly()\n"); - sb.append(" }\n"); - } - sb.append(" }\n"); - } - context = context.replaceFirst("\\{\\{ \\.MavenRepositories }}", sb.toString()); - } - - List<MavenGav> gavs = new ArrayList<>(); - for (String dep : deps) { - MavenGav gav = parseMavenGav(dep); - String gid = gav.getGroupId(); - String aid = gav.getArtifactId(); - // transform to camel-quarkus extension GAV - if ("org.apache.camel".equals(gid)) { - String qaid = aid.replace("camel-", "camel-quarkus-"); - ArtifactModel<?> am = catalog.modelFromMavenGAV("org.apache.camel.quarkus", qaid, null); - if (am != null) { - // use quarkus extension - gav.setGroupId(am.getGroupId()); - gav.setArtifactId(am.getArtifactId()); - gav.setVersion(null); // uses BOM so version should not be included - } else { - // there is no quarkus extension so use plain camel - gav.setVersion(camelVersion); - } - } - gavs.add(gav); - } - - // replace dependencies with special quarkus dependencies if we can find any - replaceQuarkusDependencies(gavs); - - // sort artifacts - gavs.sort(mavenGavComparator()); - - StringBuilder sb = new StringBuilder(); - for (MavenGav gav : gavs) { - if ("lib".equals(gav.getPackaging())) { - // special for lib JARs - sb.append(" implementation files('lib/").append(gav.getArtifactId()) - .append("-").append(gav.getVersion()).append(".jar')\n"); - } else if ("camel-kamelets-utils".equals(gav.getArtifactId())) { - // special for camel-kamelets-utils - sb.append(" implementation ('").append(gav).append("') {\n"); - sb.append(" exclude group: 'org.apache.camel', module: '*'\n"); - sb.append(" }\n"); - } else { - sb.append(" implementation '").append(gav).append("'\n"); - } - } - context = context.replaceFirst("\\{\\{ \\.CamelDependencies }}", sb.toString()); - - Files.writeString(gradleBuild, context); - } - private void replaceQuarkusDependencies(List<MavenGav> gavs) { // load information about dependencies that should be replaced Map<MavenGav, MavenGav> replace = new HashMap<>(); diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ExportSpringBoot.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ExportSpringBoot.java index 03e008560fbe..5070cd2e0914 100644 --- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ExportSpringBoot.java +++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ExportSpringBoot.java @@ -58,13 +58,6 @@ class ExportSpringBoot extends Export { printer().printErr("--gav must be in syntax: groupId:artifactId:version"); return 1; } - if (!buildTool.equals("maven") && !buildTool.equals("gradle")) { - printer().printErr("--build-tool must either be maven or gradle, was: " + buildTool); - return 1; - } - if (buildTool.equals("gradle")) { - printer().println("WARN: --build-tool=gradle is deprecated."); - } exportBaseDir = exportBaseDir != null ? exportBaseDir : Path.of("."); Path profile = exportBaseDir.resolve("application.properties"); @@ -156,17 +149,9 @@ class ExportSpringBoot extends Export { } return prop; }); - if ("maven".equals(buildTool)) { - createMavenPom(settings, profile, buildDir.resolve("pom.xml"), deps); - if (mavenWrapper) { - copyMavenWrapper(); - } - } else if ("gradle".equals(buildTool)) { - createSettingsGradle(buildDir.resolve("settings.gradle")); - createBuildGradle(settings, buildDir.resolve("build.gradle"), deps); - if (gradleWrapper) { - copyGradleWrapper(); - } + createMavenPom(settings, profile, buildDir.resolve("pom.xml"), deps); + if (mavenWrapper) { + copyMavenWrapper(); } copyDockerFiles(BUILD_DIR); String appJar = "target" + File.separator + ids[1] + "-" + ids[2] + ".jar"; @@ -183,13 +168,6 @@ class ExportSpringBoot extends Export { return 0; } - private void createSettingsGradle(Path file) throws Exception { - String[] ids = gav.split(":"); - - String text = String.format("rootProject.name = '%s'", ids[1]); - IOHelper.writeText(text, Files.newOutputStream(file)); - } - private void createMavenPom(Path settings, Path profile, Path pom, Set<String> deps) throws Exception { String[] ids = gav.split(":"); @@ -295,89 +273,6 @@ class ExportSpringBoot extends Export { IOHelper.writeText(context, Files.newOutputStream(pom)); } - private void createBuildGradle(Path settings, Path gradleBuild, Set<String> deps) throws Exception { - String[] ids = gav.split(":"); - - String context = readResourceTemplate("templates/spring-boot-build-gradle.tmpl"); - - Properties prop = new CamelCaseOrderedProperties(); - RuntimeUtil.loadProperties(prop, settings); - String repos = getMavenRepositories(settings, prop, camelSpringBootVersion); - - CamelCatalog catalog = CatalogLoader.loadSpringBootCatalog(repos, camelSpringBootVersion, download); - String camelVersion = catalog.getLoadedVersion(); - - context = context.replaceFirst("\\{\\{ \\.GroupId }}", ids[0]); - context = context.replaceFirst("\\{\\{ \\.ArtifactId }}", ids[1]); - context = context.replaceFirst("\\{\\{ \\.Version }}", ids[2]); - context = context.replaceAll("\\{\\{ \\.SpringBootVersion }}", springBootVersion); - context = context.replaceFirst("\\{\\{ \\.JavaVersion }}", javaVersion); - context = context.replaceAll("\\{\\{ \\.CamelVersion }}", camelVersion); - context = context.replaceFirst("\\{\\{ \\.CamelSpringBootVersion }}", - Objects.requireNonNullElse(camelSpringBootVersion, camelVersion)); - - if (repos == null || repos.isEmpty()) { - context = context.replaceFirst("\\{\\{ \\.MavenRepositories }}", ""); - } else { - StringBuilder sb = new StringBuilder(); - for (String repo : repos.split(",")) { - sb.append(" maven {\n"); - sb.append(" url '").append(repo).append("'\n"); - if (repo.contains("snapshots")) { - sb.append(" mavenContent {\n"); - sb.append(" snapshotsOnly()\n"); - sb.append(" }\n"); - } - sb.append(" }\n"); - } - context = context.replaceFirst("\\{\\{ \\.MavenRepositories }}", sb.toString()); - } - - List<MavenGav> gavs = new ArrayList<>(); - for (String dep : deps) { - MavenGav gav = parseMavenGav(dep); - String gid = gav.getGroupId(); - String aid = gav.getArtifactId(); - - // transform to camel-spring-boot starter GAV - if ("org.apache.camel".equals(gid)) { - ArtifactModel<?> am = catalog.modelFromMavenGAV("org.apache.camel.springboot", aid + "-starter", null); - if (am != null) { - // use spring-boot starter - gav.setGroupId(am.getGroupId()); - gav.setArtifactId(am.getArtifactId()); - gav.setVersion(am.getVersion()); - } else { - // there is no spring boot starter so use plain camel - gav.setVersion(camelVersion); - } - } - gavs.add(gav); - } - - // sort artifacts - gavs.sort(mavenGavComparator()); - - StringBuilder sb = new StringBuilder(); - for (MavenGav gav : gavs) { - if ("lib".equals(gav.getPackaging())) { - // special for lib JARs - sb.append(" implementation files('lib/").append(gav.getArtifactId()) - .append("-").append(gav.getVersion()).append(".jar')\n"); - } else if ("camel-kamelets-utils".equals(gav.getArtifactId())) { - // special for camel-kamelets-utils - sb.append(" implementation ('").append(gav).append("') {\n"); - sb.append(" exclude group: 'org.apache.camel', module: '*'\n"); - sb.append(" }\n"); - } else { - sb.append(" implementation '").append(gav).append("'\n"); - } - } - context = context.replaceFirst("\\{\\{ \\.CamelDependencies }}", sb.toString()); - - IOHelper.writeText(context, Files.newOutputStream(gradleBuild)); - } - @Override protected Set<String> resolveDependencies(Path settings, Path profile) throws Exception { Set<String> answer = super.resolveDependencies(settings, profile); diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java index 935f8d603fc6..1e79fdc8e6d5 100644 --- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java +++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java @@ -754,15 +754,15 @@ public class Run extends CamelCommand { files.add(OPENAPI_GENERATED_FILE); } - // if we only run pom.xml/build.gradle then auto discover from the Maven/Gradle based project - if (files.size() == 1 && (files.get(0).endsWith("pom.xml") || files.get(0).endsWith("build.gradle"))) { + // if we only run pom.xml then auto discover from the Maven/Gradle based project + if (files.size() == 1 && (files.get(0).endsWith("pom.xml"))) { Path projectDir = Path.of(files.get(0)).toAbsolutePath(); // use a better name when running if (name == null || "CamelJBang".equals(name)) { name = RunHelper.mavenArtifactId(projectDir); } // find source files - files = RunHelper.scanMavenOrGradleProject(projectDir.getParent()); + files = RunHelper.scanMavenProject(projectDir.getParent()); // include extra dependencies from pom.xml var pomDependencies = RunHelper.scanMavenDependenciesFromPom(projectDir); addDependencies(pomDependencies.toArray(new String[0])); @@ -1122,7 +1122,6 @@ public class Run extends CamelCommand { eq.javaLiveReload = this.dev; eq.symbolicLink = this.dev; eq.mavenWrapper = true; - eq.gradleWrapper = false; eq.quarkusVersion = PropertyResolver.fromSystemProperty(QUARKUS_VERSION, () -> this.quarkusVersion); eq.quarkusGroupId = PropertyResolver.fromSystemProperty(QUARKUS_GROUP_ID, () -> this.quarkusGroupId); eq.quarkusArtifactId = PropertyResolver.fromSystemProperty(QUARKUS_ARTIFACT_ID, () -> this.quarkusArtifactId); @@ -1230,7 +1229,6 @@ public class Run extends CamelCommand { eq.javaLiveReload = false; eq.symbolicLink = this.dev; eq.mavenWrapper = true; - eq.gradleWrapper = false; eq.springBootVersion = this.springBootVersion; eq.camelVersion = this.camelVersion; eq.camelSpringBootVersion = PropertyResolver.fromSystemProperty(CAMEL_SPRING_BOOT_VERSION, diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/RunHelper.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/RunHelper.java index b7aa8830316d..b315fafafd62 100644 --- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/RunHelper.java +++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/RunHelper.java @@ -164,7 +164,7 @@ public final class RunHelper { return value; } - public static List<String> scanMavenOrGradleProject(Path parentPath) { + public static List<String> scanMavenProject(Path parentPath) { List<String> answer = new ArrayList<>(); // scan as maven based project diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/common/CamelJBangConstants.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/common/CamelJBangConstants.java index 0c62a6979f78..435119ffe579 100644 --- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/common/CamelJBangConstants.java +++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/common/CamelJBangConstants.java @@ -92,14 +92,6 @@ public final class CamelJBangConstants { javaType = "boolean", defaultValue = "true") public static final String MAVEN_WRAPPER = "camel.jbang.mavenWrapper"; - @Metadata(description = "Include Gradle Wrapper files in the exported project", - javaType = "boolean", defaultValue = "true") - public static final String GRADLE_WRAPPER = "camel.jbang.gradleWrapper"; - - @Metadata(description = "Build tool to use (Maven or Gradle)", - javaType = "String", defaultValue = "Maven") - public static final String BUILD_TOOL = "camel.jbang.buildTool"; - @Metadata(description = "Directory where the project will be exported", javaType = "String", defaultValue = ".") public static final String EXPORT_DIR = "camel.jbang.exportDir"; diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/resources/gradle-wrapper/gradle-wrapper.jar b/dsl/camel-jbang/camel-jbang-core/src/main/resources/gradle-wrapper/gradle-wrapper.jar deleted file mode 100644 index 62d4c053550b..000000000000 Binary files a/dsl/camel-jbang/camel-jbang-core/src/main/resources/gradle-wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/resources/gradle-wrapper/gradle-wrapper.properties b/dsl/camel-jbang/camel-jbang-core/src/main/resources/gradle-wrapper/gradle-wrapper.properties deleted file mode 100644 index 8e8899bc243f..000000000000 --- a/dsl/camel-jbang/camel-jbang-core/src/main/resources/gradle-wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,21 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/resources/gradle-wrapper/gradlew b/dsl/camel-jbang/camel-jbang-core/src/main/resources/gradle-wrapper/gradlew deleted file mode 100755 index fbd7c515832d..000000000000 --- a/dsl/camel-jbang/camel-jbang-core/src/main/resources/gradle-wrapper/gradlew +++ /dev/null @@ -1,185 +0,0 @@ -#!/usr/bin/env sh - -# -# Copyright 2015 the original author or authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn () { - echo "$*" -} - -die () { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=`expr $i + 1` - done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" - -exec "$JAVACMD" "$@" diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/resources/gradle-wrapper/gradlew.bat b/dsl/camel-jbang/camel-jbang-core/src/main/resources/gradle-wrapper/gradlew.bat deleted file mode 100755 index a9f778a7a964..000000000000 --- a/dsl/camel-jbang/camel-jbang-core/src/main/resources/gradle-wrapper/gradlew.bat +++ /dev/null @@ -1,104 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/resources/templates/quarkus-build-gradle.tmpl b/dsl/camel-jbang/camel-jbang-core/src/main/resources/templates/quarkus-build-gradle.tmpl deleted file mode 100644 index f64a9a4f46a6..000000000000 --- a/dsl/camel-jbang/camel-jbang-core/src/main/resources/templates/quarkus-build-gradle.tmpl +++ /dev/null @@ -1,39 +0,0 @@ -plugins { - id 'java' - id 'io.quarkus' -} - -repositories { - mavenCentral() - mavenLocal() -{{ .MavenRepositories }} -} - -dependencies { - implementation enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}") - implementation enforcedPlatform("${quarkusPlatformGroupId}:quarkus-camel-bom:${quarkusPlatformVersion}") - implementation 'io.quarkus:quarkus-arc' -{{ .CamelDependencies }} - testImplementation 'io.quarkus:quarkus-junit5' - testImplementation 'org.apache.camel.quarkus:camel-quarkus-junit5:${quarkusPlatformVersion}' -} - -group = '{{ .GroupId }}' -version = '{{ .Version }}' - -java { - sourceCompatibility = '{{ .JavaVersion }}' - targetCompatibility = '{{ .JavaVersion }}' -} - -test { - systemProperty "java.util.logging.manager", "org.jboss.logmanager.LogManager" -} -compileJava { - options.encoding = 'UTF-8' - options.compilerArgs << '-parameters' -} - -compileTestJava { - options.encoding = 'UTF-8' -} \ No newline at end of file diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/resources/templates/quarkus-gradle-properties.tmpl b/dsl/camel-jbang/camel-jbang-core/src/main/resources/templates/quarkus-gradle-properties.tmpl deleted file mode 100644 index 75c914f229d9..000000000000 --- a/dsl/camel-jbang/camel-jbang-core/src/main/resources/templates/quarkus-gradle-properties.tmpl +++ /dev/null @@ -1,6 +0,0 @@ -#Gradle properties -quarkusPluginId=io.quarkus -quarkusPluginVersion={{ .QuarkusVersion }} -quarkusPlatformGroupId={{ .QuarkusGroupId }} -quarkusPlatformArtifactId={{ .QuarkusArtifactId }} -quarkusPlatformVersion={{ .QuarkusVersion }} \ No newline at end of file diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/resources/templates/quarkus-settings-gradle.tmpl b/dsl/camel-jbang/camel-jbang-core/src/main/resources/templates/quarkus-settings-gradle.tmpl deleted file mode 100644 index 4d63110b59d5..000000000000 --- a/dsl/camel-jbang/camel-jbang-core/src/main/resources/templates/quarkus-settings-gradle.tmpl +++ /dev/null @@ -1,11 +0,0 @@ -pluginManagement { - repositories { - mavenCentral() - gradlePluginPortal() - mavenLocal() - } - plugins { - id "${quarkusPluginId}" version "${quarkusPluginVersion}" - } -} -rootProject.name='{{ .ArtifactId }}' \ No newline at end of file diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/resources/templates/spring-boot-build-gradle.tmpl b/dsl/camel-jbang/camel-jbang-core/src/main/resources/templates/spring-boot-build-gradle.tmpl deleted file mode 100644 index 0c28385abb36..000000000000 --- a/dsl/camel-jbang/camel-jbang-core/src/main/resources/templates/spring-boot-build-gradle.tmpl +++ /dev/null @@ -1,31 +0,0 @@ -plugins { - id 'java' - id 'org.springframework.boot' version '{{ .SpringBootVersion }}' - id 'io.spring.dependency-management' version '1.1.5' -} - -group = '{{ .GroupId }}' -version = '{{ .Version }}' - -java { - sourceCompatibility = '{{ .JavaVersion }}' -} - -repositories { - mavenCentral() - mavenLocal() -{{ .MavenRepositories }} -} - -dependencies { - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-actuator' - implementation 'org.apache.camel.springboot:camel-spring-boot-starter:{{ .CamelVersion }}' -{{ .CamelDependencies }} - testImplementation 'org.springframework.boot:spring-boot-starter-test' - testImplementation 'org.apache.camel:camel-test-spring-junit5:{{ .CamelVersion }}' -} - -tasks.named('test') { - useJUnitPlatform() -} \ No newline at end of file
