diff --git a/buildpacks/jvm/src/main.rs b/buildpacks/jvm/src/main.rs index 22daf746..7ab8f74e 100644 --- a/buildpacks/jvm/src/main.rs +++ b/buildpacks/jvm/src/main.rs @@ -114,8 +114,7 @@ impl Buildpack for OpenJdkBuildpack { To set the OpenJDK version, add or edit the system.properties file in the root directory of your application to contain: - java.runtime.version = {OPENJDK_LATEST_LTS_VERSION} - "}, + java.runtime.version = {OPENJDK_LATEST_LTS_VERSION}"}, ); } diff --git a/buildpacks/jvm/tests/integration/versions.rs b/buildpacks/jvm/tests/integration/versions.rs index 7881ccbe..3a3fa7b6 100644 --- a/buildpacks/jvm/tests/integration/versions.rs +++ b/buildpacks/jvm/tests/integration/versions.rs @@ -18,20 +18,19 @@ fn openjdk_default() { assert_contains!( context.pack_stderr, &formatdoc! {" - [Warning: No OpenJDK version specified] - Your application does not explicitly specify an OpenJDK version. The latest - long-term support (LTS) version will be installed. This currently is OpenJDK 21. - - This default version will change when a new LTS version is released. Your - application might fail to build with the new version. We recommend explicitly - setting the required OpenJDK version for your application. - - To set the OpenJDK version, add or edit the system.properties file in the root - directory of your application to contain: - - java.runtime.version = 21 - "} - ); + ! WARNING: No OpenJDK version specified + ! + ! Your application does not explicitly specify an OpenJDK version. The latest + ! long-term support (LTS) version will be installed. This currently is OpenJDK 21. + ! + ! This default version will change when a new LTS version is released. Your + ! application might fail to build with the new version. We recommend explicitly + ! setting the required OpenJDK version for your application. + ! + ! To set the OpenJDK version, add or edit the system.properties file in the root + ! directory of your application to contain: + ! + ! java.runtime.version = 21"}); assert_contains!( context.run_shell_command("java -version").stderr, @@ -53,10 +52,7 @@ fn openjdk_functions_default() { BuildpackReference::WorkspaceBuildpack(buildpack_id!("heroku/maven")), ]), |context| { - assert_not_contains!( - context.pack_stderr, - "[Warning: No OpenJDK version specified]" - ); + assert_not_contains!(context.pack_stderr, "No OpenJDK version specified"); assert_contains!( context.run_shell_command("java -version").stderr, diff --git a/buildpacks/maven/tests/integration/misc.rs b/buildpacks/maven/tests/integration/misc.rs index 6699d70f..18570d43 100644 --- a/buildpacks/maven/tests/integration/misc.rs +++ b/buildpacks/maven/tests/integration/misc.rs @@ -106,7 +106,6 @@ fn no_internal_maven_options_logging() { |context| { assert_not_contains!(context.pack_stdout, "-Dmaven.repo.local="); assert_not_contains!(context.pack_stdout, "-Duser.home="); - assert_not_contains!(context.pack_stdout, "dependency:list"); assert_not_contains!( context.pack_stdout, "-DoutputFile=target/mvn-dependency-list.log" diff --git a/buildpacks/maven/tests/integration/versions.rs b/buildpacks/maven/tests/integration/versions.rs index 6e9c140b..457a6727 100644 --- a/buildpacks/maven/tests/integration/versions.rs +++ b/buildpacks/maven/tests/integration/versions.rs @@ -7,9 +7,9 @@ use std::path::Path; #[ignore = "integration test"] fn with_wrapper() { TestRunner::default().build( default_build_config("test-apps/simple-http-service"), |context| { - assert_not_contains!(context.pack_stdout, "Selected Maven version:"); - assert_contains!(context.pack_stdout, "Maven wrapper detected, skipping installation."); - assert_contains!(context.pack_stdout, "$ ./mvnw"); + assert_not_contains!(context.pack_stdout, " - Selected Maven version"); + assert_contains!(context.pack_stdout, "- Skipping (Maven wrapper detected)"); + assert_contains!(context.pack_stdout, " - Running `./mvnw"); assert_contains!(context.pack_stdout, &format!("[BUILDPACK INTEGRATION TEST - MAVEN VERSION] {SIMPLE_HTTP_SERVICE_MAVEN_WRAPPER_VERSION}")); }); } @@ -25,7 +25,7 @@ fn with_wrapper_and_system_properties() { |context| { assert_contains!( context.pack_stdout, - &format!("Selected Maven version: {DEFAULT_MAVEN_VERSION}") + &format!(" - Selected Maven version `{DEFAULT_MAVEN_VERSION}`") ); assert_not_contains!(context.pack_stdout, "$ ./mvnw"); assert_contains!( @@ -61,7 +61,7 @@ fn without_wrapper_and_without_system_properties() { assert_not_contains!(context.pack_stdout, "$ ./mvnw"); assert_contains!( context.pack_stdout, - &format!("Selected Maven version: {DEFAULT_MAVEN_VERSION}") + &format!(" - Selected Maven version `{DEFAULT_MAVEN_VERSION}`") ); assert_contains!( context.pack_stdout, @@ -95,7 +95,7 @@ fn without_wrapper_and_maven_3_9_4_system_properties() { set_maven_version_app_dir_preprocessor("3.9.4", &path); }), |context| { - assert_contains!(context.pack_stdout, "Selected Maven version: 3.9.4"); + assert_contains!(context.pack_stdout, " - Selected Maven version `3.9.4`"); assert_contains!( context.pack_stdout, "[BUILDPACK INTEGRATION TEST - MAVEN VERSION] 3.9.4" diff --git a/shared/src/lib.rs b/shared/src/lib.rs index c3c0a362..de2bc25c 100644 --- a/shared/src/lib.rs +++ b/shared/src/lib.rs @@ -1,5 +1,5 @@ pub mod fs; pub mod log; +pub mod output; pub mod result; pub mod system_properties; -pub mod output; diff --git a/shared/src/output.rs b/shared/src/output.rs index a265a2ad..d609a00c 100644 --- a/shared/src/output.rs +++ b/shared/src/output.rs @@ -39,7 +39,7 @@ pub fn print_warning(title: impl AsRef, body: impl Into, body: impl Into) { @@ -59,7 +59,7 @@ pub fn print_error(title: impl AsRef, body: impl Into) ..BuildpackOutputText::default() }; - println!("{}", text.to_ansi_string()); + eprintln!("{}", text.to_ansi_string()); } pub fn run_command E, F2: FnOnce(Output) -> E>(