Reputation: 90
Hi I have a maven with a module and while building that module using clean install in intellij it is taking very very long time to complete the build. here is my pom file
<?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:
[email protected]
</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>
While building the jar in --- bitbucket-maven-plugin:6.2.0:copy-bundled-dependencies (default-copy-bundled-dependencies) @ committerIdentityHook --- phase It is taking very long time like 1hr -2hrs. Everytime i change something if want to rebuild the jar with new changes it is becoming very tough for me. Below are the unpacking dependencies which are taking long time.there are few more as well but i observed this is taking long time. Unpacking c:\FAST\maven_repo\v360\oracle\jdbc\ojdbc6\12.1.0.2.0\ojdbc6-12.1.0.2.0.jar to H:\Susmitha\Projects\commhookcode-nov7\committervalidator-hook\commiterValidator-5.16.3\target\classes with includes "" and excludes "atlassian-plugin.xml,META-INF/MANIFEST.MF,META-INF/.DSA,META-INF/.SF"
Please let me know why it is taking long time and how to build my jar in easy way.
Thank you.
Upvotes: 0
Views: 373
Reputation: 719386
I think the root of your problem is the performance of your H:
file system. Based on the drive name, I am guessing that it is actually a Windows network share; i.e. when you access H:
your system is using SMB to talk to a file system on a separate file server,
The problem is that SMB is not a fast protocol, particularly when you are creating lots of files. And when you unpack a JAR file into a network share, you will be creating lots of relatively small files.
My advice:
Change your build setup so that the build directory is on a local drive.
If builds are still not fast enough, consider changing your build platform to a Linux machine ... because Linux generally has better file system performance than Windows.
Upvotes: 2