Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions examples/quickstarts/helidon-quickstart-mp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ plugins {
id 'java'
id 'org.kordamp.gradle.jandex' version '2.0.0'
id 'application'
id("org.graalvm.buildtools.native") version "0.11.0"
}

group = 'io.helidon.examples'
Expand Down Expand Up @@ -53,12 +54,16 @@ dependencies {

runtimeOnly 'io.smallrye:jandex'
runtimeOnly 'jakarta.activation:jakarta.activation-api'
runtimeOnly 'io.helidon.logging:helidon-logging-jul'

testImplementation 'io.helidon.microprofile.testing:helidon-microprofile-testing-junit5'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation 'org.hamcrest:hamcrest-all'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

nativeImageClasspath "io.helidon.integrations.graal:helidon-graal-native-image-extension"
nativeImageClasspath "io.helidon.integrations.graal:helidon-mp-graal-native-image-extension"
}

test {
Expand Down
3 changes: 3 additions & 0 deletions examples/quickstarts/helidon-quickstart-se/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
plugins {
id 'java'
id 'application'
id("org.graalvm.buildtools.native") version "0.11.0"
}

group = 'io.helidon.examples'
Expand Down Expand Up @@ -56,6 +57,7 @@ dependencies {
implementation 'io.helidon.webserver.observe:helidon-webserver-observe-metrics'
implementation 'io.helidon.config:helidon-config-yaml'
implementation 'io.helidon.health:helidon-health-checks'
runtimeOnly 'io.helidon.logging:helidon-logging-jul'

testImplementation 'io.helidon.webserver.testing.junit5:helidon-webserver-testing-junit5'
testImplementation 'org.junit.jupiter:junit-jupiter'
Expand All @@ -64,6 +66,7 @@ dependencies {
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

nativeImageClasspath "io.helidon.integrations.graal:helidon-graal-native-image-extension"
}

// define a custom task to copy all dependencies in the runtime classpath
Expand Down
114 changes: 114 additions & 0 deletions examples/quickstarts/helidon-standalone-quickstart-mp/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
/*
* Copyright (c) 2018, 2025 Oracle and/or its affiliates.
*
* 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
*
* 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.
*/

plugins {
id 'java'
id 'org.kordamp.gradle.jandex' version '2.0.0'
id 'application'
id("org.graalvm.buildtools.native") version "0.11.0"
}

group = 'io.helidon.examples'
version = '1.0-SNAPSHOT'

description = """helidon-quickstart-mp"""

java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}

ext {
helidonversion = '4.2.6'
mainClass='io.helidon.microprofile.cdi.Main'
}

repositories {
mavenCentral()
mavenLocal()
gradlePluginPortal()
}

dependencies {
// import Helidon BOM
implementation enforcedPlatform("io.helidon:helidon-dependencies:${project.helidonversion}")
implementation 'io.helidon.microprofile.bundles:helidon-microprofile'
implementation 'org.glassfish.jersey.media:jersey-media-json-binding'

runtimeOnly 'io.smallrye:jandex'
runtimeOnly 'jakarta.activation:jakarta.activation-api'

testImplementation 'io.helidon.microprofile.testing:helidon-microprofile-testing-junit5'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation 'org.hamcrest:hamcrest-all'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

nativeImageClasspath "io.helidon.integrations.graal:helidon-graal-native-image-extension"
nativeImageClasspath "io.helidon.integrations.graal:helidon-mp-graal-native-image-extension"
}

test {
useJUnitPlatform()
}

// define a custom task to copy all dependencies in the runtime classpath
// into build/libs/libs
// uses built-in Copy
task copyLibs(type: Copy) {
from configurations.runtimeClasspath
into 'build/libs/libs'
}

// add it as a dependency of built-in task 'assemble'
copyLibs.dependsOn jar
assemble.dependsOn copyLibs

// default jar configuration
// set the main classpath
// add each jar under build/libs/libs into the classpath
jar {
archiveFileName = "${project.name}.jar"
manifest {
attributes ('Main-Class': "${project.mainClass}" ,
'Class-Path': configurations.runtimeClasspath.files.collect { "libs/$it.name" }.join(' ')
)
}
}

application {
mainClass = "${project.mainClass}"
}

// This is a work-around for running unit tests.
// Gradle places resource files under ${buildDir}/resources. In order for
// beans.xml to get picked up by CDI it must be co-located with the classes.
// So we move it before running tests.
// In either case it ends up AOK in the final jar artifact
task moveBeansXML {
doLast {
ant.move file: "${buildDir}/resources/main/META-INF/beans.xml",
todir: "${buildDir}/classes/java/main/META-INF"
}
}
compileTestJava.dependsOn "jandex"
jar.dependsOn "jandex"
test.dependsOn moveBeansXML
run.dependsOn moveBeansXML
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright (c) 2018, 2024 Oracle and/or its affiliates.
*
* 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
*
* 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.
*/

rootProject.name = 'helidon-standalone-quickstart-mp'
99 changes: 99 additions & 0 deletions examples/quickstarts/helidon-standalone-quickstart-se/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
/*
* Copyright (c) 2018, 2025 Oracle and/or its affiliates.
*
* 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
*
* 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.
*/

plugins {
id 'java'
id 'application'
id("org.graalvm.buildtools.native") version "0.11.0"
}

group = 'io.helidon.examples'
version = '1.0-SNAPSHOT'

description = """helidon-quickstart-se"""

java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}

ext {
helidonversion = '4.2.6'
mainClass='io.helidon.examples.quickstart.se.Main'
}

test {
useJUnitPlatform()
}

repositories {
mavenCentral()
mavenLocal()
}

dependencies {
// import Helidon BOM
implementation enforcedPlatform("io.helidon:helidon-dependencies:${project.helidonversion}")
implementation 'io.helidon.webserver:helidon-webserver'
implementation 'io.helidon.http.media:helidon-http-media-jsonp'
implementation 'io.helidon.webserver.observe:helidon-webserver-observe-health'
implementation 'io.helidon.webserver.observe:helidon-webserver-observe-metrics'
implementation 'io.helidon.config:helidon-config-yaml'
implementation 'io.helidon.health:helidon-health-checks'
runtimeOnly 'io.helidon.logging:helidon-logging-jul'

testImplementation 'io.helidon.webserver.testing.junit5:helidon-webserver-testing-junit5'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'io.helidon.webclient:helidon-webclient'
testImplementation 'org.hamcrest:hamcrest-all'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

nativeImageClasspath "io.helidon.integrations.graal:helidon-graal-native-image-extension"
}

// define a custom task to copy all dependencies in the runtime classpath
// into build/libs/libs
// uses built-in Copy
task copyLibs(type: Copy) {
from configurations.runtimeClasspath
into 'build/libs/libs'
}

// add it as a dependency of built-in task 'assemble'
copyLibs.dependsOn jar
assemble.dependsOn copyLibs

// default jar configuration
// set the main classpath
// add each jar under build/libs/libs into the classpath
jar {
archiveFileName = "${project.name}.jar"
manifest {
attributes ('Main-Class': "${project.mainClass}",
'Class-Path': configurations.runtimeClasspath.files.collect { "libs/$it.name" }.join(' ')
)
}
}

application {
mainClass = "${project.mainClass}"
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright (c) 2018, 2024 Oracle and/or its affiliates.
*
* 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
*
* 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.
*/

rootProject.name = 'helidon-standalone-quickstart-se'
Loading