首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >前端-maven-plugin不能“保龄球安装”

前端-maven-plugin不能“保龄球安装”
EN

Stack Overflow用户
提问于 2015-11-25 09:34:24
回答 3查看 8.9K关注 0票数 8

我有“网页”模块的项目。在模块中,我使用了"pom.xml“和前端maven-plugin:

代码语言:javascript
复制
<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>

web模块中还有.bowerrc文件:

代码语言:javascript
复制
{
    "directory":"src/main/resources/static/bower_components"
}

和bower.json文件:

代码语言:javascript
复制
{
  "name": "web",
  "ignore": [
    "**/.*",
    "node_modules",
    "bower_components",
    "test",
    "tests"
  ],
  "dependencies": {
    "jquery": "~2.1.4",
    "bootstrap": "~3.3.5"
  }
}

也是package.json文件:

代码语言:javascript
复制
{
    "name": "web",
    "devDependencies": {
        "bower": "~1.6.5"
    },
    "engines": {
        "node": ">=0.10.40"
    }
}

当我尝试"mvn清理安装“时,会出现以下错误:

代码语言:javascript
复制
    [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

请帮我解决这个问题,我花了很多时间来解决这个问题。

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2015-11-25 10:49:43

  1. 将您的M3_HOME路径设置为使用"mvn干净安装“而不使用sudo
  2. 为项目中的“目标”文件夹和web模块中的其他锁定文件夹设置777优先级
  3. 在web模块中的pom.xml文件中添加以下内容: 安装节点和npm安装-节点和- npm v0.12.2 2.7.6npm安装滚筒安装滚筒安装
票数 3
EN

Stack Overflow用户

发布于 2017-04-28 03:26:52

使用技巧:

代码语言:javascript
复制
        <execution>
            <id>npm install</id>
            <goals>
                <goal>npm</goal>
            </goals>
            <configuration>
                <arguments>install bower</arguments>
            </configuration>
        </execution>
票数 1
EN

Stack Overflow用户

发布于 2022-05-12 06:11:29

看来鲍尔不在你的系统里。使用npm在您的计算机上安装Bower:

代码语言:javascript
复制
npm install -g bower
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33912916

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档