<commit_before>@INCLUDE_COMMON@

echo
echo ELEKTRA CHECK EXTERNAL JAVA EXAMPLE
echo

if command -v mvn; then
	if ! mvn; then
		echo "Maven not installed, will skip"
		exit 0
	fi
else
	echo "Maven not installed, will skip"
	exit 0
fi

check_version

EXTERNAL_FOLDER="@CMAKE_SOURCE_DIR@/examples/external/java/read-keys-example"

echo "Testing build with mvn"

cd "$EXTERNAL_FOLDER"
mvn clean package test

rm -r target

end_script java<commit_msg>jna: run needed mvn command first<commit_after>@INCLUDE_COMMON@

echo
echo ELEKTRA CHECK EXTERNAL JAVA EXAMPLE
echo

if command -v mvn; then
	if ! mvn; then
		echo "Maven not installed, will skip"
		exit 0
	fi
else
	echo "Maven not installed, will skip"
	exit 0
fi

if test -f /usr/share/java/libelektra4j.jar; then
	echo "libelektra4j.jar not installed, will skip"
	exit 0
fi

check_version

EXTERNAL_FOLDER="@CMAKE_SOURCE_DIR@/examples/external/java/read-keys-example"

echo "Testing build with mvn"

cd "$EXTERNAL_FOLDER"

mvn org.apache.maven.plugins:maven-install-plugin:install-file \
	-Dfile=/usr/share/java/libelektra4j.jar \
	-DpomFile=/usr/share/java/libelektra4j.pom.xml

mvn clean package test

rm -r target

end_script java
{'fraction_non_alphanumeric': 0.08544839255499154, 'fraction_numerical': 0.007614213197969543, 'mean_word_length': 4.451612903225806, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5370268', 'n_tokens_mistral': 483, 'n_tokens_neox': 454, 'n_words': 130}