在 windows VM 上使用 Bower 构建 Maven 项目时出现问题

problems building a maven project with bower on a windows VM

我有一个有人给我的 Maven 项目,它使用了 Bower。我正在尝试在已设置所有相关版本的虚拟机上进行基本的 mvn clean install。我在我的虚拟机上构建了更大的项目,所以我认为没有网络错误,但我不断收到

的错误
ECMDERR Failed to execute "git ls-remote --tags --heads     git://github.com/angular.bower-angular-mocks.git", exit code of #128 fatal:     unable to connect to github.com: 192.30.252.131]: errno=No such file or     directory

我可以从浏览器中的虚拟机和 运行 命令提示符中的命令到达此位置,所以我认为该位置没有特定问题。此外,尽管它在构建中的大致相同点中断(在 bower.bootstrap#3.2.0 之后),但它每次都会提供不同的 git 地址作为故障点。

我对此有点困惑。我已经重新安装了几次 bower (npm install -g bower),这似乎没有任何问题。目前我唯一能想到的是,它可能与来自 VM(VMware 工作站)的 运行ning 有关。我不想更改我的主机上的软件版本,所以我想在走这条路之前看看是否有人有任何想法。

提前致谢...

问题出在 POM 中的安装参数...

所以相关条目是

 <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.3.2</version>
            <executions>
                <execution>
                    <phase>generate-sources</phase>
                    <goals>
                        <goal>exec</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <executable>bower</executable>
                <arguments>
                    <argument>install</argument>
                </arguments>
                <workingDirectory>${basedir}</workingDirectory>
            </configuration>
        </plugin>

如果我删除参数

               <arguments>
                    <argument>install</argument>
                </arguments>

然后项目生成。也许我应该回去再看看这个。

我暂时保留这个问题,以防万一之前有人遇到过它

bowser.json

{
"name": "java-angular-seed",
"version": "0.0.0",
"authors": [
    "Mrs X"
],
"description": "A seed project",
"keywords": [
    "java",
    "maven",
    "angularjs",
    "seed"
],
"license": "Apache 2.0",
"homepage": "http://matador.com",
"private": true,
"ignore": [
    "**/.*",
    "node_modules",
    "bower_components",
    "src/main/webapp/vendor",
    "test",
    "tests"
],
"dependencies": {
    "angular-loader": "1.5.0-rc.0",
    "angular-mocks": "1.5.0-rc.0",
    "angular-route": "1.5.0-rc.0",
    "angular": "1.5.0-rc.0",
    "bootstrap": "3.2.0"
},
"main": "src/main/webapp/index.html"
}

抱歉,我找到了答案elsewhere...

git 配置 --global url."https://".insteadOf git://

"The problem was that bower tried to retrieve packages through git:// protocol, which seems to be blocked at my machine."

非常感谢您的帮助。