Re: what javac is actually used?
Hallo, Dave Dyer wrote on 4. Dec 2023 08:27 (GMT +01:00): > It seems odd to me for maven to have its own javac, It does not, when you use the compiler plugin in the default config it uses the Java compiler from the JDK you started maven with. It just uses the Tool API instead of the cli, but it’s basically same functionality. You have either different JDKs or the settings are different. Most likely you did not set a release version, since maven does not default to the JDK version you are building with. > For starters I'd like to convince maven to use one lf mine. You can use toolchain and fork options, but I think you mostly need to use correct release switch I suspect. https://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-release.html https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html Gruß Bernd - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: what javac is actually used?
I can supply sources and class files. The differences in product are far from trivial. Real javac produces explicit subclasses where mavin does not. It seems odd to me for maven to have its own javac, but For starters I'd like to convince maven to use one of mine. At 06:57 PM 12/3/2023, Alexander Kriegisch wrote: >Interesting problem. I think, it would make sense to get a minimal >reproducer project showcasing the differences in the generated byte >code. Probably there is some way for javax.tools.JavaCompiler to create >identical byte code by setting the right combination of options. If >something is missing in the Maven Compiler options or mishandled in >Plexus, that could then be added or fixed. Otherwise, someone could >instruct the OP how to use the existing options to achieve what he >wants. WDYT? > >-- >Alexander Kriegisch >https://scrum-master.de > > >Olivier Lamy schrieb am 04.12.2023 04:39 (GMT +07:00): > >> Hi, >> If by javac you mean the cli, per default m-compiler-p is not using >> exactly this but in the process javax.tools.JavaCompiler. >> If you want to really use javac (and so forking the compilation) you >> must configure it via the fork option >> (https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#fork) >> >> >> On Mon, 4 Dec 2023 at 07:07, Dave Dyer wrote: >>> >>> >>> > >>> >Maven, by default uses maven-compiler-plugin, but that plugin itself is >>> >pluggable (can use javac, which is default, but also eclipse compiler, >>> >etc). >>> >The plugin by default uses javac. >>> >>> The build I'm using seems to not be using javac - where is guidance >>> to configuring it? >>> >>> >>> - >>> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org >>> For additional commands, e-mail: users-h...@maven.apache.org >>> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org >> For additional commands, e-mail: users-h...@maven.apache.org >> >> > >- >To unsubscribe, e-mail: users-unsubscr...@maven.apache.org >For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: what javac is actually used?
Afaict, running with debug logs (mvn -X) will print the arguments passed to the compiler, such that they can be passed to javac with Maven pushed out if the equation. They can then be inspected and tweaked, and then maven-compiler-plugin configuration (hopefully) adjusted to what's expected. Le lun. 4 déc. 2023, 03:58, Alexander Kriegisch a écrit : > Interesting problem. I think, it would make sense to get a minimal > reproducer project showcasing the differences in the generated byte > code. Probably there is some way for javax.tools.JavaCompiler to create > identical byte code by setting the right combination of options. If > something is missing in the Maven Compiler options or mishandled in > Plexus, that could then be added or fixed. Otherwise, someone could > instruct the OP how to use the existing options to achieve what he > wants. WDYT? > > -- > Alexander Kriegisch > https://scrum-master.de > > > Olivier Lamy schrieb am 04.12.2023 04:39 (GMT +07:00): > > > Hi, > > If by javac you mean the cli, per default m-compiler-p is not using > > exactly this but in the process javax.tools.JavaCompiler. > > If you want to really use javac (and so forking the compilation) you > > must configure it via the fork option > > ( > https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#fork > ) > > > > > > On Mon, 4 Dec 2023 at 07:07, Dave Dyer wrote: > >> > >> > >> > > >> >Maven, by default uses maven-compiler-plugin, but that plugin itself is > >> >pluggable (can use javac, which is default, but also eclipse compiler, > etc). > >> >The plugin by default uses javac. > >> > >> The build I'm using seems to not be using javac - where is guidance > >> to configuring it? > >> > >> > >> - > >> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > >> For additional commands, e-mail: users-h...@maven.apache.org > >> > > > > - > > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > > For additional commands, e-mail: users-h...@maven.apache.org > > > > > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > >
Re: what javac is actually used?
Interesting problem. I think, it would make sense to get a minimal reproducer project showcasing the differences in the generated byte code. Probably there is some way for javax.tools.JavaCompiler to create identical byte code by setting the right combination of options. If something is missing in the Maven Compiler options or mishandled in Plexus, that could then be added or fixed. Otherwise, someone could instruct the OP how to use the existing options to achieve what he wants. WDYT? -- Alexander Kriegisch https://scrum-master.de Olivier Lamy schrieb am 04.12.2023 04:39 (GMT +07:00): > Hi, > If by javac you mean the cli, per default m-compiler-p is not using > exactly this but in the process javax.tools.JavaCompiler. > If you want to really use javac (and so forking the compilation) you > must configure it via the fork option > (https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#fork) > > > On Mon, 4 Dec 2023 at 07:07, Dave Dyer wrote: >> >> >> > >> >Maven, by default uses maven-compiler-plugin, but that plugin itself is >> >pluggable (can use javac, which is default, but also eclipse compiler, etc). >> >The plugin by default uses javac. >> >> The build I'm using seems to not be using javac - where is guidance >> to configuring it? >> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org >> For additional commands, e-mail: users-h...@maven.apache.org >> > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: what javac is actually used?
Hi, If by javac you mean the cli, per default m-compiler-p is not using exactly this but in the process javax.tools.JavaCompiler. If you want to really use javac (and so forking the compilation) you must configure it via the fork option (https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#fork) On Mon, 4 Dec 2023 at 07:07, Dave Dyer wrote: > > > > > >Maven, by default uses maven-compiler-plugin, but that plugin itself is > >pluggable (can use javac, which is default, but also eclipse compiler, etc). > >The plugin by default uses javac. > > The build I'm using seems to not be using javac - where is guidance > to configuring it? > > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: what javac is actually used?
Howdy, Simplest would be that in module where you found afore mentioned differences ask for effective pom: $ mvn help:effective-pom Maybe pipe it to a file as it may be huge. Then look for project/build/plugins/maven-compiler-plugin (quasi xpath). T On Sun, Dec 3, 2023, 22:08 Dave Dyer wrote: > > > > >Maven, by default uses maven-compiler-plugin, but that plugin itself is > >pluggable (can use javac, which is default, but also eclipse compiler, > etc). > >The plugin by default uses javac. > > The build I'm using seems to not be using javac - where is guidance > to configuring it? > > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > >
Re: what javac is actually used?
> >Maven, by default uses maven-compiler-plugin, but that plugin itself is >pluggable (can use javac, which is default, but also eclipse compiler, etc). >The plugin by default uses javac. The build I'm using seems to not be using javac - where is guidance to configuring it? - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: what javac is actually used?
> >Inferior bytecode means what in this case? It's a little outside my comfort zone, but it appears that some virtual methods are inlined by most java compilers, but are real funcion calls as produced by maven. There may be more but that was the smoking gun. It's not a bleeding edge javac feature - my comparison is java 1.8.x. I can supply samples if someone is investigating. In my worst case, frame times are 30ms with standard java and 180ms with maven produced builds, so in aggregate it's not a trivial difference. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: what javac is actually used?
Howdy, Maven, by default uses maven-compiler-plugin, but that plugin itself is pluggable (can use javac, which is default, but also eclipse compiler, etc). The plugin by default uses javac. But, for example maven compiler plugin _by default_ enables debug: https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#debug Inferior bytecode means what in this case? HTH Tamas On Sun, Dec 3, 2023 at 8:48 PM Dave Dyer wrote: > > The problem I'm investigating is that the code produced by a > maven build is different, and inferior, to the code produced > but any javac I can find. My questions are, what java compiler > is it actually using, and of course, how can I change it? > > The best info I have is that it's using plexus-compiler-javac\2.8.4 > also, attempting to configure the maven-compiler-plugin artifact > only changes what jdk is used to invoke the plexus compiler, not > the compiler actually used to produce classes. > > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > >
what javac is actually used?
The problem I'm investigating is that the code produced by a maven build is different, and inferior, to the code produced but any javac I can find. My questions are, what java compiler is it actually using, and of course, how can I change it? The best info I have is that it's using plexus-compiler-javac\2.8.4 also, attempting to configure the maven-compiler-plugin artifact only changes what jdk is used to invoke the plexus compiler, not the compiler actually used to produce classes. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
[ANN] Maven Javadoc Plugin 3.6.3 released
The Apache Maven team is pleased to announce the release of the Maven Javadoc Plugin, version 3.6.3. This module generates browsable HTML pages from Java source code. https://maven.apache.org/plugins/maven-javadoc-plugin/ You should specify the version in your project's plugin configuration: org.apache.maven.plugins maven-javadoc-plugin 3.6.3 Release Notes - Maven Javadoc Plugin - Version 3.6.3 ** Bug * [MJAVADOC-682] - Reactor builds fail when multiple modules with same groupId:artifactId, but different versions * [MJAVADOC-780] - Unit tests create null-null.jar in build root directory ** Improvement * [MJAVADOC-779] - Upgrade maven-plugin parent to 41 ** Task * [MJAVADOC-782] - Align read-only parameters naming with other plugins ** Dependency upgrade * [MJAVADOC-781] - Upgrade plugins and components (in ITs) Enjoy, -The Apache Maven team - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org