mwinteringham/restful-booker-platform

Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.3.2:exec (npm run test) on project restful-booker-platform-assets-js

theknewkid opened this issue · 7 comments

Hi,

It appears as though the build is failing due to not being able to execute a maven plugin. It also states the system is unable to locate the jar files in assets/api/target and proxy/target.

I attempted to resolve issue by following the README.md in the /assets/js folder, but still same issue.

Here's the build log:
build.log

Hmm it's hard to see what is going on here. Could you navigate into the assets/js folder and run the following:

npm install
npm run build

If there are any errors send them over and I'll diagnose.

There were no errors while running both of those commands.
However, when i navigate to /assets and run the commands in the README.md , when i run java -jar target/restful-booker-platform-ui-1.0-SNAPSHOT.jar , I get error Error: Unable to access jarfile .\target\restful-booker-platform-assets-1.0.SNAPSHOT.jar

Interesting. I wouldn't expect you to have a Jar file because you've only built the frontend code and not the API that serves the code.

What if you were to run npm run test in the same folder. Upon second review it looks like the tests for the JS might be causing issue.

I'm having the same issue listed above. Running npm run test I get a fail on tests/report-test.js
expect(received).toMatchSnapshot()
Snapshot name: Multiple reports can be created in the Report component 1

`
- Snapshot - 2
+ Received + 2

@@ -162,11 +162,11 @@
                  >
                    31
                  </button>
                </div>
                <div
-                 class="rbc-date-cell"
+                 class="rbc-date-cell rbc-current"
                  role="cell"
                >
                  <button
                    class="rbc-button-link"
                    role="cell"
@@ -174,11 +174,11 @@
                  >
                    01
                  </button>
                </div>
                <div
-                 class="rbc-date-cell rbc-current"
+                 class="rbc-date-cell"
                  role="cell"
                >
                  <button
                    class="rbc-button-link"
                    role="cell"

  36 |     await getByText(/103/)
  37 |
> 38 |     expect(asFragment()).toMatchSnapshot();
     |                          ^
  39 | });
  40 |

  at toMatchSnapshot (tests/report-test.js:38:26)
  at tryCatch (node_modules/@babel/runtime/helpers/regeneratorRuntime.js:86:17)
  at Generator._invoke (node_modules/@babel/runtime/helpers/regeneratorRuntime.js:66:24)
  at Generator.next (node_modules/@babel/runtime/helpers/regeneratorRuntime.js:117:21)
  at asyncGeneratorStep (node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
  at _next (node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)

› 1 snapshot failed.
`

... that said the app gets to the "STARTING APPLICATION" state for me, but doesn't make it down to the next block. The output looks like this:
Error: Unable to access jarfile assets/api/target/restful-booker-platform-assets-*.jar Error: Unable to access jarfile proxy/target/restful-booker-platform-local-proxy-*.jar Waiting for RBP to turn on...................... /auth/ ready /room/ ready /message/ ready /branding/ ready /report/ ready /booking/ ready ...........................................................................
...and localhost:8080 does not reply.

Now that is interesting. Whereabouts are you based @izenski? I suspect timezones are rearing their ugly head for this failed check.

I am trying on MacOS Ventura 13.1, with Node.JS 18.12.1 LTS, Maven 3.8.4, Oracle JDK 17.0.5 and get the same error (messages as above from izenski). I am in Pacific timezone, west coast North America

Ok definitely a timezone issue. I'll look into fixing this but in the meantime you can workaround it by running:

npm test --u

In the assets/js folder and that will update the failing test to confirm that you shouldn't get that missing class. You should then be able to run the build again without issue (hopefully)