Skip to content

RFE: Remote Configuration allow jar to be added to classpath like maven plugin dependencies #274

@space88man

Description

@space88man

See #272 for background.

RFE: alllow Remote Configuration to specify both config location and add JARs to the classpath of checkstyle (as maven does).

When both the configuration and SuppressionFilter XML are inside a JAR, Eclipse-CS can use a Remote Configuration and pass the configuration location to checkstyle as: jar:file:<location-to-jar>!/path-to-configuration-XML — at least this is how m2e-code-quality parsed the corresponding maven XML. However the SuppressionFilter XML cannot be located as the JAR is not on the classpath.

Wildfly is an example that puts both the configuration and SuppressionFilter XML inside a JAR.

For comparison: maven with plugin dependencies adds the JAR to the classpath; it specifies the configuration with a path like /wildfly-checkstyle/checkstyle.xml; the SupppressionFilter /wildfly-checkstyle/suppression.xml is found on the classpath.

Side note: there is a PR to maven checkstyle by @qxo to do the reverse and have maven support ${config_loc}; but this would require wildfly to change their JAR.

It would be good if Eclipse-CS could support the equivalent of this:

* configLocation is inside the JAR
* it references the SuppressionFilter as /wildfly-checkstyle/suppression.xml
  which is also inside the JAR
* Eclipse-CS  jar:file:wildfly-checkstyle-config-1.0.7.Final.jar!/wildfly-checkstyle/checkstyle.xml is the
  configLocation; subsequently /wildfly-checkstyle/suppression.xml can't be found (JAR not on classpath
  when checkstyle is invoked)

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>${version.checkstyle.plugin}</version>
                    <configuration>
                        <configLocation>wildfly-checkstyle/checkstyle.xml</configLocation>
                        <includeTestSourceDirectory>true</includeTestSourceDirectory>
                        <sourceDirectories>
                            <directory>${project.build.sourceDirectory}</directory>
                        </sourceDirectories>
                        <resourceIncludes>**/*.properties,**/*.xml</resourceIncludes>
                        <includeTestResources>true</includeTestResources>
                        <includeResources>true</includeResources>
                        <consoleOutput>true</consoleOutput>
                        <failsOnError>true</failsOnError>
                        <failOnViolation>true</failOnViolation>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.wildfly.checkstyle</groupId>
                            <artifactId>wildfly-checkstyle-config</artifactId>
                            <version>${version.org.wildfly.checkstyle-config}</version>
                        </dependency>
                    </dependencies>
                    <executions>
                        <execution>
                            <id>check-style</id>
                            <phase>compile</phase>
                            <goals>
                                <goal>checkstyle</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions