intellij idea: terminal window: making a filepath/file clickable - maven

I'm implementing the Maven CPD PMD plug-in to to spot and (fail the build) if any instances of code duplication are presennt in the project.
This all works fine. However, The output error to the terminal in intellij idea is in the form:
Terminal output:
CPD Failure: Found 31 lines of duplicated code at locations:
[INFO]
C:\Users\bob\Documents\Project\Folder\src\main\java\HelloWorld.java
line 330
[INFO]
C:\Users\bob\Documents\Project\Folder\src\main\java\HelloWorld.java
line 428
This works fine and how it should do,
although, I recently had experience implementing Maven Check Style plug-in, which output error looks like this :
[INFO]
C:\Users\bob\Documents\Project\Folder\src\main\java\HelloWorld.java:428
This is infinitely more useful as I can just click on this "file path" and go directly to the file and line where this error occurs ie. HelloWorld.java at line 428.
so, my question is, is there anyway of getting intellij idea to "recognise" the output in the form:
[INFO]
C:\Users\bob\Documents\Project\Folder\src\main\java\HelloWorld.java
line 428
and making this "clickable" ??
Any help or insights will be greatly appreciated as having to manually navigate to the class is really annoying :( (especially as I have hundreds of errors).
Thanks all.. :)

With Intellij can you run your code using a Run Configuration rather than using the terminal? This will give you what you want.
Also, as a comment, Visual Studio Code does exactly what you want out of the box.

Related

How To Treat Genexus Warnings in KB as UNSTABLE build in Jenkins/MSBuild

Is it possible to detect (and display) Genexus warnings when building a KB from a Jenkins Job?
I tried using the %ERROR_LEVEL% variable, but the value is '0' even if there where warnings in the build process.
Thanks
This is not exactly what I was looking for, but it´s a decent workaround: https://plugins.jenkins.io/log-parser/
This plugin can be configured as a post-build action (in freestyle jobs or declarative pipelines), parsing the build output and looking for the pattern "warning :"
Sample rules file used:
# GX build errors
error /error :/
# GX build warnings
warning /warning :/

Remove NETBEANS-ExecEvent lines from maven output in Netbeans

After upgrade to Ubuntu 20.04 maven output in Netbeans shows many annoying lines starting with:
[INFO] NETBEANS-ExecEvent: ...
Do you know a way to remove these lines?
I resolved by adding the following line to the simplelogger.properties file of my maven installation:
org.slf4j.simpleLogger.log.org.netbeans.modules.maven.event=off
It seems that NbEventSpy adds those lines, so the idea is to turn off logging from org.netbeans.modules.maven.event
it's a bug. these lines should be hidden but they do happen to me sometimes. In my case the reason is that the line is too long, gets cut off and is eventually not recognize

no executable code found at line intellij 14

I am unable to debug remote applications due to: No executable code at line
I am running ultimate edition of Intellij, version 14.0.3. My application is running inside tomcat 8 and i'm building it from the command line using Maven. This problem appeared after i switched from the community edition to the ultimate edition.
Project sources are the same and I am able to connect to tomcat for remote debugging. The only issue is that all my breakpoints are invalidated.
Please advice on how to fix this issue.
Cheers.
Remove all IDEA related project files and open the project by the .pom file.
I've had the same problem. Simply compile the directory that the class resides, and the debugger will pick up the break point.
I had the same problem and I implemented a similar solution.
Remove all IDEA related project files and open the project by the .pom file.
I use Gradle for my projecto, so i removed the project from intellij and then reimported it.
I hope others could read it and helps them
if you are developing an Atlassian plug-in and connected to the server via remote debug, run atlas-package to sync deployed plug-in and your source code.
If you are running a maven project execute the following commands in cmd prompt.
mvn clean install
mvn compile
This will resolve the problem.
The solution that worked for me is much more embarrassing. I put the breakpoint on the wrong line.
You see two breakpoints, first one is working and the second one is complaining about "no executable code ...".
It turns out there really is no executable code, just a string.

Importing Gradle project with "Use gradle wrapper with verification" immediately failing in Android Studio 0.2.9

NOTE: i figured out the solution to this as i was writing the post, but i'll put the info up here in case anyone else needs it.
Android Studio was giving me the following error when i tried to import a Gradle project (using File -> Import Project... and selecting the build.gradle file)
Resolve Error
Could not install Gradle distribution from 'http://
services.gradle.org/distributions-snapshots/
gradle-1.8-20130830160653+0000-bin.zip'.
java.util.zip.ZipException: error in opening zip file
error in opening zip file
Consult IDE log for more details (Help | Show Log)
see also:
Screenshot of error dialog
gist of error log
the error appeared immediately after clicking 'OK' in the import dialog. the import process had previously failed due to a spotty internet connection, and i guessed that Android Studio / Gradle may have cached the partial download and was now unsuccessfully trying to use that partial download instead of fetching the files.
solution
this issue can be resolved by clearing the bad download out of the cache. my cache on OSX for gradle-1.8-20130830160653+0000-bin.zip was located at
~/.gradle/wrapper/dists/gradle-1.8-20130830160653+0000-bin
removing that directory and retrying the 'Import Project from Gradle' process again promoted the system to retry the download.
hope this helps someone spend less time on this than i did :)
For Windows users it is located in
C:\Users\%your_username%\.gradle\wrapper\dists
just remove everything inside the above folder...
Hope it helps... :)
In eclise go to Window>preferences>Gradle.
in Gradle distribuition check URL
Put the value choosing the your distribuition from
https://services.gradle.org/distributions-snapshots
Sorry my bad english XD

(sonar with gallio and) opencover, code coverage: 0%

I'm working with sonar having Gallio using OpenCover, it gives me a code coverage of 0% although there are test classes and my machine takes about 15 seconds to try to run the tests (at least it seems like that), after which they're summed up with the line 0 run, 0 passed, 0 failed, 0 inconclusive, 0 skipped.
So, I took a look around the internet / stackoverflow and found out that this could have to do with the code being compiled on another machine. As that's the case here as well, I opened the solution in Visual Studio, built it and I can see that my PDB files are recreated. After which I tried sonar with opencover again.
It didn't help
I took the line of code with which OpenCover is called out of the admin console, went to the OpenCover directory and executed the same line, without a filter as my coverage-report.xml told me that the test modules were skippedDueTo="Filter". After which they were not skipped anymore.
Still, 0% test coverage
I registered OpenCover profiler library with regsvr32 OpenCover.Profiler.dll in the same Admin console (and tried it twice, as I'm on windows 7 but am using a 32 bit sonar).
Didn't help
I tried the same line with adding the -oldStyle argument
Didn't help either
Now I feel like I'm out of options ...
The latest call I tried in the admin console:
C:\Program Files\OpenCover>OpenCover.Console.exe -register:user -target:"C:\Program Files\Gallio\bin\Gallio.Echo.exe" -targetdir:D:\projecten\udbdrm\source\CDP\CDPBackoffice\Develop\CDPBackoffice.root\CDPBackoffice\.sonar "-targetargs:\"/r:IsolatedAppDomain\" \"/report-directory:D:\projecten\udbdrm\source\CDP\CDPBackoffice\Develop\CDPBackoffice.root\CDPBackoffice\.sonar\" \"/report-name-format:gallio-report\" \"/report-type:Xml\" \"D:\projecten\udbdrm\source\CDP\CDPBackoffice\Develop\CDPBackoffice.root\CDPBackoffice\CDPBackoffice.BusinessLogic.Tests\bin\Debug\CDPBackoffice.BusinessLogic.Tests.dll\" \"D:\projecten\udbdrm\source\CDP\CDPBackoffice\Develop\CDPBackoffice.root\CDPBackoffice\CDPBackoffice.Utility.Tests\bin\Debug\CDPBackoffice.Utility.Tests.dll\" \"D:\projecten\udbdrm\source\CDP\CDPBackoffice\Develop\CDPBackoffice.root\CDPBackoffice\CDPBackoffice.DataAccessLayer.Tests\bin\Debug\CDPBackoffice.DataAccessLayer.Tests.dll\"" -mergebyhash -output:D:\projecten\udbdrm\source\CDP\CDPBackoffice\Develop\CDPBackoffice.root\CDPBackoffice\.sonar\coverage-report.xml -oldStyle
The solution does have several test classes, which run when executing them in Visual Studio and they do call source classes. Some of them fail some of them succeed.
Anyone who still has a clue on how to get test results?
Preferrably in sonar, but hey, as executing OpenCover with the call above puts the results in the coverage-report.xml and sonar uses that as input I'm fine with a working call ...
Apparently all I needed to add to the sonar-project.properties was this line:
sonar.gallio.runner=IsolatedProcess

Resources