From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Bj=C3=B6rn_?= =?UTF-8?Q?H=C3=B6fling?= Subject: bug#31943: Some Maven bugs Date: Sat, 23 Jun 2018 00:39:35 +0200 Message-ID: <20180623003935.21f7da0b@alma-ubu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/28N8eH4E2kr=Z0E7diLHJza"; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54828) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fWUir-00029B-5F for bug-guix@gnu.org; Fri, 22 Jun 2018 18:40:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fWUin-0001kU-VY for bug-guix@gnu.org; Fri, 22 Jun 2018 18:40:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:52761) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fWUin-0001kQ-Sn for bug-guix@gnu.org; Fri, 22 Jun 2018 18:40:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fWUin-0005iT-Kv for bug-guix@gnu.org; Fri, 22 Jun 2018 18:40:01 -0400 Sender: "Debbugs-submit" Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54804) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fWUiV-00026y-Gi for bug-guix@gnu.org; Fri, 22 Jun 2018 18:39:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fWUiS-0001ga-Ax for bug-guix@gnu.org; Fri, 22 Jun 2018 18:39:43 -0400 Received: from m4s11.vlinux.de ([83.151.27.109]:38018 helo=bjoernhoefling.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fWUiR-0001gD-VZ for bug-guix@gnu.org; Fri, 22 Jun 2018 18:39:40 -0400 Received: from alma-ubu (p57B52973.dip0.t-ipconnect.de [87.181.41.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by bjoernhoefling.de (Postfix) with ESMTPSA id 3A7E441FA7 for ; Sat, 23 Jun 2018 00:39:37 +0200 (CEST) List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: 31943@debbugs.gnu.org --Sig_/28N8eH4E2kr=Z0E7diLHJza Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Maven is now part of Guix, yeah! I gave it a try and found some bugs which I post collectively here. I don't know yet where exactly they come from and if they are trivial or not to fix. So if you think they should better go each into a separate bug report, please separate them. For reference, I'm on Ubuntu with: $> guix pull --list-generations | tail --lines=3D6 guile: warning: failed to install locale warning: failed to install locale: Invalid argument Generation 2 Jun 22 2018 21:53:40 (current) guix 18ab54d repository URL: https://git.savannah.gnu.org/git/guix.git commit: 18ab54d4a2aaf932b14e69c30650c1d2c4db33c7 1) The following propagated inputs are used from bash scripts and are missing: which, coreutils $> guix environment -C --ad-hoc maven icedtea@3:jdk -- mvn=20 /gnu/store/sk23y72hma8x6n5ch6xqgql1q93dg7if-profile/bin/mvn: line 46: uname= : command not found /gnu/store/sk23y72hma8x6n5ch6xqgql1q93dg7if-profile/bin/mvn: line 56: ls: c= ommand not found /gnu/store/sk23y72hma8x6n5ch6xqgql1q93dg7if-profile/bin/mvn: line 57: expr:= command not found /gnu/store/sk23y72hma8x6n5ch6xqgql1q93dg7if-profile/bin/mvn: line 58: expr:= command not found /gnu/store/sk23y72hma8x6n5ch6xqgql1q93dg7if-profile/bin/mvn: line 61: dirna= me: command not found /gnu/store/sk23y72hma8x6n5ch6xqgql1q93dg7if-profile/bin/mvn: line 67: dirna= me: command not found /gnu/store/sk23y72hma8x6n5ch6xqgql1q93dg7if-profile/bin/mvn: line 94: which= : command not found The JAVA_HOME environment variable is not defined correctly This environment variable is needed to run this program NB: JAVA_HOME should point to a JDK not a JRE 2) There is something wrong with the version output: $> guix environment -C --ad-hoc maven icedtea@3:jdk coreutils which -- mvn -version null ${distributionShortName} home: /gnu/store/a19m087lz9fg4c2aplvdlm1y2iiibjdb-= maven-3.5.3 Java version: 1.8.0_161, vendor: Oracle Corporation Java home: /gnu/store/7dah2ha88f4sxakpgdlbfn6mvs842j6w-icedtea-3.7.0-jdk/jre Default locale: en_US, platform encoding: ANSI_X3.4-1968 OS name: "linux", version: "4.4.0-128-generic", arch: "amd64", family: "uni= x" Compare this to my "native" Ubuntu maven: $> /usr/bin/mvn -version Apache Maven 3.3.9 Maven home: /usr/share/maven Java version: 1.8.0_161, vendor: Oracle Corporation Java home: /gnu/store/8yfdmh7hsnfq87ddcyjz5nxk5f208pmc-icedtea-3.7.0-jdk/jre Default locale: en_US, platform encoding: ANSI_X3.4-1968 OS name: "linux", version: "4.4.0-128-generic", arch: "amd64", family: "uni= x" 3) The -version part is already handled by Java code. So I tried to debug Maven remotely from Eclipse, but it failed with a message saying that debug symbols were missing. I want to verify this again, but could this be a problem of the ant-build-system removing debug symbols? 4) I cannot use icedteaX (x \in {1,2}) (i.e. X=3D2 means JDK 1.7) with Maven. Is this a bug or a fact? $> guix environment -C --ad-hoc maven icedtea@2:jdk coreutils which -- mvn -version Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apac= he/maven/cli/MavenCli : Unsupported major.minor version 52.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:803) at java.security.SecureClassLoader.defineClass(SecureClassLoader.ja= va:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:442) at java.net.URLClassLoader.access$100(URLClassLoader.java:64) at java.net.URLClassLoader$1.run(URLClassLoader.java:354) at java.net.URLClassLoader$1.run(URLClassLoader.java:348) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:347) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:312) at java.lang.ClassLoader.loadClass(ClassLoader.java:412) at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedL= oadClass(Unknown Source) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(Unkno= wn Source) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(Unkno= wn Source) at org.codehaus.plexus.classworlds.launcher.Launcher.getMainClass(U= nknown Source) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced= (Unknown Source) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Unknown= Source) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCo= de(Unknown Source) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Unknown S= ource) Version 52.0 means Java 1.8. I think this is because we are now building all Java packages with ant-build-system with Icedtea@3 and letting it output Java8 code. Right? If this is the case anyway, we don't have any chance to choose a JDK to run maven with (if we choose from Guix, not from other locations). Should we then add icedtea@3 as a propagated input to maven? Then a user can directly use Maven and doesn't have to think of installing a JDK first. Mhm, maybe too strict and too heavy in size? =46rom now on I'm in a container with a fresh .m2 directory, assuming "mvn-home" is an empty directory: guix environment -C -N --share=3Dmvn-home/=3D/home/bjoern/.m2 --ad-hoc mave= n coreutils which icedtea@3:jdk 5) Maven complains about the logger output: $ENV> mvn clean install [WARNING] The SLF4J binding actually used is not supported by Maven: org.sl= f4j.impl.SimpleLoggerFactory [WARNING] Maven supported bindings are: [INFO] Scanning for projects... [...] When looking at the package definition of maven, I find in the inputs: ;; TODO: replace with maven-slf4j-provider ("java-slf4j-simple" ,java-slf4j-simple))) Is this comment related to the WARNING? Will it go away with maven-slf4j-provider? 6) Maven does not compile Java 1.8 code. To reproduce this, build any Maven project that has either source or target language version set to 1.8: 1.8 1.8 As our Maven mostly works, you can just use: $ENV> mvn archetype:generate to create a new Maven project. Edit the pom.xml to set the versions. Then [I head some problems with tests, so skipping them here]: $ENV> mvn clean install -Dmvn.tests.skip=3Dtrue -X -e [..] [INFO] --------------------------------------------------------------------= ---- [INFO] BUILD FAILURE [INFO] --------------------------------------------------------------------= ---- [INFO] Total time: 1.171 s [INFO] Finished at: 2018-06-22T22:17:21Z [INFO] --------------------------------------------------------------------= ---- [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plug= in:3.7.0:compile (default-compile) on project tst2: Fatal error compiling: = invalid source release: 1.8 -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute g= oal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-c= ompile) on project tst2: Fatal error compiling at org.apache.maven.lifecycle.internal.MojoExecutor.execute(Unknown Source) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(Unknown Source) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(Unknown Source) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject= (Unknown Source) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject= (Unknown Source) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThread= edBuilder.build(Unknown Source) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Unknown So= urce) at org.apache.maven.DefaultMaven.doExecute(Unknown Source) at org.apache.maven.DefaultMaven.doExecute(Unknown Source) at org.apache.maven.DefaultMaven.execute(Unknown Source) at org.apache.maven.cli.MavenCli.execute(Unknown Source) at org.apache.maven.cli.MavenCli.doMain(Unknown Source) at org.apache.maven.cli.MavenCli.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.ja= va:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesso= rImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Unknow= n Source) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Unknown Source) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Unkn= own Source) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Unknown Source) Caused by: org.apache.maven.plugin.MojoExecutionException: Fatal error comp= iling at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractC= ompilerMojo.java:1086) at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java= :168) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Unknown S= ource) ... 21 more Caused by: org.codehaus.plexus.compiler.CompilerException: invalid source r= elease: 1.8 at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess(= JavaxToolsCompiler.java:173) at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile(JavacCo= mpiler.java:174) at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractC= ompilerMojo.java:1075) ... 23 more Caused by: java.lang.IllegalArgumentException: invalid source release: 1.8 at com.sun.tools.javac.main.RecognizedOptions$GrumpyHelper.error(Recognize= dOptions.java:88) at com.sun.tools.javac.main.RecognizedOptions$9.process(RecognizedOptions.= java:348) at com.sun.tools.javac.api.JavacTool.processOptions(JavacTool.java:242) at com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:199) at com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:68) at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess(= JavaxToolsCompiler.java:125) ... 25 more [ERROR]=20 [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR]=20 [ERROR] For more information about the errors and possible solutions, pleas= e read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecu= tionException 7) I have some trouble executing the tests. This is indeterministic (!), sometimes is is successful, sometimes I get an error: $ENV> mvn clean install -X -e -B>stacktrace.log 2>&1; echo $? [..] [INFO] ------------------------------------------------------- [INFO] T E S T S [INFO] ------------------------------------------------------- [INFO] Running de.xxx.AppTest [INFO]=20 [INFO] Results: [INFO]=20 [INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0 [INFO]=20 [INFO] --------------------------------------------------------------------= ---- [INFO] BUILD FAILURE [INFO] --------------------------------------------------------------------= ---- [INFO] Total time: 2.981 s [INFO] Finished at: 2018-06-22T22:27:49Z [INFO] --------------------------------------------------------------------= ---- [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plug= in:2.20.1:test (default-test) on project tst2: There are test failures. [ERROR]=20 [ERROR] Please refer to /home/bjoern/x/z/tst2/target/surefire-reports for t= he individual test results. [ERROR] Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [d= ate].dumpstream and [date]-jvmRun[N].dumpstream. [ERROR] The forked VM terminated without properly saying goodbye. VM crash = or System.exit called? [ERROR] Command was /bin/sh -c cd /home/bjoern/x/z/tst2 && /gnu/store/7dah2= ha88f4sxakpgdlbfn6mvs842j6w-icedtea-3.7.0-jdk/jre/bin/java -jar /home/bjoer= n/x/z/tst2/target/surefire/surefirebooter4025948542605868366.jar /home/bjoe= rn/x/z/tst2/target/surefire 2018-06-22T22-27-48_542-jvmRun1 surefire4165566= 371678934740tmp surefire_02394075698289798736tmp [ERROR] Error occurred in starting fork, check output in log [ERROR] Process Exit Code: 1 [ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: The f= orked VM terminated without properly saying goodbye. VM crash or System.exi= t called? [ERROR] Command was /bin/sh -c cd /home/bjoern/x/z/tst2 && /gnu/store/7dah2= ha88f4sxakpgdlbfn6mvs842j6w-icedtea-3.7.0-jdk/jre/bin/java -jar /home/bjoer= n/x/z/tst2/target/surefire/surefirebooter4025948542605868366.jar /home/bjoe= rn/x/z/tst2/target/surefire 2018-06-22T22-27-48_542-jvmRun1 surefire4165566= 371678934740tmp surefire_02394075698289798736tmp [ERROR] Error occurred in starting fork, check output in log [ERROR] Process Exit Code: 1 [ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(= ForkStarter.java:686) [ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(= ForkStarter.java:535) [ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(F= orkStarter.java:280) [ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(F= orkStarter.java:245) [ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executePr= ovider(AbstractSurefireMojo.java:1124) [ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAf= terPreconditionsChecked(AbstractSurefireMojo.java:954) [ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(A= bstractSurefireMojo.java:832) [ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(U= nknown Source) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(Unknow= n Source) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(Unknow= n Source) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(Unknow= n Source) [ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buil= dProject(Unknown Source) [ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buil= dProject(Unknown Source) [ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.Sing= leThreadedBuilder.build(Unknown Source) [ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Un= known Source) [ERROR] at org.apache.maven.DefaultMaven.doExecute(Unknown Source) [ERROR] at org.apache.maven.DefaultMaven.doExecute(Unknown Source) [ERROR] at org.apache.maven.DefaultMaven.execute(Unknown Source) [ERROR] at org.apache.maven.cli.MavenCli.execute(Unknown Source) [ERROR] at org.apache.maven.cli.MavenCli.doMain(Unknown Source) [ERROR] at org.apache.maven.cli.MavenCli.main(Unknown Source) [ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccesso= rImpl.java:62) [ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMetho= dAccessorImpl.java:43) [ERROR] at java.lang.reflect.Method.invoke(Method.java:498) [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhance= d(Unknown Source) [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Unknow= n Source) [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitC= ode(Unknown Source) [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Unknown = Source) [ERROR] -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute g= oal org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test (default-tes= t) on project tst2: There are test failures. [..] 8) BTW maven is NOT creating a reproducible output. That's important if you want to use it to as a build tool for Guix: $ENV> jar tvvf ~/.m2/repository/de/xxx/tst2/1.0-SNAPSHOT/tst2-1.0-SNAPSHOT.jar 110 Fri Jun 22 22:29:26 GMT 2018 META-INF/MANIFEST.MF 0 Fri Jun 22 22:29:26 GMT 2018 META-INF/ That's it for now.=20 Bj=C3=B6rn --Sig_/28N8eH4E2kr=Z0E7diLHJza Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlsteqgACgkQvyhstlk+X/2VRwCgpGxGOgxqRw+6GvjDR5xogEbW 2LsAmwfPJ1AkRMl2iB/WHAIlyJjoFOIJ =duSi -----END PGP SIGNATURE----- --Sig_/28N8eH4E2kr=Z0E7diLHJza--