Skip to content

Missing Lib in Eclipse Checkstyle Plugin #178

@lorenzodee

Description

@lorenzodee

The eclipse-cs plugin fails with spring-javaformat-eclipse plugin. I experienced the same problem as mentioned in #82 and #177 (and checkstyle/eclipse-cs#217 too).

java.lang.NullPointerException
	at net.sf.eclipsecs.core.config.configtypes.ConfigurationType.getCheckstyleConfiguration(ConfigurationType.java:123)
	at net.sf.eclipsecs.core.config.CheckConfigurationWorkingCopy.getCheckstyleConfiguration(CheckConfigurationWorkingCopy.java:329)
	at net.sf.eclipsecs.ui.config.CheckConfigurationWorkingSetEditor.configureCheckConfig(CheckConfigurationWorkingSetEditor.java:513)
	at net.sf.eclipsecs.ui.config.CheckConfigurationWorkingSetEditor.access$6(CheckConfigurationWorkingSetEditor.java:505)
	at net.sf.eclipsecs.ui.config.CheckConfigurationWorkingSetEditor$PageController.widgetSelected(CheckConfigurationWorkingSetEditor.java:400)

Upon further inspection, the NullPointerException is due to a missing XML file (Spring Built-in configuration). It is was looking for io/spring/javaformat/checkstyle/checkstyle.xml. This file is found in io.spring.javaformat:spring-javaformat-checkstyle artifact, which is correctly added as a dependency to the eclipse-plugin. But the jar is not added to the resulting plugin jar.

The lib folder of io.spring.javaformat.eclipse_0.0.20.jar only contains:

  1. spring-javaformat-formatter.jar
  2. spring-javaformat-formatter-eclipse.jar

It's missing the spring-javaformat-checkstyle.jar. To confirm this, I temporarily added the missing JAR into the lib folder of the spring-javaformat-eclipse plugin, and restarted IDE. So far, it seems to have fixed the NullPointerException, and can now successfully use eclipse-cs plugin.

I think I'm close to finding the problem. I'll submit a PR when I do.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions