checkstyle-idea icon indicating copy to clipboard operation
checkstyle-idea copied to clipboard

Make thirdparty-classpath shareable

Open jiri-pejchal opened this issue 6 years ago • 5 comments

I'm trying to make the plugin configuration shareable among developers and store it in git:

<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="CheckStyle-IDEA">
    <option name="configuration">
      <map>
        <entry key="active-configuration" value="PROJECT_RELATIVE:$PRJ_DIR$/src/etc/checkstyle.xml:czc" />
        <entry key="checkstyle-version" value="8.7" />
        <entry key="copy-libs" value="false" />
        <entry key="location-0" value="BUNDLED:(bundled):Sun Checks" />
        <entry key="location-1" value="BUNDLED:(bundled):Google Checks" />
        <entry key="location-2" value="PROJECT_RELATIVE:$PRJ_DIR$/src/etc/checkstyle.xml:czc" />
        <entry key="property-2.checkstyle.suppressions.file" value="checkstyle-suppressions.xml" />
        <entry key="scan-before-checkin" value="true" />
        <entry key="scanscope" value="JavaOnlyWithTests" />
        <entry key="suppress-errors" value="false" />
        <entry key="thirdparty-classpath" value="C:\Users\username\.m2\repository\com\github\sevntu-checkstyle\sevntu-checks\1.27.0\sevntu-checks-1.27.0.jar" />
      </map>
    </option>
  </component>
</project>

It basically works except the sevntu-checkstyle jar location:

<entry key="thirdparty-classpath" value="C:\Users\username\.m2\repository\com\github\sevntu-checkstyle\sevntu-checks\1.27.0\sevntu-checks-1.27.0.jar" />

Because we are using maven Copy libraries from project directory does not copy libraries.

Is there a way to make the path to the sevntu checkstyle jar shareable among developers?

Maybe support some variables like $HOME:

<entry key="thirdparty-classpath" value="$HOME\.m2\repository\com\github\sevntu-checkstyle\sevntu-checks\1.27.0\sevntu-checks-1.27.0.jar" />

jiri-pejchal avatar Feb 12 '18 14:02 jiri-pejchal

Thanks for the suggestion. It seems very reasonable - however, it's unlikely to happen at present. In part this is because any path work is very risky given I don't have a Windows machine to test on, and there's a history of bugs resulting from odd differences between Windows FS paths and the relative sanity of everything else.

jshiell avatar Feb 17 '18 13:02 jshiell

Other possible solution would be the ability to specify the path to sevntu checks jar relative to the project directory - similar to the current implementation of location configuration of checkstyle.xml

I also tried to copy the jar manually to the directory checkstyleidea-libs, but that didn't work either.

jiri-pejchal avatar Feb 27 '18 13:02 jiri-pejchal

I'm using something like <entry key="thirdparty-classpath" value="$PROJECT_DIR$/checkstyleidea-libs/sevntu-checks-1.27.0.jar" />, not ideal as you have to check in the jar in git but it works.

daanschipper avatar Oct 07 '20 07:10 daanschipper

Hey, this problem is actually very relevant, any ideas/updates? Why we plugin can't fetch third-party checks from plugin dependencies as maven?

maistrovyi avatar Feb 01 '24 09:02 maistrovyi

any ideas/updates?

Nope.

Why we plugin can't fetch third-party checks from plugin dependencies as maven?

Because no one has written the feature, and I've no time or intention to do so at present.

jshiell avatar Feb 04 '24 10:02 jshiell