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

Multi-mod Maven case doesn't allow launch from "child" directory using mvnw wrapper from parent #347

Open
scottkurz opened this issue Mar 18, 2023 · 2 comments
Labels
enhancement New feature or request should-fix

Comments

@scottkurz
Copy link
Member

PROBLEM

Say I have a multi-mod Maven structure like:

parent
 + pom.xml
 + mvnw
 + war
      + pom.xml
      + src/main/liberty/config/server.xml
      ....
 + jar
      pom.xml
      ...

In Liberty Tools Eclipse, I can run from the parent project and use the default parms (which is an empty list) and get mvnw liberty:dev, i.e. it'll use the mvnw wrapper in the root.

However, if I try to run from the 'war' level, I'll get default parms of ( ... -f ../pom.xml -pl war). However there's no way to pick up mvnw.

IDEA

@scottkurz scottkurz added the enhancement New feature or request label Mar 18, 2023
@scottkurz scottkurz added this to the 23.0.1 milestone Mar 18, 2023
@scottkurz
Copy link
Member Author

I think we can either:

  1. Relax and extend our "custom parameters" parsing to allow the user to type something that resolves to mvn or mvnw, OR:
  2. Extend our algorithm which provides the Maven executable to look for a parent wrapper and use it.

So for 1. we could allow:
../mvnw ...rest of parms

For 2., the algorithm would be like:

a. Look for mvnw in immediate dir
b. Look for mvnw in parent dir (possibly recursively walking up the chain)
c. Look for mvn in preferences
d. Find mvn via PATH

I like 2., I think it's simpler for the user... they're not really trying to achieve some unique custom behavior, just to use the wrapper they have, and we avoid having to get it right detecting "is this a mvn executable?"

@scottkurz
Copy link
Member Author

We like 2., but what if the parent (in 2b.) is a containing directory but not an actual "parent"? Consider further before implementing. How does this apply to VSCode and IDEA if those use more single project rather than a single workspace.

@scottkurz scottkurz removed this from the 23.0.6 milestone Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request should-fix
Projects
None yet
Development

No branches or pull requests

1 participant