vlingo / xoom-designer

The VLINGO XOOM Designer to guide you in rapid delivery of low-code to full-code Reactive, Event-Driven Microservices and Applications using DOMA, DDD, and other approaches.
https://vlingo.io
Mozilla Public License 2.0
85 stars 15 forks source link

xoom gui code generation expects mvnw to be launchable in current path #14

Closed razibus closed 3 years ago

razibus commented 3 years ago

When mvnw is not launchable in current path, the xoom gui emits the following exception at the generation step:

16:12:51.035 [pool-2-thread-6] DEBUG io.vlingo.actors.Logger - errorStrings: []
io.vlingo.xoom.starter.task.projectgeneration.ProjectGenerationException: Failed.
sh: 1: mvnw: not found
    at io.vlingo.xoom.starter.task.steps.StatusHandler.lambda$failureHandling$4(StatusHandler.java:57)
    at io.vlingo.xoom.starter.task.steps.StatusHandler.handle(StatusHandler.java:42)
    at io.vlingo.xoom.starter.task.steps.StatusHandlingStep.process(StatusHandlingStep.java:19)
    at io.vlingo.xoom.starter.task.projectgeneration.ProjectGenerationManager.lambda$processSteps$1(ProjectGenerationManager.java:19)
    at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
    at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
    at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
    at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
    at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
    at io.vlingo.xoom.starter.task.projectgeneration.ProjectGenerationManager.processSteps(ProjectGenerationManager.java:19)
    at io.vlingo.xoom.starter.task.projectgeneration.WebBasedProjectGenerationManager.run(WebBasedProjectGenerationManager.java:15)
    at io.vlingo.xoom.starter.task.projectgeneration.WebBasedProjectGenerationManager.run(WebBasedProjectGenerationManager.java:11)
    at io.vlingo.xoom.starter.task.TaskManager.manage(TaskManager.java:17)
    at io.vlingo.xoom.starter.restapi.GenerationSettingsResource.runProjectGeneration(GenerationSettingsResource.java:58)
    at io.vlingo.common.BasicCompletes$Executables.executeActions(BasicCompletes.java:484)
    at io.vlingo.common.BasicCompletes$Executables.registerWithExecution(BasicCompletes.java:436)
    at io.vlingo.common.BasicCompletes$BasicActiveState.registerWithExecution(BasicCompletes.java:852)
    at io.vlingo.common.BasicCompletes.andThen(BasicCompletes.java:67)
    at io.vlingo.common.BasicCompletes.andThen(BasicCompletes.java:86)
    at io.vlingo.xoom.starter.restapi.GenerationSettingsResource.startGeneration(GenerationSettingsResource.java:44)
    at io.vlingo.http.resource.RequestHandler1.lambda$null$0(RequestHandler1.java:57)
    at io.vlingo.http.resource.RequestExecutor.executeRequest(RequestExecutor.java:25)
    at io.vlingo.http.resource.RequestHandler1.lambda$handle$1(RequestHandler1.java:57)
    at io.vlingo.http.resource.RequestHandler1.lambda$execute$4(RequestHandler1.java:78)
    at io.vlingo.http.resource.RequestExecutor.executeRequest(RequestExecutor.java:25)
    at io.vlingo.http.resource.RequestHandler1.lambda$execute$5(RequestHandler1.java:80)
    at io.vlingo.http.resource.RequestHandler.runParamExecutor(RequestHandler.java:62)
    at io.vlingo.http.resource.RequestHandler1.execute(RequestHandler1.java:80)
    at io.vlingo.http.resource.RequestHandler1.execute(RequestHandler1.java:87)
    at io.vlingo.http.resource.ResourceRequestHandlerActor.lambda$handleFor$3(ResourceRequestHandlerActor.java:45)
    at io.vlingo.http.resource.ResourceRequestHandlerActor.handleFor(ResourceRequestHandlerActor.java:31)
    at io.vlingo.http.resource.ResourceRequestHandlerActor.handleFor(ResourceRequestHandlerActor.java:51)
    at io.vlingo.http.resource.ResourceRequestHandler__Proxy.lambda$handleFor$e376e271$1(ResourceRequestHandler__Proxy.java:46)
    at io.vlingo.actors.LocalMessage.internalDeliver(LocalMessage.java:121)
    at io.vlingo.actors.LocalMessage.deliver(LocalMessage.java:53)
    at io.vlingo.actors.plugin.mailbox.concurrentqueue.ConcurrentQueueMailbox.run(ConcurrentQueueMailbox.java:108)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
    at java.base/java.lang.Thread.run(Thread.java:832)

Adding a launchable mvnw to the path with an accessible .mvn folder solves the issue and the gui is able to generate the code.

Florian-Schoenherr commented 3 years ago

don't exactly know what that means, do you mean windows PATH? @danilo-ambrosio can you take a look?

razibus commented 3 years ago

don't exactly know what that means, do you mean windows PATH? @danilo-ambrosio can you take a look?

Indeed, this is what I meant. Can be the windows PATH or the Linux path. I use Linux. If the mvnw executable is not in one of the folders listed in the path variable, the code generation process fails with the aforementioned exception. However, even if making this file visible in the system path makes possible to get the code generation step working, this is only a workaround and is definitly not a viable solution. The mvnw executable should not be made public at the system level, but local and private to the xoom application, because it could conflict with other instances of the same file. A way to solve this issue may be to put a copy of the mvnw and its .mvn folder inside the xoom folder tree (for instance in a subfolder of xoom) and to keep it outside the system path. Instead to call directly mvnw, the call would be subfolder/mvnw.

VaughnVernon commented 3 years ago

Thanks @razibus for your patience and taking time to explain.

We've struggled a bit getting mvnw to work properly (not sure of all the reasons but it doesn't seem straightforward to employ it). It was my impression that we were causing a jit download of mvn rather than requiring it to exist locally beforehand. Perhaps the problem is when mvnw does exist beforehand. Not sure. Is that what you are indicating? It seems like your suggestion would be the cure to this.

/cc @danilo-ambrosio

razibus commented 3 years ago

Indeed, mvnw has this utility to use a local maven wrapper without requiring that a maven be installed on the target system. It is a good practice to use it and not to rely on the target system's configuration. It must be xoom's own copy of mvnw.

VaughnVernon commented 3 years ago

Ok, thanks. I thought that the jit download for XOOM-only use was our approach, but obviously something is wrong there.

hurelhuyag commented 3 years ago

This is happened to me yesterday.

VaughnVernon commented 3 years ago

Hey @danilo-ambrosio I thought this was fixed. @hurelhuyag is running Ubuntu. Is there any issues running Maven Wrapper on Ubuntu?

Our priority is not here, but need to nail this for good. @hurelhuyag Do you have any ideas here?

Florian-Schoenherr commented 3 years ago

Ermm, I tried running ./mvnw clean package in the root of vlingo-xoom-starter, because mvnw clean package wouldn't work (on bash). Maybe this is enough to solve the problem throwing ProjectGenerationException as well? @razibus said subfolder/mvnw should work, so basically what I did.

There are mentions of mvnw in install.bat, MavenWrapperInstallationStep and Terminal.

VaughnVernon commented 3 years ago

@Florian-Schoenherr What about this?

./mvnw/mvnw clean package

Florian-Schoenherr commented 3 years ago

@VaughnVernon I meant ./mvnw clean package works. Without the ./ it doesn't 👍

VaughnVernon commented 3 years ago

@Florian-Schoenherr Ok, I thought mvnw is in a sub-directory of the same name under the root.

danilo-ambrosio commented 3 years ago

@razibus Thank you for all details you shared. I just need one more detail.

Could you please look into this directory $VLINGO_XOOM_STARTER_HOME/resources/archetypes and ensure that the mvnw script file is present?

Based on your reply, I can proceed with the solution.

Grateful for your collaboration!

VaughnVernon commented 3 years ago

And @danilo-ambrosio I think the most recent problem was experienced by @hurelhuyag so we need his input to your question:

Could you please look into this directory $VLINGO_XOOM_STARTER_HOME/resources/archetypes and ensure that the mvnw script file is present?

danilo-ambrosio commented 3 years ago

And @danilo-ambrosio I think the most recent problem was experienced by @hurelhuyag so we need his input to your question:

Could you please look into this directory $VLINGO_XOOM_STARTER_HOME/resources/archetypes and ensure that the mvnw script file is present?

Yes @VaughnVernon . I've also asked this information to @hurelhuyag and he already replied on Slack. I sent him an enhanced starter version for his evaluation. I strongly believe the enhancements I made will solve this problem.

As soon as @hurelhuyag reply me with the test result, I'm going to push the fixed version

VaughnVernon commented 3 years ago

@danilo-ambrosio Thanks for all your diligent work on this. Multi-platform is way more complex than write-once-run-anywhere.

danilo-ambrosio commented 3 years ago

@hurelhuyag has successfully tested the updated starter version I've recently pushed. Thank you @hurelhuyag.

@razibus Could you try this new version? All you need to do is the following:

VaughnVernon commented 3 years ago

@danilo-ambrosio Since Hurlhuyag has confirmed the fix on his environment, I think this can be marked fixed and close it even though @razibus has not confirmed.

danilo-ambrosio commented 3 years ago

Makes sense @VaughnVernon . I will do it.