-
Notifications
You must be signed in to change notification settings - Fork 120
Init process different between Java and Spring stacks #127
Comments
@makandre You are right there are 2 slightly different approaches in those 2 stacks. The main reason being the init hooks were not present when the spring stack was initially created. We can look at implementing that, but there are always pros and cons to each approach and we would like the stack providers to be able to choose what they believe works best for them and their developers. Also, the maven dependency (incase of microprofile) is only needed for IDEs to be happy. When users execute @ebullient @Emily-Jiang Would like your thoughts on this. |
Understood. Tho given we are in the business of making (Codewind) IDEs to be happy, we really would appreciate a solution to address the inconsistency and the need for locally installed maven. Thanks. |
Here is my thought:
|
I have submitted a PR to enable maven cache sharing on java-microprofile stack and install parent pom on host from within the appsody container during This is a short term fix for this problem as it will not be possible for any other languages. @makandre please can you test this fix with CodeWind? |
I just tested, it works for us! Just one caveat, because the setup happens during Thank you very much for this fix. |
I believe this would be similar to spring stack. We install the parent pom for both during If this can be worked around in CodeWind I'd keep the rest of the stack as is. |
Describe the bug
I’ve observed that the
init
for Java and Spring stacks run differently.For Java,
init
runsmvn
locally and setup the m2 cache such that I can domvn
commands in the project right after.For Spring,
init
only setup the m2 cache after anappsody run
(it appears setup happens inside the app container where~/.m2/repository:/mvn/repository
mount exists). As a result, runningmvn
commands in spring project afterinit
gives “Non-resolvable parent POM” errors.Additional context
I'm coming at this as a developer for the appsody extension for Codewind. It is preferable for us that the initialization behaviour is consistent between the stacks so we can use a single method to configure the IDEs correctly (VSCode and Eclipse) when creating an appsody project.
Also, the Java way of initialization essentially requires for
mvn
to be present (aside: isn't appsody supposed to shield the developer from requiring specific tools?) This is problematic for us too because we run appsody in Codewind's container (DinD) and we likely cannot install maven.Spring way of initialization works better for us, but happening during
run
is not ideal because when the project is imported into Eclipse workspace after it's created and it's supposed to be "initialized" but it is actually not, so the project will not be configured correctly.To Reproduce
Steps to reproduce the behavior:
Java:
appsody init java-microprofile
mvn validate
Spring:
appsody init java-spring-boot2
mvn validate
(need to run
appsody run
in order for m2 cache to be setup properly)Expected behavior
The behaviour between Java and Spring initialization should be consistent
Actual behaviour
The behaviour between Java and Spring differs as described above
Environment Details (please complete the following information):
If applicable please specify:
Screenshots
If applicable, add screenshots to help explain your problem.
The text was updated successfully, but these errors were encountered: