Re: creating a source directory on the fly

2023-12-09 Thread Dave Dyer


That was my first thought too, but unfortunately my build includes
a custom build plugin (which I don't control) which does its own
ad-hoc parsing of the project structure.  So it only works if the
project is actually structured in a certain way.

At 12:32 PM 12/9/2023, Michael Osipov wrote:
>On 2023/12/06 03:34:58 Dave Dyer wrote:
>> 
>> I'm trying to tune up my maven build, which requires that I construct
>> a source directory on the fly by copying from the canonical location.
>> 
>> The best advice I've found is to use mavin-resources-plugin, but
>> that's a bit inelegant because it copies everything, not just the
>> sources.
>
>That the wrong approach.
>
>> Is there a better approach?
>
>The right approach: 
>https://www.mojohaus.org/build-helper-maven-plugin/add-source-mojo.html



-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



RE: creating a source directory on the fly

2023-12-06 Thread Dave Dyer
At 06:55 AM 12/6/2023, mark.yagnatin...@barclays.com.INVALID wrote:
>Pretty sure that plugin is flexible enough to just copy what you tell it to?
>https://maven.apache.org/plugins/maven-resources-plugin/examples/include-exclude.html

Thanks.  I just hadn't encountered the right examples!



-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



creating a source directory on the fly

2023-12-05 Thread Dave Dyer


I'm trying to tune up my maven build, which requires that I construct
a source directory on the fly by copying from the canonical location.

The best advice I've found is to use mavin-resources-plugin, but
that's a bit inelegant because it copies everything, not just the
sources.

Is there a better approach?


-
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?

2023-12-04 Thread Dave Dyer


I think I've peeled the next layer of the onion.  The maven
build I'm using doesn't call javac as part of the build process;
Instead it uses the classes already produced by Eclipse, which
supports debugging and development.  These classes are not optimized
at all, and in particular each class is compiled separately, as though
it would be linked at runtime with an arbitrary set of other classes.

In normal delivery environments, these ignorant-of-others classes
would be presented to a JIT which would resolve all the linkages
and optimize things like field references and enum dispatches,
so the lack of optimization at the class level might be unimportant.

Does this make sense?


-
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?

2023-12-04 Thread Dave Dyer
Thanks, I'll follow up by trying to extract detailed info about
what maven is actually doing.  Its not my build script; I'm just
trying to figure out why the "better" Maven build is producing
worse results than the Ant build it is supposed to replace.

At 11:52 PM 12/3/2023, Bernd Eckenfels wrote:
>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


-
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?

2023-12-03 Thread Dave Dyer


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?

2023-12-03 Thread Dave Dyer


>
>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?

2023-12-03 Thread Dave Dyer


>
>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



what javac is actually used?

2023-12-03 Thread Dave Dyer


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