Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support of maven-wrapper - IllegalState We could not find the maven executable mvn somewhere #480

Open
jangalinski opened this issue Jul 9, 2024 · 3 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@jangalinski
Copy link

Is your feature request related to a problem? Please describe.

I am building a plugin on a machine where I solely use maven-wrapper (mvnw), but testing with it fails due to

IllegalState We could not find the maven executable mvn somewhere

Describe the solution you'd like

Make usage of maven wrapper configurable.

Additional context

I couldn't find any other related issue or doc for this, so bare with me if this is already supported/resolved.

@jangalinski jangalinski added the enhancement New feature or request label Jul 9, 2024
@khmarbaise khmarbaise added the documentation Improvements or additions to documentation label Jul 9, 2024
@khmarbaise khmarbaise added this to the itf-extension-0.14.0 milestone Jul 9, 2024
@khmarbaise
Copy link
Owner

Unfortunately you are right. It is not supported at the moment..

@jangalinski
Copy link
Author

I could help with a PR if you like. Main problem is that accessing the root project dir of a multi module maven project is not that easy.
If we would pass the current project dir to the MavenLocator, we could traverse up until we find a mvnw executable (I use this via bash function already, so I just type "mvn" and the mvnw is found automatically.

Other option I see: Make the path to the maven executable configurable ... if not set, the MavenLocator does its job. If set, we just take the path, no matter if I point it to mvnw or mvn ... but then again, I would need to find the multi module root dir.

@khmarbaise
Copy link
Owner

There are comming questions in my mind if I think about that issue:

  • The project which contains the integration tests could be configured using mvnw

    • should that imply to use the mvnw for all tests? (could/should that being overruled by the existence of mvnw within the test cases? Can/should it forced by using a new annotation?)
  • The projects which should be tested located in src/test/resources-its can contain the mvnw setup. If so should it be used by default?

    • Should it possible to suppres the usage of mvnw and use mvn provided by the system (like the current state)
  • What about the role of maven.home ? Overruled? Priority?

  • The root directory of a multi module build is defined by the existence of .mvn directory (see The .mvn directory is not copied #479 more important in Maven 4.0.0; in modelVersion 4.1.0 can be defined in the pom.xml itself).

  • Just to traverse up until we find a mvnw is not correct, because if you assume having some tests in src/test/resources-its which do not contain mvnw setup but your project which contains those tests and has a mvnw setup means that will used. That is not always correct (see my points at the beginning).

  • Need to think more thourougly about that..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants