Displaying #maven-dev/2017-04-18.log:

Tue Apr 18 08:41:34 2017  tibor_:Joined the channel
Tue Apr 18 11:17:15 2017  mbenson_away:Joined the channel
Tue Apr 18 16:46:24 2017  rfscholte:Joined the channel
Tue Apr 18 18:08:31 2017  rfscholte:Joined the channel
Tue Apr 18 19:21:57 2017  rfscholte:Joined the channel
Tue Apr 18 19:57:35 2017  tibor_:Joined the channel
Tue Apr 18 20:00:29 2017  tibor_:@rfscholte: Hi Robert. Detecting Java version is important because I can decide if calling new functionality or the old one - new CLI command. Would you commit a change to compiler tomorrow? Would it be a good motivation for me?
Tue Apr 18 20:03:37 2017  rfscholte:tibor_: I think you should make a multirelease jar in that case.
Tue Apr 18 20:04:02 2017  rfscholte:this usecase fits that purpose very well
Tue Apr 18 20:08:40 2017  tibor_:Robert, can you send me a concept?
Tue Apr 18 20:10:09 2017  tibor_:what we know is that src/test/java has normal jar with no versions
Tue Apr 18 20:10:53 2017  tibor_:i think we used different CLI and avoided manifest
Tue Apr 18 20:19:13 2017  rfscholte:which class needs to be rewritten?
Tue Apr 18 20:19:36 2017  tibor_:@rfscholte: First of all I should invoke CLI java -jar surefire.jar with manifest and see the issue again.
Tue Apr 18 20:19:56 2017  tibor_:Fork*Configurations
Tue Apr 18 20:20:02 2017  tibor_:Fork*Configuration
Tue Apr 18 20:21:34 2017  tibor_:ForkConfiguration#createJar()
Tue Apr 18 20:22:27 2017  tibor_:and then cli in #createCommandLine()
Tue Apr 18 20:26:13 2017  tibor_:@rfscholte: I hardly remember the details how we wanted to run the jar in jdk9. I know that we did not want to create multi versioned jar from src/test/java. Instead wanted to specify module classpath.
Tue Apr 18 20:30:10 2017  rfscholte:rereading surefire-1262
Tue Apr 18 20:32:14 2017  rfscholte:tibor_: I think we should split this into 2 separate issues: isolated and fork and start with the easy one
Tue Apr 18 20:32:37 2017  tibor_:isolated?
Tue Apr 18 20:34:13 2017  tibor_:probably you mean in-process run
Tue Apr 18 20:34:21 2017  tibor_:in-plugin
Tue Apr 18 20:34:34 2017  rfscholte:you're the surefire guru ;)
Tue Apr 18 20:37:21 2017  tibor_:@rfscholte: Did we want to use --patch-module instead of Class-Path in Manifest?
Tue Apr 18 20:37:40 2017  tibor_:in fork mode
Tue Apr 18 20:38:07 2017  tibor_:jigsaw does not support manifest?
Tue Apr 18 20:38:22 2017  rfscholte:in case there's a src/nmain/java/module-info.java file, you cannot use ClassPath manifest anymore
Tue Apr 18 20:38:42 2017  tibor_:yes
Tue Apr 18 20:39:56 2017  tibor_:If we do not create or encapsulate module-info.class in jar file the depedencies can be used as before?
Tue Apr 18 20:41:25 2017  rfscholte:even jar + module-info.class can be used with Java 8 and before, this file is simply ignored
Tue Apr 18 20:41:51 2017  rfscholte:just be sure source/target is correct
Tue Apr 18 20:41:56 2017  tibor_:Why then the users got this error java.lang.NoClassDefFoundError: java/sql/SQLException
Tue Apr 18 20:45:35 2017  rfscholte:java.sql is a separate module
Tue Apr 18 20:45:49 2017  tibor_:So what can we use instead of old class path? Would it be --patch-module in CLI?
Tue Apr 18 20:46:17 2017  tibor_:I think we wanted to specify classpath in @file
Tue Apr 18 20:46:27 2017  rfscholte:modulepath
Tue Apr 18 20:49:24 2017  rfscholte:maybe better to start with ITs to understand the issues
Tue Apr 18 20:50:54 2017  tibor_:I believe the users will have normal jar files produced by dependencies and then would expect the same run under JDK9 as before.
Tue Apr 18 20:51:41 2017  tibor_:Yes I can try to write and run IT under JDK9.
Tue Apr 18 21:05:41 2017  rfscholte:"{{module-info.class}} is produced by javac."
Tue Apr 18 21:05:50 2017  rfscholte:no, that's not true
Tue Apr 18 21:05:57 2017  rfscholte:you must write it yourself
Tue Apr 18 21:08:38 2017  tibor_:right
Tue Apr 18 21:08:53 2017  tibor_:module-info.java
Tue Apr 18 21:09:38 2017  rfscholte:I read it like javac does some magic and suddenly that file is there...
Tue Apr 18 21:14:10 2017  tibor_:SUREFIRE-1265 contains attachment
Tue Apr 18 21:14:20 2017  tibor_:I set java home to jdk9
Tue Apr 18 21:14:26 2017  tibor_:and reproduced the issue
Tue Apr 18 21:14:38 2017  tibor_:interesting is the compiler settings
Tue Apr 18 21:15:03 2017  tibor_:--add-modules
Tue Apr 18 21:15:10 2017  tibor_:java.corba
Tue Apr 18 21:15:26 2017  tibor_:maven-compiler-plugin:3.1
Tue Apr 18 21:15:38 2017  tibor_:no module-info.class
Tue Apr 18 21:15:55 2017  tibor_:I will try to remove the <arg>
Tue Apr 18 21:17:39 2017  tibor_:The same problem
Tue Apr 18 21:17:40 2017  tibor_:failed: java.lang.NoClassDefFoundError: java/sql/SQLException: java.sql.SQLException
Tue Apr 18 21:19:36 2017  rfscholte:and what if you say MAVEN_OPTS=--add-modules java.corba
Tue Apr 18 21:20:27 2017  tibor_:wait a second
Tue Apr 18 21:20:41 2017  tibor_:after removed compiler completely: J9Test.java:[8,54] package org.omg.CORBA does not exist
Tue Apr 18 21:20:43 2017  tibor_:because
Tue Apr 18 21:20:53 2017  tibor_:public void test_corba_mod() throws org.omg.CORBA.BAD_INV_ORDER {}
Tue Apr 18 21:21:51 2017  tibor_:Now I removed throws clausule
Tue Apr 18 21:21:55 2017  tibor_:and got
Tue Apr 18 21:21:55 2017  tibor_:failed: java.lang.NoClassDefFoundError: java/sql/SQLException: java.sql.SQLException
Tue Apr 18 21:22:09 2017  tibor_:Now I go back to your proposal
Tue Apr 18 21:23:30 2017  tibor_:After setting MAVEN_OPTS=--add-modules java.corba I have the same problem
Tue Apr 18 21:23:40 2017  tibor_:failed: java.lang.NoClassDefFoundError: java/sql/SQLException: java.sql.SQLException
Tue Apr 18 21:24:44 2017  tibor_:with/out MAVEN_OPTS, and with no m-compiler-p in POM and no <argLine> in surefire and no module-info, we still have NoClassDefFoundError.
Tue Apr 18 21:26:22 2017  tibor_:This POM has only junit dependency.
Tue Apr 18 21:28:08 2017  rfscholte:in this case: fork is the problem
Tue Apr 18 21:28:30 2017  tibor_:@rfscholte: I think Wildfly server must have the same problem and other big projects.
Tue Apr 18 21:29:15 2017  rfscholte:removing forkCount=1 makes it succeed
Tue Apr 18 21:29:23 2017  tibor_:Why fork is the problem? Because of the Class-Path header in manifest?
Tue Apr 18 21:30:53 2017  tibor_:@Parameter( property = "forkCount", defaultValue = "1" )
Tue Apr 18 21:32:00 2017  tibor_:After removing forkCount, the same issue NoClassDefFoundError.
Tue Apr 18 21:35:11 2017  rfscholte:it's been too long when I worked on this topic. Need some time to see what's happening
Tue Apr 18 21:37:09 2017  tibor_:It's old story for me too.
Tue Apr 18 21:38:59 2017  tibor_:I am thinking like what Wildfly would do in this case. I know their scripts, the use env.CLASS_PATH, but not sure if the will strictly cut off old release and now new Wildfly will be able to go with java 9 and higher.
Tue Apr 18 21:44:46 2017  tibor_:With a config param we can switch to env.class_path too.
Tue Apr 18 21:48:45 2017  tibor_:<useManifestOnlyJar>false</useManifestOnlyJar> same problem
Tue Apr 18 21:51:02 2017  tibor_:maybe we should try to run a trivial jar directly from cli
Tue Apr 18 21:51:04 2017  rfscholte:it's the isolatedclassloader which can't locate the class.
Tue Apr 18 21:51:27 2017  hboutemy:Joined the channel
Tue Apr 18 21:51:36 2017  tibor_:but this CL should not be used in fork mode
Tue Apr 18 21:52:11 2017  rfscholte:in that case you must explicit add java.sql as module
Tue Apr 18 21:52:13 2017  tibor_:the purpose isolatedclassloader is if forkCount=0
Tue Apr 18 21:53:13 2017  tibor_:how can we add the module
Tue Apr 18 21:54:03 2017  rfscholte:I would expect --add-modules java.sql
Tue Apr 18 21:55:32 2017  tibor_:it must be in API level
Tue Apr 18 21:55:35 2017  tibor_:I see now
Tue Apr 18 21:55:44 2017  tibor_:It's not the forking problem
Tue Apr 18 21:55:45 2017  tibor_:Iterable<Class<?>> getSuitesIterator()
Tue Apr 18 21:57:08 2017  tibor_:In ForkStarter we load test classes in IsolatedCL. The purpose is test filtering on annotation level @Test..
Tue Apr 18 21:57:43 2017  tibor_:So not in level of starting jvm, but before starting it => filtering tests.
Tue Apr 18 21:58:14 2017  rfscholte:ah, I see
Tue Apr 18 21:58:15 2017  tibor_:Therefore we need to ass java.sql and java.* on API level in IsolatedCL.
Tue Apr 18 21:58:18 2017  tibor_:how?
Tue Apr 18 21:58:22 2017  tibor_:add
Tue Apr 18 21:58:53 2017  tibor_:because we construct a list of jar files URI.
Tue Apr 18 22:00:20 2017  rfscholte:reading http://download.java.net/java/jigsaw/docs/api/java/lang/ClassLoader.html
Tue Apr 18 22:00:25 2017  tibor_:thx
Tue Apr 18 22:03:39 2017  tibor_:we use URLClassLoader #addURL()
Tue Apr 18 22:04:54 2017  tibor_:Good progress.
Tue Apr 18 22:05:02 2017  tibor_:One way or another.
Tue Apr 18 22:05:08 2017  rfscholte::)
Tue Apr 18 22:05:23 2017  tibor_:We with Kristian agreed that getSuitesIterator() is hack.
Tue Apr 18 22:06:03 2017  tibor_:it is a problem that your test class and static context is loaded in-plugin process due to filtering classes and second time in forked JVM.
Tue Apr 18 22:06:26 2017  tibor_:The better would be to avoid this amke make filtering in JVM.
Tue Apr 18 22:06:34 2017  tibor_:but this would change a lot.
Tue Apr 18 22:07:26 2017  tibor_:Some kind of communication between processes. That's one of the reasons why I am changing the communication, and sream format.
Tue Apr 18 22:07:29 2017  rfscholte:jigsaw punishes you for hacks
Tue Apr 18 22:07:59 2017  tibor_:So that the forked jvm and maven process would negotiate what to test and how deeply.
Tue Apr 18 22:08:30 2017  tibor_:But this is a lot of to do to remove current code.
Tue Apr 18 22:08:44 2017  tibor_:stream
Tue Apr 18 22:09:30 2017  rfscholte:enough for today :)
Tue Apr 18 22:09:43 2017  tibor_:yes, thx for help
Tue Apr 18 22:10:08 2017  hboutemy:Joined the channel
Tue Apr 18 22:28:20 2017  hboutemy:Joined the channel
Tue Apr 18 22:45:59 2017  hboutemy:Joined the channel

Comments