AdoptOpenJDK/jitwatch

maven source and classes loading enhancement

leonchen83 opened this issue · 3 comments

Hi

  1. most project written in java now using maven to manage source code and classes and its dependency.
    could jitwatch provide an esay way to load maven source code and its target classes, like parse a pom file to load it and its sub-module source, dependency jar.

  2. could jitwatch provide a bash command to parse jit log and output to stdout or a file(html format). than we can execute it with daily building.

Hi @leonchen83 I like the maven idea :)

Do you have any idea of what mechanism might be possible to fetch the dependencies and especially their sources from maven central?

for 2) There is already a way to launch JITWatch from the command line and get the results as CSV
format:https://github.com/AdoptOpenJDK/jitwatch/wiki/Headless-Mode Does this meet your needs?

Kind regards,

Chris

source location and classes location can parse pom, for example

    <name>Demo Parent</name>
    <packaging>pom</packaging>
    <version>1.0-SNAPSHOT</version>
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.demo</groupId>
    <artifactId>demo-parent</artifactId>
    
    <modules>
        <module>demo-api</module>
        <module>demo-rcp</module>
        <module>demo-web</module>
        <module>demo-core</module>
    </modules>
    ...

step1: if this pom‘s path in /path/to/demo/pom.xml and packagingis pom
then we load all sub-modules's path

/path/to/demo/demo-api/pom.xml
/path/to/demo/demo-rcp/pom.xml
/path/to/demo/demo-web/pom.xml
/path/to/demo/demo-core/pom.xml

step2: if sub-module's packagingis jar or not set. then we can locate the source and classes path or we do recusive step:1

//source
/path/to/demo/demo-api/src/main/java
/path/to/demo/demo-rcp/src/main/java
/path/to/demo/demo-web/src/main/java
/path/to/demo/demo-core/src/main/java
//classes 
/path/to/demo/demo-api/target/classes
/path/to/demo/demo-api/target/generated-classes
/path/to/demo/demo-rcp/target/classes
/path/to/demo/demo-rcp/target/generated-classes
/path/to/demo/demo-web/target/classes
/path/to/demo/demo-web/target/generated-classes
/path/to/demo/demo-core/target/classes
/path/to/demo/demo-core/target/generated-classes

to get all dependencies we can use mvn command mvn dependency:copy-dependencies -DincludeScope=runtime -DoutputDirectory=/path/to/libs

Hi, I'm closing all the issues except for the ones I'm actively working on.