jonashackt/spring-boot-vuejs

"mvn clean install" doesn't work

gerchicov-bp opened this issue · 3 comments

[ERROR] Hash: 8da12d376654d040e459
[ERROR] Version: webpack 3.12.0
[ERROR] Time: 2838ms
[ERROR]                                         Asset     Size  Chunks                    Chunk Names
[ERROR] static/img/spring-boot-vuejs-logo.3ad77c6.png  18.2 kB          [emitted]         
[ERROR]                                      index.js  1.23 MB       0  [emitted]  [big]  index.js
[ERROR]    [3] ./src/components/http-common.js 1.39 kB {0} [built]
[ERROR]    [4] ./src/components/HelloWorld.vue 2.01 kB {0} [built]
[ERROR]    [5] ./src/router/index.js 1.65 kB {0} [optional] [built]
[ERROR]    [6] ./node_modules/vue/dist/vue.esm.js 292 kB {0} [built]
[ERROR]    [8] ./src/App.vue 1.93 kB {0} [optional] [built]
[ERROR]   [10] ./src/assets/logo.png 9.17 kB {0} [built]
[ERROR]   [11] ./src/assets/spring-boot-vuejs-logo.png 91 bytes {0} [built]
[ERROR]   [14] ./src/components/Hello.vue 1.99 kB {0} [optional] [built]
[ERROR]   [16] ./src/components/Service.vue 2 kB {0} [optional] [built]
[ERROR]   [18] ./src/components/User.vue 1.98 kB {0} [optional] [built]
[ERROR]   [20] ./test/unit/index.js 657 bytes {0} [built]
[ERROR]   [21] (webpack)/buildin/global.js 509 bytes {0} [built]
[ERROR]   [22] ./test/unit/specs \.spec$ 182 bytes {0} [built]
[ERROR]   [23] ./test/unit/specs/HelloWorld.spec.js 603 bytes {0} [optional] [built]
[ERROR]   [28] ./src ^\.\/(?!main(\.js)?$) 645 bytes {0} [built]
[ERROR]     + 30 hidden modules
[ERROR] 
[ERROR] WARNING in ./src/components/Bootstrap.vue
[ERROR] 
[ERROR]   ✘  https://google.com/#q=vue%2Frequire-v-for-key  Elements in iteration expect to have 'v-bind:key' directives  
[ERROR]   src/components/Bootstrap.vue:27:13
[ERROR]               <li v-for="header of headers">
[INFO] 31 08 2018 16:08:18.243:INFO [karma]: Karma v1.7.1 server started at http://0.0.0.0:9876/
[ERROR]                ^
[INFO] 31 08 2018 16:08:18.245:INFO [launcher]: Launching browser PhantomJS with unlimited concurrency
[ERROR] 
[ERROR]   ✘  https://google.com/#q=vue%2Fno-parsing-error   Parsing error: x-invalid-end-tag                              
[ERROR]   src/components/Bootstrap.vue:30:11
[ERROR]             </p>
[ERROR]              ^
[ERROR] 
[ERROR] 
[ERROR] ✘ 2 problems (2 errors, 0 warnings)
[ERROR] 
[ERROR] 
[ERROR] Errors:
[ERROR]   1  https://google.com/#q=vue%2Fno-parsing-error
[ERROR]   1  https://google.com/#q=vue%2Frequire-v-for-key
[ERROR]  @ ./src ^\.\/(?!main(\.js)?$)
[ERROR]  @ ./test/unit/index.js
[ERROR] 
[ERROR] ERROR in ./src/components/http-common.js
[ERROR] Module not found: Error: Can't resolve 'axios' in '/Users/gerchicov/Documents/xCode_projects/spring-boot-vuejs/frontend/src/components'
[ERROR]  @ ./src/components/http-common.js 47:13-29
[ERROR]  @ ./src ^\.\/(?!main(\.js)?$)
[ERROR]  @ ./test/unit/index.js
[INFO] 31 08 2018 16:08:18.292:INFO [launcher]: Starting browser PhantomJS
[INFO] 31 08 2018 16:08:19.423:INFO [PhantomJS 2.1.1 (Mac OS X 0.0.0)]: Connected on socket bIp4O5xuxsaM-hX9AAAA with id 4461265
[INFO] PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR
[INFO]   Error: Cannot find module "axios"
[INFO]   at webpack:///src/components/http-common.js:1:0 <- index.js:536
[INFO] 
[INFO] PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 0 of 0 ERROR (0.146 secs / 0 secs)
[INFO] 
[ERROR] npm ERR! code ELIFECYCLE
[ERROR] npm ERR! errno 1
[ERROR] npm ERR! frontend@1.0.0 unit: `cross-env BABEL_ENV=test karma start test/unit/karma.conf.js --single-run`
[ERROR] npm ERR! Exit status 1
[ERROR] npm ERR! 
[ERROR] npm ERR! Failed at the frontend@1.0.0 unit script.
[ERROR] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[ERROR] 
[ERROR] npm ERR! A complete log of this run can be found in:
[ERROR] npm ERR!     /Users/gerchicov/.npm/_logs/2018-08-31T13_08_19_601Z-debug.log
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] spring-boot-vuejs 0.0.1-SNAPSHOT ................... SUCCESS [  0.597 s]
[INFO] frontend ........................................... FAILURE [ 20.090 s]
[INFO] backend 0.0.1-SNAPSHOT ............................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21.045 s
[INFO] Finished at: 2018-08-31T16:08:19+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.6:npm (npm run unit) on project frontend: Failed to run task: 'npm run unit' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.6:npm (npm run unit) on project frontend: Failed to run task
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoFailureException: Failed to run task
    at com.github.eirslett.maven.plugins.frontend.mojo.AbstractFrontendMojo.execute (AbstractFrontendMojo.java:100)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: com.github.eirslett.maven.plugins.frontend.lib.TaskRunnerException: 'npm run unit' failed.
    at com.github.eirslett.maven.plugins.frontend.lib.NodeTaskExecutor.execute (NodeTaskExecutor.java:63)
    at com.github.eirslett.maven.plugins.frontend.mojo.NpmMojo.execute (NpmMojo.java:62)
    at com.github.eirslett.maven.plugins.frontend.mojo.AbstractFrontendMojo.execute (AbstractFrontendMojo.java:94)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: com.github.eirslett.maven.plugins.frontend.lib.ProcessExecutionException: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
    at com.github.eirslett.maven.plugins.frontend.lib.ProcessExecutor.execute (ProcessExecutor.java:82)
    at com.github.eirslett.maven.plugins.frontend.lib.ProcessExecutor.executeAndRedirectOutput (ProcessExecutor.java:64)
    at com.github.eirslett.maven.plugins.frontend.lib.NodeExecutor.executeAndRedirectOutput (NodeExecutor.java:29)
    at com.github.eirslett.maven.plugins.frontend.lib.NodeTaskExecutor.execute (NodeTaskExecutor.java:58)
    at com.github.eirslett.maven.plugins.frontend.mojo.NpmMojo.execute (NpmMojo.java:62)
    at com.github.eirslett.maven.plugins.frontend.mojo.AbstractFrontendMojo.execute (AbstractFrontendMojo.java:94)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
    at org.apache.commons.exec.DefaultExecutor.executeInternal (DefaultExecutor.java:404)
    at org.apache.commons.exec.DefaultExecutor.execute (DefaultExecutor.java:166)
    at com.github.eirslett.maven.plugins.frontend.lib.ProcessExecutor.execute (ProcessExecutor.java:74)
    at com.github.eirslett.maven.plugins.frontend.lib.ProcessExecutor.executeAndRedirectOutput (ProcessExecutor.java:64)
    at com.github.eirslett.maven.plugins.frontend.lib.NodeExecutor.executeAndRedirectOutput (NodeExecutor.java:29)
    at com.github.eirslett.maven.plugins.frontend.lib.NodeTaskExecutor.execute (NodeTaskExecutor.java:58)
    at com.github.eirslett.maven.plugins.frontend.mojo.NpmMojo.execute (NpmMojo.java:62)
    at com.github.eirslett.maven.plugins.frontend.mojo.AbstractFrontendMojo.execute (AbstractFrontendMojo.java:94)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :frontend

Hi @gerchicov-bp , I can´t reproduce your problem. I tried to run mvn clean install right now - and it works like a charm for me - also it works on Travis CI, so it´s not a works on my machine thing 😄 .

I can only guess: As PhantomJS seems to be executed, which is only used in Nightwatch End-2-End tests - did you uncomment the npm run e2e section in the frontend/pom.yml? And there´s Karma, which gives a problem - as configured inside the package.json, Jest is used for UnitTests instead of Karma:

"unit": "jest --config test/unit/jest.conf.js --coverage",

Did you change something there? And the last guess: Axios seems to be missing, but this library is also referenced in the mentioned package.json.

@gerchicov-bp
I faced same issue, and maybe its resolution problem while running unit test. After run 'vue init ...' command, as described in readme page, npm build is executed automatically by default. The build is failed when user is not root or administrator so that 'axios' module is not exist when you run 'mvn clean install'.

maybe it can be fixed you run this in frontend directory

sudo npm build
or 
sudo npm install

or you can install the axios module but I think its not a good way.

npm install --save-dev axios

I´am closing this now - feel free to come back if you need help.