There's nothing that special about MY stack trace... just run javac on a 
largish module with a tiny heap.
(Our module was huge enough to fail with 800 megs, but there are plenty modules 
that will fail with 8 megs, let alone one meg.)
Further, the exact stack trace is very sensitive to the exact amount of heap I 
give it; I tried varying it and it fails in totally different places.
In fact, depending on the exact heap size, sometimes the stack trace doesn't go 
all the way back to main() and other times it does.
I have no idea how to explain that last part... maybe depth is limited??
I will try this again with new and improved plexus version and report back.
In the meantime, I have a question.  Why is maven in the business of trying to 
"parse" the output of javac?
Why can't it give me its output verbatim, as if javac were a mysterious black 
box binary blob with totally unknown behaviour?

-----Original Message-----
From: Alexander Kriegisch <alexan...@kriegisch.name> 
Sent: Friday, December 22, 2023 10:23 PM
To: users@maven.apache.org
Subject: Re: maven debugging frustrations


CAUTION: This email originated from outside our organisation - 
alexan...@kriegisch.name Do not click on links, open attachments, or respond 
unless you recognize the sender and can validate the content is safe.
>> How can I can find out EXACTLY how maven invoked javac, so I can 
>> invoke it the same way?

I think, somebody already mentioned earlier that you can just activate debug 
output in Maven. Then search for the line following "Command line
options":

$ mvn -X compile | grep --after-context 1 'Command line options'

[DEBUG] Command line options:
[DEBUG] -d ...\target\classes -classpath ... 
src\main\java\org\example\Main.java -s ... -processor ... -g -target 1.8 
-source 1.8 -encoding UTF-8

Copy everything from the last line agter "[DEBUG] " and paste it right behind 
"javac ". That should be your exact command.

> Okay, I think I got it.  Here is the error I get when running with  
> -J-Xmx800
>
> <snip warnings about using internal APIs> The system is out of 
> resources.
> Consult the following stack trace for details.
> java.lang.OutOfMemoryError: GC overhead limit exceeded <snip long 
> stack trace from the depths of javac>

Sorry to bother you again, but two more requests:

  1. Can you please paste more of the stack trace? That would make for a
     good (as in realistic) unit or integration test.

  2. I think, my PR in the recently released Plexus Compiler 2.14.2
     should at least enable you to get the stack trace printed. The two
     header lines beginning with "The system is out of resources"
     probably will be cut off. Anyway, that would be better than
     nothing. Can you please retest? In Maven, that would go like this
     (fragmentary POM):

<properties>
  <plexusCompilerVersion>2.14.2</plexusCompilerVersion>
</properties>

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-compiler-plugin</artifactId>
  <version>3.12.0</version>
  <dependencies>
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-compiler-api</artifactId>
      <version>${plexusCompilerVersion}</version>
    </dependency>
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-compiler-manager</artifactId>
      <version>${plexusCompilerVersion}</version>
    </dependency>
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-compiler-javac</artifactId>
      <version>${plexusCompilerVersion}</version>
      <scope>runtime</scope>
    </dependency>
  </dependencies>
</plugin>

--
Alexander Kriegisch
https://clicktime.symantec.com/15siFBaoYbM4wmfMjZKMr?h=isWwo2pYTjyI3SuGICAE9ZFT6R_DSWTZSKkBbg1NX0E=&u=https://scrum-master.de

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


This message is for information purposes only. It is not a recommendation, 
advice, offer or solicitation to buy or sell a product or service, nor an 
official confirmation of any transaction. It is directed at persons who are 
professionals and is intended for the recipient(s) only. It is not directed at 
retail customers. This message is subject to the terms at: 
https://www.cib.barclays/disclosures/web-and-email-disclaimer.html. 

For important disclosures, please see: 
https://www.cib.barclays/disclosures/sales-and-trading-disclaimer.html 
regarding marketing commentary from Barclays Sales and/or Trading desks, who 
are active market participants; 
https://www.cib.barclays/disclosures/barclays-global-markets-disclosures.html 
regarding our standard terms for Barclays Corporate and Investment Bank where 
we trade with you in principal-to-principal wholesale markets transactions; and 
in respect to Barclays Research, including disclosures relating to specific 
issuers, see: http://publicresearch.barclays.com.
__________________________________________________________________________________
 
If you are incorporated or operating in Australia, read these important 
disclosures: 
https://www.cib.barclays/disclosures/important-disclosures-asia-pacific.html.
__________________________________________________________________________________
For more details about how we use personal information, see our privacy notice: 
https://www.cib.barclays/disclosures/personal-information-use.html. 
__________________________________________________________________________________

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

Reply via email to