sevntu-checkstyle / dsm-maven-plugin

Maven plugin to create HTML report to show dependecies in DSM view.
14 stars 5 forks source link

Support of Java8 #31

Closed ychulovskyy closed 6 years ago

ychulovskyy commented 9 years ago

Looks like plugin doesn't support Java 8. Source code:

import java.util.Arrays;
import java.util.List;

public class MyTest {
    private static List<String> list = Arrays.asList("a", "b", "c");

    public static void main(String ... args) {
        list.forEach(System.out::println);
    }
}

Compiler: Oracle JDK 1.8.0_05-b13 Error message: [ERROR] Failed to execute goal com.github.sevntu-checkstyle:dsm-maven-plugin:2.1.3:dsm (default-cli) on project my-test-app: An error has occurred in DSM Report report generation. Error in DSM Report generation. Could not parse file:MyTest.c lass: Unknown constant: 18 -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.sevntu-checkstyle:dsm-maven-plugin:2.1.3:dsm (default-cli) on project my-test-app: An error has occurred in DSM Report report generation. ... Caused by: java.lang.RuntimeException: Could not parse file:MyTest.class at org.dtangler.javaengine.classfileparser.ClassFileParser.parse(ClassFileParser.java:50) at org.dtangler.javaengine.dependencyengine.JavaDependencyEngine.getDataFromClassFile(JavaDependencyEngine.java:112) at org.dtangler.javaengine.dependencyengine.JavaDependencyEngine.getJavaClasses(JavaDependencyEngine.java:88) at org.dtangler.javaengine.dependencyengine.JavaDependencyEngine.getDependencies(JavaDependencyEngine.java:41) at org.sevntu.maven.plugin.dsm.DsmReportEngine.report(DsmReportEngine.java:161) at org.sevntu.maven.plugin.dsm.DsmReportEngine.report(DsmReportEngine.java:145) at org.sevntu.maven.plugin.dsm.DsmReportMojo.executeReport(DsmReportMojo.java:128) ... 23 more Caused by: java.io.IOException: Unknown constant: 18 at org.dtangler.javaengine.classfileparser.ClassFileParser.parseNextConstant(ClassFileParser.java:192) at org.dtangler.javaengine.classfileparser.ClassFileParser.parseConstantPool(ClassFileParser.java:101) at org.dtangler.javaengine.classfileparser.ClassFileParser.parse(ClassFileParser.java:74) at org.dtangler.javaengine.classfileparser.ClassFileParser.parse(ClassFileParser.java:48) ... 29 more

nkavian commented 8 years ago

+1

jimbethancourt commented 6 years ago

I have reached out to @isopov via email -- I have updated dtangler to allow it to parse Java 8 and Java 9, but have not released it yet (I've also reached out to the repo creator there as well)

romani commented 6 years ago

@jimbethancourt , do you plan to release it to maven central ? I remember there was build problem that forced us to publish dtangler to maven central by our team.

jimbethancourt commented 6 years ago

@romani, yes, I would like to publish dtangler to maven central. I have yet to hear from @moikarin, and I'm not sure how long I should wait before proceeding with publishing a new artifact without his input. How long did you wait? Did you try contacting him? Do you know if he responds to pull requests?

The build system in the sysart repo was a Rake script, but I've been able to move it to Maven and have reorganized the codebase in my forked repo to follow Maven conventions while keeping all unit tests passing.

Eventually, I would like to move off of the home grown dependency injection in dtangler and move to using javax.inject, which could also be leveraged in this plugin since Maven plugins can use Guice and could be leveraged by other tools as well.

Thanks, Jim

romani commented 6 years ago

I would like to publish dtangler to maven central.

First publication was done by our team.

How long did you wait?Did you try contacting him? Do you know if he responds to pull requests?

We never send them patches as far as I remember. For first implementation of plugin, original dtangler was enough. @sabaka did a contact with them and I remember they told that they have no time to support it, so we ok to do whatever, we required only publication to make first step.

I would like to move off of the home grown dependency injection in dtangler and...

Thanks a lot for interest. Our plugin is also in inactive state. @sabaka looks like lost interest to it and I do not have time, as I am over busy with checkstyle support. I can give you write permission to this project ones you update dtangler and be ready for changes in plugin.

moikarin commented 6 years ago

I'm not with Sysart anymore but I'll offer my unofficial opinion anyway :-) @jimbethancourt, I'm sure it will fine to maintain and release from your forked repo. I pinged my Sysart buddies but haven't got a response yet. I'd say just go ahead.

Great to see dtangler getting some use!

romani commented 6 years ago

I pinged my Sysart buddies but haven't got a response yet. I'd say just go ahead.

few years ago, they told us to do what ever we want and proceed. We did not require fork, so we just did publish to maven central. Maven allow to publish on behalf of smb.

olibye commented 6 years ago

Any progress on this? @jimbethancourt seems to have done a good job updating dtangler.

romani commented 6 years ago

just send PullRequest with update of dtangler version if smth is already done.

jimbethancourt commented 6 years ago

Getting closer to publishing :-) I will submit a PR when I've published the new version.

Thanks, Jim

jimbethancourt commented 6 years ago

I've published to Maven Central with the groupId of org.hjug.dtangler and have repackaged the classes with the package org.hjug.dangler. However, the class names remained the same. @romani, let me know if you'd like me to update it and submit a PR, or if you'd like to do this yourself.

Thanks, Jim

romani commented 6 years ago

let me know if you'd like me to update it and submit a PR

please do send PR, I am over occupied in https://github.com/checkstyle/checkstyle/ . @sabaka , can you help us with review ?

romani commented 6 years ago

Fix is merged

romani commented 6 years ago

I need to find some time to make a release.

jimbethancourt commented 6 years ago

Completely understandable -- it was quite a process for me to release dtangler!

romani commented 6 years ago

just need 15 min on laptop, deploy is well documented - https://github.com/sevntu-checkstyle/dsm-maven-plugin/wiki/Uploading-maven-plugin-to-maven-central

Release is done. Should appear on maven soon.

jimbethancourt commented 6 years ago

Looks like it's been indexed on Maven.org :-) Please update the readme.md with the latest version when you have a chance.

Thanks, Jim

romani commented 6 years ago

Readme is changed