Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ IDEA not "hyperlinking" to source files in Maven Run tool window

I have been using intellij for 2 years now and love it. however after updating to 2016.3.4 it stopped highlighting path locations in the run window.

I used to be able to just click on the highlighted path and it would jump to the file and line.

example of output from maven-checkstyle-plugin which should be "clickable" :

[ERROR] C:\Users\userName\Documents\project.main\src\main\java\MyClass.java:36: Only one statement per line allowed. [OneStatementPerLine]

This is extremely frustrating and any idea of how to get intellij to do this again would be fantastic.


Minimal, Complete, and Verifiable example

To Replicate this Create a project in IntelliJ IDEA called "bug"

IntelliJ IDEA 2016.3.4
Build #IU-163.12024.16, built on January 31, 2017

Create a folder

bug->CodeStyle and a file in this folder "checkstyle.xml"

<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
        "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
        "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
    <property name="charset" value="UTF-8"/>
    <property name="severity" value="error"/>
    <property name="fileExtensions" value="java,"/>
    <module name="FileTabCharacter"/>
    <module name="TreeWalker">
        <module name="RegexpSinglelineJava">
            <property name="format" value="System\.(out|err).*?$"/>
            <property name="ignoreComments" value="true"/>
        </module>
    </module>
</module>

the pom

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>bugExample</groupId>
    <artifactId>bug</artifactId>
    <version>1.0-SNAPSHOT</version>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>2.17</version>
                <executions>
                    <execution>
                        <id>validate</id>
                        <phase>validate</phase>
                        <configuration>
                            <configLocation>CodeStyle/checkstyle.xml</configLocation>
                            <consoleOutput>true</consoleOutput>
                            <failsOnError>true</failsOnError>
                            <includeTestSourceDirectory>true</includeTestSourceDirectory>
                        </configuration>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>6.18</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

</project>

and a Class Example.java

public class Example {
  public Example() {
    System.out.println("This is not allowed");
  }
}

And now in the maven project Tool Click life-cycle, and then Validate.

The outputs in the "run terminal" :

[INFO] Starting audit...
[ERROR] C:\Users\Username\bug\src\main\java\Example.java:7: Line matches the illegal pattern 'System\.(out|err).*?$'. [RegexpSinglelineJava]
Audit done.

So the problem is that Example.java is Not "Clickable", it has been in the past.

like image 747
Luke_P Avatar asked Feb 28 '17 14:02

Luke_P


1 Answers

Thanks for the example, I've reported a bug for IntelliJ IDEA Maven integration, feel free to vote:

  • IDEA-169034 File paths are not clickable in the Maven tool output
like image 167
CrazyCoder Avatar answered Nov 06 '22 18:11

CrazyCoder