2015-11-25 26 views
7

मेरे पास "वेब" मॉड्यूल के साथ प्रोजेक्ट है। मॉड्यूल में मैं दृश्यपटल-Maven-प्लगइन के साथ "pom.xml" है:फ्रंटेंड-मेवेन-प्लगइन "बोअर इंस्टॉल" नहीं कर सकता

<build> 
     <plugins> 
      <plugin> 
       <groupId>com.github.eirslett</groupId> 
       <artifactId>frontend-maven-plugin</artifactId> 
       <version>0.0.26</version> 
       <executions> 
        <execution> 
         <id>bower install</id> 
         <goals> 
          <goal>bower</goal> 
         </goals> 
         <phase>generate-sources</phase> 
         <configuration> 
          <arguments>install</arguments> 
          <installDirectory></installDirectory> 
         </configuration> 
        </execution> 
       </executions> 
      </plugin> 
     </plugins> 
    </build> 
वेब मॉड्यूल में

इसके अलावा .bowerrc फ़ाइल हैं:

{ 
    "directory":"src/main/resources/static/bower_components" 
} 

और bower.json फ़ाइल:

{ 
    "name": "web", 
    "ignore": [ 
    "**/.*", 
    "node_modules", 
    "bower_components", 
    "test", 
    "tests" 
    ], 
    "dependencies": { 
    "jquery": "~2.1.4", 
    "bootstrap": "~3.3.5" 
    } 
} 

इसके अलावा package.json फ़ाइल:

{ 
    "name": "web", 
    "devDependencies": { 
     "bower": "~1.6.5" 
    }, 
    "engines": { 
     "node": ">=0.10.40" 
    } 
} 

Whe n मैं "स्वच्छ mvn स्थापित करने के लिए" त्रुटि दिखाई देती है कोशिश:

[INFO] Running 'bower install' in /home/aleksandar/projects/cs230/web 
    [ERROR] module.js:338 
    [ERROR]  throw err; 
    [ERROR]   ^
    [ERROR] Error: Cannot find module '/home/aleksandar/projects/cs230/web/node_modules/bower/bin/bower' 
    [ERROR]  at Function.Module._resolveFilename (module.js:336:15) 
    [ERROR]  at Function.Module._load (module.js:278:25) 
    [ERROR]  at Function.Module.runMain (module.js:501:10) 
    [ERROR]  at startup (node.js:129:16) 
    [ERROR]  at node.js:814:3 
    [INFO] ------------------------------------------------------------------------ 
    [INFO] Reactor Summary: 
    [INFO] 
    [INFO] parent ............................................. SUCCESS [ 0.349 s] 
    [INFO] database ........................................... SUCCESS [ 0.787 s] 
    [INFO] test ............................................... SUCCESS [ 0.812 s] 
    [INFO] domain ............................................. SUCCESS [ 2.103 s] 
    [INFO] core-api ........................................... SUCCESS [ 0.185 s] 
    [INFO] jpa-repository ..................................... SUCCESS [ 0.174 s] 
    [INFO] core-impl .......................................... SUCCESS [ 0.495 s] 
    [INFO] web ................................................ FAILURE [ 0.392 s] 
    [INFO] file-repository .................................... SKIPPED 
    [INFO] email .............................................. SKIPPED 
    [INFO] app ................................................ SKIPPED 
    [INFO] payment ............................................ SKIPPED 
    [INFO] jobs ............................................... SKIPPED 
    [INFO] ------------------------------------------------------------------------ 
    [INFO] BUILD FAILURE 
    [INFO] ------------------------------------------------------------------------ 
    [INFO] Total time: 5.984 s 
    [INFO] Finished at: 2015-11-25T10:16:51+01:00 
    [INFO] Final Memory: 39M/349M 
    [INFO] ------------------------------------------------------------------------ 
    [ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:0.0.26:bower (bower install) on project web: Failed to run task: 'bower install' failed. (error code 1) -> [Help 1] 
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.eirslett:frontend-maven-plugin:0.0.26:bower (bower install) on project web: Failed to run task org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) 
    Caused by: org.apache.maven.plugin.MojoFailureException: Failed to run task 

com.github.eirslett.maven.plugins.frontend.mojo.AbstractFrontendMojo.execute(AbstractFrontendMojo.java:67) 
     ... 22 more 
    [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 :web 

कृपया इस समस्या को मैं समस्या को हल करने की कोशिश कर समय की एक बहुत कुछ खो दिया है के साथ मदद।

+1

शायद –

उत्तर

3
  1. "mvn साफ स्थापित" का उपयोग करने sudo के बिना अपने M3_HOME पथ सेट
  2. सेट 777 विशेषाधिकार 'लक्ष्य' वेब मॉड्यूल
  3. में परियोजना में फ़ोल्डर और अन्य लॉक किए गए फ़ोल्डरों वेब में pom.xml फ़ाइल में के लिए मॉड्यूल जोड़ें:

      <execution> 
           <id>install node and npm</id> 
           <goals> 
            <goal>install-node-and-npm</goal> 
           </goals> 
           <configuration> 
            <nodeVersion>v0.12.2</nodeVersion> 
            <npmVersion>2.7.6</npmVersion> 
           </configuration> 
          </execution> 
    
          <execution> 
           <id>npm install</id> 
           <goals> 
            <goal>npm</goal> 
           </goals> 
           <!-- Optional configuration which provides for running any npm command --> 
           <configuration> 
            <arguments>install</arguments> 
           </configuration> 
          </execution> 
    
          <execution> 
           <id>bower install</id> 
           <goals> 
            <goal>bower</goal> 
           </goals> 
           <configuration> 
            <arguments>install</arguments> 
           </configuration> 
          </execution> 
    
+1

से पहले एक ही प्रकार की त्रुटि होने से पहले नोडज स्थापित करें, मैं हर बार नोड स्थापित नहीं करना चाहता हूं, यह पहले से ही वैश्विक स्तर पर मौजूद है, प्लगइन से नोड को कैसे बाहर निकालना है –

0

उपयोग चाल:

 <execution> 
      <id>npm install</id> 
      <goals> 
       <goal>npm</goal> 
      </goals> 
      <configuration> 
       <arguments>install bower</arguments> 
      </configuration> 
     </execution> 
संबंधित मुद्दे