I'm trying to build for the first time, so I don't know what I don't know. I apologize for that.
mvn test fails here:
[INFO] ----------------------------< io.vavr:vavr >----------------------------
[INFO] Building Vavr 1.0.0-SNAPSHOT [4/6]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0-M1:enforce (enforce-maven) @ vavr ---
[INFO]
[INFO] --- maven-clean-plugin:3.0.0:clean (clean-generated-sources) @ vavr ---
[INFO] Deleting /mnt/extra-space/Workspaces/vavr/vavr/target
[INFO] Deleting /mnt/extra-space/Workspaces/vavr/vavr/src-gen (includes = [], excludes = [])
[INFO]
[INFO] --- scala-maven-plugin:3.4.1:script (default) @ vavr ---
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Vavr Parent 1.0.0-SNAPSHOT ......................... SUCCESS [ 0.402 s]
[INFO] Vavr Match ......................................... SUCCESS [ 1.438 s]
[INFO] Vavr Match Annotation Processor .................... SUCCESS [ 0.824 s]
[INFO] Vavr ............................................... FAILURE [ 12.349 s]
[INFO] Vavr Benchmark ..................................... SKIPPED
[INFO] Vavr Test 1.0.0-SNAPSHOT ........................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.171 s
[INFO] Finished at: 2018-11-02T23:45:22+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal net.alchim31.maven:scala-maven-plugin:3.4.1:script (default) on project vavr: wrap: java.lang.Exception: A NoClassDefFoundError exception was thrown: Generator_1$$Lambda$362 -> [Help 1]
I have no idea what I might try, but I'm willing to try anything that you suggest. Thanks.
Oh noes...
Very few users had that issue and we invested some hours to understand it but where not able to fix it.
It works on our continuous integration servers (Travis-CI/Ubuntu) and on our local machines.
Maybe it has s.th. to do with the Scala version (see Maven poms), maybe additionally with the combination of JDK and OS. I don't know :-/
@jbrains please try also Java 8 if you have it at hand. Our CI builds run on JDK 8 & 9.
I'm trying various combinations. I'm running Pop!_OS 18.04, which is effectively Ubuntu 18.04.
Well, I found a combination that works.
I'll try a few more combinations, just in case you find the information helpful.
Here is what I've learned, summarized:
Here is the blow-by-blow:
b1076f84 Build FAILED with Java 10.0.2-zulu, Maven 3.6.0, scala-maven-plugin 3.4.4.
4db91bde Build FAILED with Java 10.0.2-zulu, Maven 3.6.0, scala-maven-plugin 3.4.2.
8a86c565 Build FAILED with Java 10.0.2-zulu, Maven 3.6.0, scala-maven-plugin 3.4.1.
28080e77 Build FAILED with Java 10.0.2-zulu, Maven 3.5.4, scala-maven-plugin 3.4.4.
5cd9b628 Build FAILED with Java 10.0.2-zulu, Maven 3.5.4, scala-maven-plugin 3.4.2.
9471266b Build FAILED with Java 10.0.2-zulu, Maven 3.5.4, scala-maven-plugin 3.4.1.
20c59721 Build FAILED with Java 10.0.2-zulu, Maven 3.5.3, scala-maven-plugin 3.4.4.
96ad251b Build FAILED with Java 10.0.2-zulu, Maven 3.5.3, scala-maven-plugin 3.4.2.
cadd4226 Build FAILED with Java 10.0.2-zulu, Maven 3.5.3, scala-maven-plugin 3.4.1.
53db2929 Build FAILED with Java 10.0.2-open, Maven 3.6.0, scala-maven-plugin 3.4.4.
84f49881 Build FAILED with Java 10.0.2-open, Maven 3.6.0, scala-maven-plugin 3.4.2.
6a25413c Build FAILED with Java 10.0.2-open, Maven 3.6.0, scala-maven-plugin 3.4.1.
1ac47b47 Build FAILED with Java 10.0.2-open, Maven 3.5.4, scala-maven-plugin 3.4.4.
7d0137ee Build FAILED with Java 10.0.2-open, Maven 3.5.4, scala-maven-plugin 3.4.2.
67d97991 Build FAILED with Java 10.0.2-open, Maven 3.5.4, scala-maven-plugin 3.4.1.
c19ac546 Build FAILED with Java 10.0.2-open, Maven 3.5.3, scala-maven-plugin 3.4.4.
ba76cb2a Build FAILED with Java 10.0.2-open, Maven 3.5.3, scala-maven-plugin 3.4.2.
2e80ade4 Build FAILED with Java 10.0.2-open, Maven 3.5.3, scala-maven-plugin 3.4.1.
96c07b55 Build FAILED with Java 10.0.1-zulu, Maven 3.6.0, scala-maven-plugin 3.4.4.
2819bc2e Build FAILED with Java 10.0.1-zulu, Maven 3.6.0, scala-maven-plugin 3.4.2.
5f7515b6 Build FAILED with Java 10.0.1-zulu, Maven 3.6.0, scala-maven-plugin 3.4.1.
7eca5f62 Build FAILED with Java 10.0.1-zulu, Maven 3.5.4, scala-maven-plugin 3.4.4.
837b4513 Build FAILED with Java 10.0.1-zulu, Maven 3.5.4, scala-maven-plugin 3.4.2.
63e563c5 Build FAILED with Java 10.0.1-zulu, Maven 3.5.4, scala-maven-plugin 3.4.1.
2abe51bf Build FAILED with Java 10.0.1-zulu, Maven 3.5.3, scala-maven-plugin 3.4.4.
3a3b36fc Build FAILED with Java 10.0.1-zulu, Maven 3.5.3, scala-maven-plugin 3.4.2.
932a7597 Build FAILED with Java 10.0.1-zulu, Maven 3.5.3, scala-maven-plugin 3.4.1.
47dff975 Build SUCCESS with Java 9.0.7-zulu, Maven 3.6.0, scala-maven-plugin 3.4.4.
166e8e76 Build SUCCESS with Java 9.0.7-zulu, Maven 3.6.0, scala-maven-plugin 3.4.2.
521831d6 Build SUCCESS with Java 9.0.7-zulu, Maven 3.6.0, scala-maven-plugin 3.4.1.
15c10399 Build SUCCESS with Java 9.0.7-zulu, Maven 3.5.4, scala-maven-plugin 3.4.4.
3ddf5719 Build SUCCESS with Java 9.0.7-zulu, Maven 3.5.4, scala-maven-plugin 3.4.2.
86e739ee Build SUCCESS with Java 9.0.7-zulu, Maven 3.5.4, scala-maven-plugin 3.4.1.
ba7194a1 Build SUCCESS with Java 9.0.7-zulu, Maven 3.5.3, scala-maven-plugin 3.4.4.
7210cd58 Build FAILED with Java 9.0.7-zulu, Maven 3.5.3, scala-maven-plugin 3.4.2.
8493da51 Build SUCCESS with Java 9.0.7-zulu, Maven 3.5.3, scala-maven-plugin 3.4.1.
60bfcc0c Build SUCCESS with Java 9.0.4-open, Maven 3.6.0, scala-maven-plugin 3.4.4.
5cafbd3b Build SUCCESS with Java 9.0.4-open, Maven 3.6.0, scala-maven-plugin 3.4.2.
16983193 Build SUCCESS with Java 9.0.4-open, Maven 3.6.0, scala-maven-plugin 3.4.1.
990794eb Build SUCCESS with Java 9.0.4-open, Maven 3.5.4, scala-maven-plugin 3.4.4.
f8865b13 Build SUCCESS with Java 9.0.4-open, Maven 3.5.4, scala-maven-plugin 3.4.2.
d422682e Build SUCCESS with Java 9.0.4-open, Maven 3.5.4, scala-maven-plugin 3.4.1.
9a8a2bcd Build SUCCESS with Java 9.0.4-open, Maven 3.5.3, scala-maven-plugin 3.4.4.
9fc461b2 Build FAILED with Java 9.0.4-open, Maven 3.5.3, scala-maven-plugin 3.4.2.
419512c7 Build SUCCESS with Java 9.0.4-open, Maven 3.5.3, scala-maven-plugin 3.4.1.
733a3c01 Build FAILED with Java 8.0.191-oracle, Maven 3.6.0, scala-maven-plugin 3.4.4.
ffd04c25 Build FAILED with Java 8.0.191-oracle, Maven 3.6.0, scala-maven-plugin 3.4.2.
c4117358 Build FAILED with Java 8.0.191-oracle, Maven 3.6.0, scala-maven-plugin 3.4.1.
e0da2daf Build FAILED with Java 8.0.191-oracle, Maven 3.5.4, scala-maven-plugin 3.4.4.
5604c0c4 Build FAILED with Java 8.0.191-oracle, Maven 3.5.4, scala-maven-plugin 3.4.2.
f0d5ad96 Build FAILED with Java 8.0.191-oracle, Maven 3.5.4, scala-maven-plugin 3.4.1.
0daec671 Build FAILED with Java 8.0.191-oracle, Maven 3.5.3, scala-maven-plugin 3.4.4.
0b277893 Build FAILED with Java 8.0.191-oracle, Maven 3.5.3, scala-maven-plugin 3.4.2.
625936f8 Build FAILED with Java 8.0.191-oracle, Maven 3.5.3, scala-maven-plugin 3.4.1.
7aabd629 Build FAILED with Java 8.0.181-zulu, Maven 3.6.0, scala-maven-plugin 3.4.4.
73bcddfb Build FAILED with Java 8.0.181-zulu, Maven 3.6.0, scala-maven-plugin 3.4.2.
acdcf386 Build FAILED with Java 8.0.181-zulu, Maven 3.6.0, scala-maven-plugin 3.4.1.
004a74be Build FAILED with Java 8.0.181-zulu, Maven 3.5.4, scala-maven-plugin 3.4.4.
9adbcd75 Build FAILED with Java 8.0.181-zulu, Maven 3.5.4, scala-maven-plugin 3.4.2.
c1b894b0 Build FAILED with Java 8.0.181-zulu, Maven 3.5.4, scala-maven-plugin 3.4.1.
af66ed71 Build FAILED with Java 8.0.181-zulu, Maven 3.5.3, scala-maven-plugin 3.4.4.
75c5d951 Build FAILED with Java 8.0.181-zulu, Maven 3.5.3, scala-maven-plugin 3.4.2.
5c4b16eb Build FAILED with Java 8.0.181-zulu, Maven 3.5.3, scala-maven-plugin 3.4.1.
@jbrains 馃敟-W-O-W-馃敟
thank you!馃憣馃徏馃槂
You're welcome. I'll try to contribute something to the documentation.
Awesome!
Dear prospective contributor, if you have problems building Vavr, then you might need to experiment with different combinations of versions of Java, Maven, and the Scala plugin for Maven. This issue contains a summary of test results from one new contributor trying to find combinations that build on Pop!_OS 18.04 (Linux 4.15.0-34-generic #37-Ubuntu SMP x86_64) as of the date of writing these words.
I used sdkman to try various versions of Java and Maven. I changed the file pom.xml in the root of the project to try various versions of the Scala plugin for Maven. Look for the build property named scala.maven.version. See https://github.com/vavr-io/vavr/pull/2270 for an example of changing the version of the Scala plugin for Maven, specifically the change at https://github.com/vavr-io/vavr/pull/2270/commits/7c897aa92a2ae609157d61400649a6719e806048.
I wrote a script test a bunch of combinations. It commits once per combination to the Vavr project repository with a description of the test result. Put this script in your PATH somewhere, then run it. If you haven't installed all the various versions of Java and Maven before, then you'll need to either set sdkman_auto_answer to false (don't make each installed version the default) or answer a question at the prompt every few minutes. As of today, sdkman doesn't let me specify "auto answer" without changing my user-level sdkman configuration.
You can open the script and change the lists of Java, Maven, and Scala plugin versions, if you'd like to test different versions. I chose all of Java 8, 9, and 10 as well as Maven 3.5.3+ and Scala plugin 3.4.1+, because those seemed to be likely candidates to work as of today and from what I could glean from project documents and issues.
I called this script build-vavr.sh.
#!/usr/bin/env bash
function build_vavr() {
local sdkman_root="$1"
local vavr_project_root="$2"
local java_version="$3"
local maven_version="$4"
local scala_maven_version="$5"
source "${sdkman_root}/bin/sdkman-init.sh"
sdk use java "${java_version}"
sdk use maven "${maven_version}"
sed -i "s/<scala\.maven\.version>.\+<\/scala\.maven\.version>/<scala.maven.version>${scala_maven_version}<\/scala.maven.version>/" ${vavr_project_root}/pom.xml
pushd "${vavr_project_root}"
mvn clean test -e
# REFACTOR Remove the obvious duplication here. I haven't yet learned how to do that in bash.
if [ $? -eq 0 ]
then
git add -A
git commit --allow-empty -m "Build SUCCESS with Java ${java_version}, Maven ${maven_version}, scala-maven-plugin ${scala_maven_version}."
else
git add -A
git commit --allow-empty -m "Build FAILED with Java ${java_version}, Maven ${maven_version}, scala-maven-plugin ${scala_maven_version}."
fi
popd
}
function run_tests() {
# REFACTOR Extract these lists to make them parameters or environment variables. I haven't yet learned how to do that in bash.
for java_version in "8.0.181-zulu" "8.0.191-oracle" "9.0.4-open" "9.0.7-zulu" "10.0.1-zulu" "10.0.2-open" "10.0.2-zulu"
do
for maven_version in "3.5.3" "3.5.4" "3.6.0"
do
for scala_maven_version in "3.4.1" "3.4.2" "3.4.4"
do
build_vavr "${SDKMAN_DIR}" "${VAVR_PROJECT_ROOT}" "$java_version" "$maven_version" "$scala_maven_version"
done
done
done
}
[[ -z "${SDKMAN_DIR}" ]] && {
echo "Environment variable SDKMAN_DIR is not set,"
echo "so I can't run these tests."
echo "Install sdkman and/or set SDKMAN_DIR to your user's"
echo "sdkman folder, which is probably \$HOME/.sdkman"
exit 1
}
[[ -z "$1" ]] && {
echo "Usage: build-vavr.sh VAVR_PROJECT_ROOT"
echo " Example: build-vavr.sh ~/Workspaces/vavr"
echo ""
echo "Prerequisites"
echo "-------------"
echo ""
echo "You need sdkman and the environment variable"
echo "SDKMAN_DIR must be set to the location of"
echo "your user's sdkman folder, which is probably \$HOME/.sdkman."
echo "Visit https://sdkman.io to install sdkman."
echo
echo "You need git available on the system PATH."
echo "Visit https://git-scm.com to install git."
exit 1
}
git --version || {
echo "Unable to run git. Please install git and check"
echo "that git is on your PATH."
exit 1
}
VAVR_PROJECT_ROOT="$1"
pushd "${VAVR_PROJECT_ROOT}"
[[ -z "$(git status -s)" ]] || {
echo "You have uncommitted changes in your working copy"
echo "of the vavr project. This script commits to its own"
echo "git branch in order to report results. Please stash,"
echo "reset, or commit your changes, then run this"
echo "script again."
exit 1
}
# grep -q returns 0 on match and non-0 on no match
git branch | grep -q "find\-settings\-that\-will\-build\-vavr" && {
echo "What are the odds?! You already have a git branch"
echo "called 'find-settings-that-will-build-vavr'?! Please"
echo "rename it or delete it. Sorry."
exit 1
}
git checkout -b find-settings-that-will-build-vavr
run_tests
git log --pretty=oneline find-settings-that-will-build-vavr
popd
Thx!
Most helpful comment
Here is what I've learned, summarized:
Here is the blow-by-blow: