features/test/java/install_gradle_and_maven_for_user.sh
etienne-chrp be4f0498e4
Add Gradle and Maven version parameters to Java (#263)
* Refactor java feature tests grep syntax

The grep with pipe syntax was creating problems with the check helper

Change them in favour of process substitution syntax

* Fix java feature tests about java version

Java 18 is not available anymore in SDKMAN

Some tests asserts were generating false positives

* Add Gradle and Maven version parameters to Java
2022-11-16 16:46:30 -08:00

22 lines
642 B
Bash

#!/bin/bash
set -e
# Optional: Import test library
source dev-container-features-test-lib
check "user is vscode" grep vscode <(whoami)
check "java" java --version
check "gradle" gradle --version
cd /tmp && gradle init --type basic --dsl groovy --incubating --project-name test
check "GRADLE_USER_HOME exists" grep ".gradle" <(ls -la /home/vscode)
check "maven" mvn --version
cd /tmp && mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false
check "m2 exists" grep ".m2" <(ls -la /home/vscode)
# Report result
reportResults