question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find maven executable

See original GitHub issue

Hi,

Thank you for the great plugin. I am trying to integrate this in an existing project and I am facing a problem how the pre-commit is generated.

The Pre-Commit Hook script that is generated for the project looks like this:

#!/bin/bash
set -e
"<project-path>/mvn" -f "<project-path>/pom.xml" com.cosmium.code:git-code-format-maven-plugin:on-pre-comit

The problem is how path to maven executable is generated <project-path>/mvn. When the pre-commit hook is called, maven cannot be found on this path and the hook fails.

I tried using a .mvn folder in root directory of the project with wrapper folder and then a MavenWrapperDownloader.java (I copied it from a Spring Project), but this did not seem to help.

Is there a way we can disable this? So I can say write mvn instead of <project-path>/mvn in the bash script?

If not, would you be open to accepting a PR for this? probably also for a previous version of the plugin? (v2.7)

Thanks!

EDIT: I think this is related to tooling. When I run mvn clean install via IntelliJ and IntelliJ uses bundled maven, then the plugin do not get the correct path to maven. But I think there still should be an option to configure this, for let’s say teams where updating IDEs for everyone is not desired. Anyways, I would be happy to submit a PR if this is something that the maintainers would consider as an option

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
reda-alaouicommented, Jun 1, 2021

Ok no problem for version 2.

0reactions
reda-alaouicommented, Dec 18, 2022

is just adding the maven directory to the Path environment variable, why maven.home system property is being checked here?

Because you could have multiple versions/binaries of Maven on your system.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jenkins: ERROR: Couldn't find Maven executable
Started by user anonymous Building in workspace /home/services/xebium ERROR: Couldn't find Maven executable. /home/services/xebium Can't ...
Read more >
vscode-maven/Troubleshooting.md at main
Error message can be collected either directly from the integrated terminal, or from Maven for Java output panel. Maven executable file not found/set....
Read more >
Tool can not find maven - log message missleading
This should work as MAVEN_HOME is in the environment as confimerd by the set command. However it fails with the following message. [withMaven]...
Read more >
Could not find the executable: mvn
Could not find the executable: mvn · When scanning a maven project and your Detect scan fails or returns no results. May 20,...
Read more >
Maven executable is not found in many Jenkins nodes ...
Our Calcite build fails due to missing maven executable in Jenkins nodes. The error message is shown below: FATAL: Couldn?t find any executable...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found