如何加快maven-deploy-plugin的速度,以将工件部署到Artifactroy?

时间:2018-08-30 08:51:56

标签: maven artifactory maven-deploy-plugin

我正在使用Maven版本3.5.4和maven-deploy-plugin版本2.8.2,将我的工件部署到Artifactory版本6.3.2

当我执行mvn deploy -DdeployAtEnd=true时,每个模块大约需要2分钟以上的时间。我有15个模块,整个过程大约需要30分钟以上。

我们有什么方法可以加快这个过程吗?

这是我的Maven信息

Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 
    2018-06-18T01:33:14+07:00)
Maven home: C:\Java.Application\Apache\apache-maven-3.5.4\bin\..
Java version: 1.8.0_181, vendor: Oracle Corporation, 
    runtime: C:\Java.Application\Sun\Java\jdk1.8.0_181\jre
Default locale: en_US, platform encoding: UTF-8
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

人工工厂artifactroy.log

2018-08-30 15:08:16,496 - Deploy to 'core-snapshot-local:/some/artifact/some/version/maven-metadata.xml.md5' Content-Length: 32
2018-08-30 15:08:19,550 - Deploy to 'core-snapshot-local:/some/artifact/maven-metadata.xml' Content-Length: 416
2018-08-30 15:08:22,677 - Deploy to 'core-snapshot-local:/some/artifact/maven-metadata.xml.sha1' Content-Length: 40
2018-08-30 15:08:25,731 - Deploy to 'core-snapshot-local:/some/artifact/maven-metadata.xml.md5' Content-Length: 32
2018-08-30 15:08:28,800 - Deploy to 'core-snapshot-local:/some/artifact/some/version/my-artifact-1.0.2-20180830.080748-7-javadoc.jar' Content-Length: 110853
2018-08-30 15:08:32,016 - Deploy to 'core-snapshot-local:/some/artifact/some/version/my-artifact-1.0.2-20180830.080748-7-javadoc.jar.sha1' Content-Length: 40
2018-08-30 15:08:35,100 - Deploy to 'core-snapshot-local:/some/artifact/some/version/my-artifact-1.0.2-20180830.080748-7-javadoc.jar.md5' Content-Length: 32
2018-08-30 15:08:38,182 - Deploy to 'core-snapshot-local:/some/artifact/some/version/maven-metadata.xml' Content-Length: 1868
2018-08-30 15:08:41,413 - Deploy to 'core-snapshot-local:/some/artifact/some/version/maven-metadata.xml.sha1' Content-Length: 40
2018-08-30 15:08:42,249 - Indexing archive: core-snapshot-local:/some/artifact/some/version/my-artifact-1.0.2-20180830.080748-7.jar
2018-08-30 15:08:42,336 - Indexing archive: core-snapshot-local:/some/artifact/some/version/my-artifact-1.0.2-20180830.080748-7-javadoc.jar
2018-08-30 15:08:44,462 - Deploy to 'core-snapshot-local:/some/artifact/some/version/maven-metadata.xml.md5' Content-Length: 32
2018-08-30 15:08:47,520 - Deploy to 'core-snapshot-local:/some/artifact/some/version/my-artifact-1.0.2-20180830.080748-7-test-javadoc.jar' Content-Length: 221096
2018-08-30 15:08:50,731 - Deploy to 'core-snapshot-local:/some/artifact/some/version/my-artifact-1.0.2-20180830.080748-7-test-javadoc.jar.sha1' Content-Length: 40
2018-08-30 15:08:53,816 - Deploy to 'core-snapshot-local:/some/artifact/some/version/my-artifact-1.0.2-20180830.080748-7-test-javadoc.jar.md5' Content-Length: 32
2018-08-30 15:08:56,912 - Deploy to 'core-snapshot-local:/some/artifact/some/version/maven-metadata.xml' Content-Length: 1868
2018-08-30 15:08:59,973 - Deploy to 'core-snapshot-local:/some/artifact/some/version/maven-metadata.xml.sha1' Content-Length: 40
2018-08-30 15:09:03,027 - Deploy to 'core-snapshot-local:/some/artifact/some/version/maven-metadata.xml.md5' Content-Length: 32
2018-08-30 15:09:06,084 - Deploy to 'core-snapshot-local:/some/artifact/some/version/my-artifact-1.0.2-20180830.080748-7-sources.jar' Content-Length: 19103
2018-08-30 15:09:09,293 - Deploy to 'core-snapshot-local:/some/artifact/some/version/my-artifact-1.0.2-20180830.080748-7-sources.jar.sha1' Content-Length: 40
2018-08-30 15:09:12,886 - Deploy to 'core-snapshot-local:/some/artifact/some/version/my-artifact-1.0.2-20180830.080748-7-sources.jar.md5' Content-Length: 32
2018-08-30 15:09:16,032 - Deploy to 'core-snapshot-local:/some/artifact/some/version/maven-metadata.xml' Content-Length: 1868
2018-08-30 15:09:19,086 - Deploy to 'core-snapshot-local:/some/artifact/some/version/maven-metadata.xml.sha1' Content-Length: 40
2018-08-30 15:09:22,136 - Deploy to 'core-snapshot-local:/some/artifact/some/version/maven-metadata.xml.md5' Content-Length: 32
2018-08-30 15:09:25,196 - Deploy to 'core-snapshot-local:/some/artifact/some/version/my-artifact-1.0.2-20180830.080748-7-test-sources.jar' Content-Length: 66693
2018-08-30 15:09:28,455 - Deploy to 'core-snapshot-local:/some/artifact/some/version/my-artifact-1.0.2-20180830.080748-7-test-sources.jar.sha1' Content-Length: 40
2018-08-30 15:09:31,573 - Deploy to 'core-snapshot-local:/some/artifact/some/version/my-artifact-1.0.2-20180830.080748-7-test-sources.jar.md5' Content-Length: 32
2018-08-30 15:09:34,665 - Deploy to 'core-snapshot-local:/some/artifact/some/version/maven-metadata.xml' Content-Length: 1868
2018-08-30 15:09:37,717 - Deploy to 'core-snapshot-local:/some/artifact/some/version/maven-metadata.xml.sha1' Content-Length: 40
2018-08-30 15:09:40,771 - Deploy to 'core-snapshot-local:/some/artifact/some/version/maven-metadata.xml.md5' Content-Length: 32
2018-08-30 15:09:42,250 - Indexing archive: core-snapshot-local:/some/artifact/some/version/my-artifact-1.0.2-20180830.080748-7-test-javadoc.jar
2018-08-30 15:09:42,499 - Indexing archive: core-snapshot-local:/some/artifact/some/version/my-artifact-1.0.2-20180830.080748-7-sources.jar
2018-08-30 15:09:42,565 - Indexing archive: core-snapshot-local:/some/artifact/some/version/my-artifact-1.0.2-20180830.080748-7-test-sources.jar
2018-08-30 15:09:43,832 - Deploy to 'core-snapshot-local:/some/artifact/some/version/my-artifact-1.0.2-20180830.080748-7-tests.jar' Content-Length: 60117
2018-08-30 15:09:47,060 - Deploy to 'core-snapshot-local:/some/artifact/some/version/my-artifact-1.0.2-20180830.080748-7-tests.jar.sha1' Content-Length: 40
2018-08-30 15:09:50,309 - Deploy to 'core-snapshot-local:/some/artifact/some/version/my-artifact-1.0.2-20180830.080748-7-tests.jar.md5' Content-Length: 32
2018-08-30 15:09:53,402 - Deploy to 'core-snapshot-local:/some/artifact/some/version/maven-metadata.xml' Content-Length: 1868
2018-08-30 15:09:56,458 - Deploy to 'core-snapshot-local:/some/artifact/some/version/maven-metadata.xml.sha1' Content-Length: 40
2018-08-30 15:09:59,509 - Deploy to 'core-snapshot-local:/some/artifact/some/version/maven-metadata.xml.md5' Content-Length: 32

人工工厂access.log

2018-08-30 15:07:48,401 [ACCEPTED DOWNLOAD] core-snapshot-local:/some/artifact/some/version/maven-metadata.xml for some-user/some-ip.
2018-08-30 15:07:48,456 [ACCEPTED DOWNLOAD] core-snapshot-local:/some/artifact/some/version/maven-metadata.xml.sha1 for some-user/some-ip.
2018-08-30 15:07:51,641 [ACCEPTED DEPLOY] core-snapshot-local:/some/artifact/some/version/maven-metadata.xml for some-user/some-ip.
2018-08-30 15:07:51,642 [ACCEPTED DEPLOY] core-snapshot-local:/some/artifact/some/version/my-artifact-1.0.2-20180830.080748-7.jar for some-user/some-ip.
2018-08-30 15:08:00,997 [ACCEPTED DEPLOY] core-snapshot-local:/some/artifact/some/version/maven-metadata.xml for some-user/some-ip.
2018-08-30 15:08:00,997 [ACCEPTED DEPLOY] core-snapshot-local:/some/artifact/some/version/my-artifact-1.0.2-20180830.080748-7.pom for some-user/some-ip.
2018-08-30 15:08:01,079 [ACCEPTED DEPLOY] core-snapshot-local:/some/artifact/maven-metadata.xml for some-user/some-ip.
2018-08-30 15:08:07,271 [ACCEPTED DOWNLOAD] core-snapshot-local:/some/artifact/maven-metadata.xml for some-user/some-ip.
2018-08-30 15:08:07,328 [ACCEPTED DOWNLOAD] core-snapshot-local:/some/artifact/maven-metadata.xml.sha1 for some-user/some-ip.
2018-08-30 15:08:19,594 [ACCEPTED DEPLOY] core-snapshot-local:/some/artifact/maven-metadata.xml for some-user/some-ip.
2018-08-30 15:08:28,919 [ACCEPTED DEPLOY] core-snapshot-local:/some/artifact/some/version/maven-metadata.xml for some-user/some-ip.
2018-08-30 15:08:28,920 [ACCEPTED DEPLOY] core-snapshot-local:/some/artifact/some/version/my-artifact-1.0.2-20180830.080748-7-javadoc.jar for some-user/some-ip.
2018-08-30 15:08:47,637 [ACCEPTED DEPLOY] core-snapshot-local:/some/artifact/some/version/maven-metadata.xml for some-user/some-ip.
2018-08-30 15:08:47,639 [ACCEPTED DEPLOY] core-snapshot-local:/some/artifact/some/version/my-artifact-1.0.2-20180830.080748-7-test-javadoc.jar for some-user/some-ip.
2018-08-30 15:09:06,192 [ACCEPTED DEPLOY] core-snapshot-local:/some/artifact/some/version/maven-metadata.xml for some-user/some-ip.
2018-08-30 15:09:06,193 [ACCEPTED DEPLOY] core-snapshot-local:/some/artifact/some/version/my-artifact-1.0.2-20180830.080748-7-sources.jar for some-user/some-ip.
2018-08-30 15:09:25,295 [ACCEPTED DEPLOY] core-snapshot-local:/some/artifact/some/version/maven-metadata.xml for some-user/some-ip.
2018-08-30 15:09:25,297 [ACCEPTED DEPLOY] core-snapshot-local:/some/artifact/some/version/my-artifact-1.0.2-20180830.080748-7-test-sources.jar for some-user/some-ip.
2018-08-30 15:09:43,950 [ACCEPTED DEPLOY] core-snapshot-local:/some/artifact/some/version/maven-metadata.xml for some-user/some-ip.
2018-08-30 15:09:43,951 [ACCEPTED DEPLOY] core-snapshot-local:/some/artifact/some/version/my-artifact-1.0.2-20180830.080748-7-tests.jar for some-user/some-ip.

修改1

以前,我发现了一些有关Maven 3.5.2 here的问题,这些问题使我对Maven 3.3.93.5.xwagon之间的区别有了一些了解。版本。

  • Maven 3.3.9使用旅行车版本2.10
  • Maven 3.5.4使用旅行车版本3.1.0

同样,我将maven_home/lib从Maven 3.3.9复制到Maven 3.5.4。一切恢复很快,总共2-3分钟。

我也有机会将maven_home/lib从Maven 3.5.4复制到Maven 3.3.9。这个过程又慢了。

编辑2

即使使用wagon版本2.10作为临时解决方案似乎可行,我也愿意与Maven 3.5.4一起使用正确的方法,并希望您能有所启发。 / p>

1 个答案:

答案 0 :(得分:0)

由于wagon版本2.10似乎更好,因此临时解决方案是在我的pom.xml上将这些旅行车添加为扩展,如下所示:-

<properties>
    <my.wagon.vesion>2.10</my.wagon.vesion>
</properties>

<build>
    <extensions>
        <extension>
            <groupId>org.apache.maven.wagon</groupId>
            <artifactId>wagon-file</artifactId>
            <version>${my.wagon.vesion}</version>
        </extension>
        <extension>
            <groupId>org.apache.maven.wagon</groupId>
            <artifactId>wagon-http-shared</artifactId>
            <version>${my.wagon.vesion}</version>
        </extension>
        <extension>
            <groupId>org.apache.maven.wagon</groupId>
            <artifactId>wagon-http</artifactId>
            <version>${my.wagon.vesion}</version>
        </extension>
        <extension>
            <groupId>org.apache.maven.wagon</groupId>
            <artifactId>wagon-provider-api</artifactId>
            <version>${my.wagon.vesion}</version>
        </extension>
    </extensions>
</build>