Re: Java9

2017-05-22 Thread Matt Sicker
Splitting the Java 9 code into its own module and shading that back in to log4j-api seems like it could work for now. I'd imagine that as Java 9 gets released or sometime soon hopefully, the IDEs will start adding support for multi-version modules/projects. On 22 May 2017 at 11:16, Remko Popma wr

Re: Java9

2017-05-22 Thread Remko Popma
One idea: we could move (actually copy) the StackLocator interface to the Java 9 module. This allows us to build the Java 9 module first. Then, when building the log4j-api module, the Java 9 classes can be shaded into the log4j-api jar (excluding StackLocator since we want to compile that interface

Re: Java9

2017-05-22 Thread Ralph Goers
Java 9 now has a —release option which should help. However, if we set it to Java 7 I suspect the build will fail on the Java 9 stuff even though we are using the Java 9 compiler. I really don’t see a way to do this except by calling the compiler multiple times. Ralph > On May 22, 2017, at 8:4

Re: Java9

2017-05-22 Thread Matt Sicker
I still want to see a better Maven plugin for handling Java 9 multi-release jars and things like that. The whole Java 9 build is still rather hacky. If the entire project was buildable in Java 9 and could still target 7, 8, and 9, then that would be a simpler solution IMO. On 22 May 2017 at 06:16,

Re: Java9

2017-05-22 Thread Mikael Ståldal
IntelliJ IDEA is "smart" enough to automatically pick up the src/main/java9 folder. On 2017-05-21 22:26, Ralph Goers wrote: Since src/main/java9 isn’t normally considered a source directory you should be able to work with Java 7 as well. It will just ignore the Java 9 files. Ralph On May 2

Re: Java9

2017-05-21 Thread Ralph Goers
> On May 21, 2017, at 7:32 PM, Remko Popma wrote: > > >> On May 22, 2017, at 8:57, Ralph Goers wrote: >> >> When you run the release plugin the artifact is deployed when the module >> gets to the deploy phase. Thus any shading would take place too late to do >> any good. > > I think there'

Re: Java9

2017-05-21 Thread Gary Gregory
On May 21, 2017 7:32 PM, "Remko Popma" wrote: > On May 22, 2017, at 8:57, Ralph Goers wrote: > > When you run the release plugin the artifact is deployed when the module gets to the deploy phase. Thus any shading would take place too late to do any good. I think there's a misunderstanding: the

Re: Java9

2017-05-21 Thread Remko Popma
> On May 22, 2017, at 8:57, Ralph Goers wrote: > > When you run the release plugin the artifact is deployed when the module gets > to the deploy phase. Thus any shading would take place too late to do any > good. I think there's a misunderstanding: the shade plugin is bound to the package ph

Re: Java9

2017-05-21 Thread Ralph Goers
When you run the release plugin the artifact is deployed when the module gets to the deploy phase. Thus any shading would take place too late to do any good. It could be done if we renamed log4j-api to something else and then disable the deploy in the module. Then the new log4j-api could create

Re: Java9

2017-05-21 Thread Remko Popma
> On May 22, 2017, at 5:30, Ralph Goers wrote: > > I’m not sure how to make it be any better than this. Although the Java 9 > classes could be removed we would just have to put them back in a couple of > months when Java 9 is released. Putting them in a separate module is not a > great option

Re: Java9

2017-05-21 Thread Gary Gregory
In Eclipse Oxygen with the Java 9 beta support addon, I setup the log4j-api project with Java 9 and Java 7 as the target and it works. I have not checked with the latest Java9 folder though. We are on the bleeding edge for sure here. The only part that is not great is that we require Java 9 to be

Re: Java9

2017-05-21 Thread Ralph Goers
I’m not sure how to make it be any better than this. Although the Java 9 classes could be removed we would just have to put them back in a couple of months when Java 9 is released. Putting them in a separate module is not a great option as that will require an additional jar to run in Java 9. R

Re: Java9

2017-05-21 Thread Ralph Goers
Since src/main/java9 isn’t normally considered a source directory you should be able to work with Java 7 as well. It will just ignore the Java 9 files. Ralph > On May 21, 2017, at 5:50 AM, Gary Gregory wrote: > > I set the JRE for that project to Java 9. I do not think you can set the > JRE pe

Re: Java9

2017-05-21 Thread Mikael Ståldal
Same with IntelliJ IDEA. You can set JRE per module (such as log4j-api, log4j-core), but not per source folder. So this is not enough to fix it. But it is better than nothing, so please keep it. And do the same for tests if/when we add any tests for the code in src/main/java9. I am now able

Re: Java9

2017-05-21 Thread Mikael Ståldal
We need to fix this very soon. It is not acceptable to have the project master branch in a state which breaks both of the two most popular Java IDEs. In IntelliJ I now get stuck at com.sun.tools.jconsole.JConsolePlugin not found in log4j-jmx-gui. If we cannot fix this in a timely manner, I s

Re: Java9

2017-05-21 Thread Gary Gregory
I set the JRE for that project to Java 9. I do not think you can set the JRE per source folder, only per project. Gary On May 21, 2017 1:29 AM, "Ralph Goers" wrote: I’ve modified the build to put the Java 9 classes of the API into a separate source directory. Can you see if that helps things in