如何解决解压缩依赖项需要非常长时间
嗨,我有一个带有模块的专家,在intellij中使用全新安装来构建该模块时,要花很长时间才能完成构建。 这是我的pom文件
<?xml version="1.0" encoding="UTF-8"?>
<project 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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.blah.cdo.hook</groupId>
<artifactId>committerIdentityHook</artifactId>
<version>0.11-SNAPSHOT</version>
<organization>
<name>CTO - blah</name>
<url>http://www.blah.com/</url>
</organization>
<name>blah test Hook-5.16.3</name>
<description>Verify commit author’s email address against HR Feed. Functional accounts adhere to this format:
FID@blah.blah.com
</description>
<packaging>atlassian-plugin</packaging>
<dependencies>
<dependency>
<groupId>com.atlassian.sal</groupId>
<artifactId>sal-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.atlassian.bitbucket.server</groupId>
<artifactId>bitbucket-api</artifactId>
<version>${bitbucket.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.atlassian.plugins</groupId>
<artifactId>atlassian-plugins-osgi-testrunner</artifactId>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>com.atlassian.bitbucket.server</groupId>
<artifactId>bitbucket-spi</artifactId>
<version>${bitbucket.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>apache-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>oracle.jdbc</groupId>
<artifactId>ojdbc6</artifactId>
<version>12.1.0.2.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
<version>1.1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.2.2-atlassian-1</version>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>1.7.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito2</artifactId>
<version>1.7.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>1.7.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>org.jacoco.agent</artifactId>
<classifier>runtime</classifier>
<scope>test</scope>
<version>0.8.0</version>
</dependency>
<dependency>
<groupId>com.blah.cto.bbengarch</groupId>
<artifactId>AppEncryptDecrypt</artifactId>
<version>1.2</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>bitbucket-maven-plugin</artifactId>
<version>${amps.version}</version>
<extensions>true</extensions>
<configuration>
<products>
<product>
<id>bitbucket</id>
<instanceId>bitbucket</instanceId>
<version>${bitbucket.version}</version>
<dataVersion>${bitbucket.data.version}</dataVersion>
</product>
</products>
</configuration>
</plugin>
<plugin>
<groupId>com.atlassian.plugin</groupId>
<artifactId>atlassian-spring-scanner-maven-plugin</artifactId>
<version>1.2.6</version>
<executions>
<execution>
<goals>
<goal>atlassian-spring-scanner</goal>
</goals>
<phase>process-classes</phase>
</execution>
</executions>
<configuration>
<scannedDependencies>
<dependency>
<groupId>com.atlassian.plugin</groupId>
<artifactId>atlassian-spring-scanner-external-jar</artifactId>
</dependency>
</scannedDependencies>
<verbose>false</verbose>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<systemPropertyVariables>
<jacoco-agent.destfile>${project.build.directory}/jacoco/jacoco.exec</jacoco-agent.destfile>
<testEnvironment>true</testEnvironment>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.0</version>
<executions>
<execution>
<id>default-instrument</id>
<goals>
<goal>instrument</goal>
</goals>
</execution>
<execution>
<id>default-restore-instrumented-classes</id>
<goals>
<goal>restore-instrumented-classes</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<dataFile>${basedir}/target/jacoco/jacoco.exec</dataFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<properties>
<bitbucket.version>5.16.2</bitbucket.version>
<bitbucket.data.version>${bitbucket.version}</bitbucket.data.version>
<amps.version>6.2.0</amps.version>
<plugin.testrunner.version>1.2.3</plugin.testrunner.version>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<java.version>1.8</java.version>
</properties>
<scm>
<connection>https://bitbucketdc-cluster04.blah.net/scm/bbengarch/committervalidator-hook.git</connection>
<developerConnection>
scm:git:https://bitbucketdc-cluster04.blah.net/scm/bbengarch/committervalidator-hook.git
</developerConnection>
<url>https://bitbucketdc-cluster04.blah.net/scm/bbengarch/committervalidator-hook.git</url>
<tag>HEAD</tag>
</scm>
<distributionManagement>
<snapshotRepository>
<id>JULES</id>
<url>https://repo.blah.net/maven/content/repositories/BBENGARCH-SNAPSHOT/</url>
</snapshotRepository>
<repository>
<id>JULES</id>
<url>https://repo.blah.net/maven/content/repositories/BBENGARCH/</url>
</repository>
</distributionManagement>
</project>
在--- bitbucket-maven-plugin:6.2.0:copy-bundled-dependencies(default-copy-bundled-dependencies)中构建jar时,@ committerIdentityHook ---阶段花费很长时间,例如1hr- 2小时每次我更改某些内容时,如果想通过新的更改来重建jar,这对我来说都是非常困难的。 下面是需要长时间的解包依赖关系。还有一些其他的依赖关系,但是我观察到这花费了很长时间。 将c:\ FAST \ maven_repo \ v360 \ oracle \ jdbc \ ojdbc6 \ 12.1.0.2.0 \ ojdbc6-12.1.0.2.0.jar解压缩到H:\ Susmitha \ Projects \ commhookcode-nov7 \ committervalidator-hook \ commiterValidator-5.16 .3 \ target \ classs中包含“”,但不包括“ atlassian-plugin.xml,meta-inf / MANIFEST.MF,meta-inf / .DSA,meta-inf / .SF” >
请让我知道为什么要花很长时间,以及如何以简单的方式构建我的jar。
谢谢。
解决方法
我认为问题的根源在于H:
文件系统的性能。根据驱动器名称,我猜想它实际上是Windows网络共享。也就是说,当您访问H:
时,系统正在使用SMB与单独的文件服务器上的文件系统进行通话,
问题在于SMB并不是一种快速协议,尤其是在创建大量文件时。而且,当您将JAR文件解压缩到网络共享中时,将创建许多相对较小的文件。
我的建议:
-
更改构建设置,以使构建目录位于本地驱动器上。
-
如果构建仍然不够快,请考虑将构建平台更改为Linux机器……因为Linux通常比Windows具有更好的文件系统性能。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。