Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为什么ant使用maven ant任务,工件:mvn下载依赖项jar的速度如此之慢_Maven_Ant_Maven Ant Tasks - Fatal编程技术网

为什么ant使用maven ant任务,工件:mvn下载依赖项jar的速度如此之慢

为什么ant使用maven ant任务,工件:mvn下载依赖项jar的速度如此之慢,maven,ant,maven-ant-tasks,Maven,Ant,Maven Ant Tasks,看照片,我有一个名为“brandstore repository.jar”的罐子 在我的localRepository中,我将其删除 和工件:mvn将在专用服务器上下载(10.8.12.100) 当我使用cmd时,使用“mvn install”命令,下载速度非常快 但是我在ant building.xml中使用了“artifact:mvn”,我觉得速度比较慢,每次下载都需要等待10秒以上 我在“${user.home}/.m2”中的setting.xml非常简单 <settings xm

看照片,我有一个名为“brandstore repository.jar”的罐子

在我的localRepository中,我将其删除

和工件:mvn将在专用服务器上下载(10.8.12.100)

当我使用cmd时,使用“mvn install”命令,下载速度非常快

但是我在ant building.xml中使用了“artifact:mvn”,我觉得速度比较慢,每次下载都需要等待10秒以上

我在“${user.home}/.m2”中的setting.xml非常简单

<settings xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">

    <localRepository>D:\FeiLong Soft\Essential\Development\repository</localRepository>

    <profiles>
        <profile>
            <id>profile-baozun</id>
            <repositories>
                <repository>
                    <id>public</id>
                    <url>http://10.8.12.100/nexus/content/groups/public</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
            </repositories>
        </profile>
    </profiles>

    <activeProfiles>
        <activeProfile>profile-baozun</activeProfile>
    </activeProfiles>
</settings>
很快

我明白了,我只使用工件:依赖项,也可以下载依赖项jar,而且速度更快

<target name="maven-test">
    <artifact:pom id="feilongMaven" file="pom.xml" />

    <artifact:dependencies filesetId="feilong.maven.dependencies.fileset" pathid="feilong.maven.dependencies.runtime" useScope="runtime">
        <pom refid="feilongMaven" />
    </artifact:dependencies>
</target>

没有更多细节,比如settings.xml和确切的命令行,我只能猜测,但一个可能的原因是在这些情况下使用不同的基础结构

例如:

  • 当调用Maven时,将使用您的公司代理(nexus或其他什么)
  • 调用Ant时,会使用其他代理(或无代理),导致传输速度变慢

确保始终使用相同的
settings.xml
以及
,这将有助于保持传输路径的一致性。

没有更多详细信息,如settings.xml和确切的命令行,我只能猜测,但一个可能的原因是在这些情况下使用不同的基础结构

例如:

  • 当调用Maven时,将使用您的公司代理(nexus或其他什么)
  • 调用Ant时,会使用其他代理(或无代理),导致传输速度变慢

确保始终使用相同的
设置.xml
以及
,这将有助于确保传输路径的一致性。

我也遇到过工件下载速度慢的问题。我使用的是maven-ant-tasks-2.1.3.jar。我假设您的“工件:mvn”与maven ant任务相关联。也许这不是您想要的,但我通过将artifact:mvn更改为exec:

<exec executable="C:/apache-maven-3.0.3/bin/mvn.bat" dir="my-project">
     <arg value="clean" />
     <arg value="install" />
</exec>

我也有同样的问题,即工件下载速度慢。我使用的是maven-ant-tasks-2.1.3.jar。我假设您的“工件:mvn”与maven ant任务相关联。也许这不是您想要的,但我通过将artifact:mvn更改为exec:

<exec executable="C:/apache-maven-3.0.3/bin/mvn.bat" dir="my-project">
     <arg value="clean" />
     <arg value="install" />
</exec>


谢谢你的回答,我完善了我的问题谢谢你的回答,我完善了我的问题
<exec executable="C:/apache-maven-3.0.3/bin/mvn.bat" dir="my-project">
     <arg value="clean" />
     <arg value="install" />
</exec>