This is an automated email from the ASF dual-hosted git repository.
fmariani pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git
The following commit(s) were added to refs/heads/main by this push:
new 1e915b6b043 archetype: create mvnw as post script
1e915b6b043 is described below
commit 1e915b6b043a1ed1a95cbe46ef2ab8149d71e20f
Author: Marco Carletti <[email protected]>
AuthorDate: Fri Sep 12 16:59:33 2025 +0200
archetype: create mvnw as post script
---
.../META-INF/maven/archetype-metadata.xml | 6 +++--
.../META-INF/archetype-post-generate.groovy | 28 ++++++++++++++++++++++
.../{readme.adoc => README.adoc} | 6 ++---
3 files changed, 35 insertions(+), 5 deletions(-)
diff --git
a/archetypes/camel-archetype-spring-boot/src/main/resources-filtered/META-INF/maven/archetype-metadata.xml
b/archetypes/camel-archetype-spring-boot/src/main/resources-filtered/META-INF/maven/archetype-metadata.xml
index 00e1831293e..2e63d3e662e 100644
---
a/archetypes/camel-archetype-spring-boot/src/main/resources-filtered/META-INF/maven/archetype-metadata.xml
+++
b/archetypes/camel-archetype-spring-boot/src/main/resources-filtered/META-INF/maven/archetype-metadata.xml
@@ -30,6 +30,9 @@
<requiredProperty key="maven-compiler-plugin-version">
<defaultValue>${maven-compiler-plugin-version}</defaultValue>
</requiredProperty>
+ <requiredProperty key="maven-version">
+ <defaultValue>${maven-version}</defaultValue>
+ </requiredProperty>
</requiredProperties>
<fileSets>
<fileSet filtered="true" packaged="true" encoding="UTF-8">
@@ -57,9 +60,8 @@
</includes>
</fileSet>
<fileSet filtered="true" encoding="UTF-8">
- <directory>.</directory>
<includes>
- <include>readme.adoc</include>
+ <include>README.adoc</include>
</includes>
</fileSet>
</fileSets>
diff --git
a/archetypes/camel-archetype-spring-boot/src/main/resources/META-INF/archetype-post-generate.groovy
b/archetypes/camel-archetype-spring-boot/src/main/resources/META-INF/archetype-post-generate.groovy
new file mode 100644
index 00000000000..742f51da2cd
--- /dev/null
+++
b/archetypes/camel-archetype-spring-boot/src/main/resources/META-INF/archetype-post-generate.groovy
@@ -0,0 +1,28 @@
+import java.nio.file.Path
+import java.nio.file.Paths
+import org.slf4j.LoggerFactory
+
+def log = LoggerFactory.getLogger("archetype-post-generate")
+
+Path projectPath = Paths.get(request.outputDirectory, request.artifactId)
+ProcessBuilder processBuilder = new ProcessBuilder()
+
+def basePath =
request.getRepositorySession().getSystemProperties().get("maven.multiModuleProjectDirectory");
+def mvnCmd = Path.of(basePath, "mvnw").toFile().exists() ? Path.of(basePath,
"mvnw").toString() : "mvn"
+log.info("generating maven wrapper using {} command", mvnCmd)
+processBuilder.command(mvnCmd, "wrapper:wrapper", "-Dmaven=" +
request.properties["maven-version"])
+processBuilder.directory(projectPath.toFile())
+processBuilder.inheritIO()
+
+try {
+ Process process = processBuilder.start()
+ int exitCode = process.waitFor()
+
+ if (exitCode == 0) {
+ log.info("Maven wrapper generated successfully")
+ } else {
+ log.warn("Failed to generate Maven wrapper. You can run 'mvn
wrapper:wrapper' manually after resolving project dependencies.")
+ }
+} catch (Exception e) {
+ log.warn("Could not generate Maven wrapper: ${e.message}")
+}
\ No newline at end of file
diff --git
a/archetypes/camel-archetype-spring-boot/src/main/resources/archetype-resources/readme.adoc
b/archetypes/camel-archetype-spring-boot/src/main/resources/archetype-resources/README.adoc
similarity index 90%
rename from
archetypes/camel-archetype-spring-boot/src/main/resources/archetype-resources/readme.adoc
rename to
archetypes/camel-archetype-spring-boot/src/main/resources/archetype-resources/README.adoc
index 8d63b48289d..00c9e597f50 100644
---
a/archetypes/camel-archetype-spring-boot/src/main/resources/archetype-resources/readme.adoc
+++
b/archetypes/camel-archetype-spring-boot/src/main/resources/archetype-resources/README.adoc
@@ -9,7 +9,7 @@ The example generates messages using timer trigger, writes them
to standard outp
The Camel route is located in the `MyCamelRouter` class. In this class the
route
starts from a timer, that triggers every 2nd second and calls a Spring Bean
`MyBean`
which returns a message, that is routed to a stream endpoint which writes to
standard output.
-The example contains test class demonstrating how to intercept and mock
endpoints in unit tests using JUnit 5 and Camel Test Support.
+The example contains test class demonstrating how to intercept and mock
endpoints in unit tests using JUnit 6 and Camel Test Support.
== Using Camel components
@@ -20,13 +20,13 @@ and data formats. To use any of these Camel components, add
the component as a d
You can run this example using
- mvn spring-boot:run
+ ./mvnw spring-boot:run
== How to run test
You can run unit test of this example using
- mvn clean test
+ ./mvnw clean test
== More information