My Maven installation recently started taking a very long time to compile projects. A project with a single source file takes almost 4 minutes to compile on my system, when I was able to previously build projects with over 100 source files in less than two minutes. I'm not sure what I've done to cause this issue. My only theory so far is that it concerns the local.repository directory Maven seems to use during the build process, as I mistakenly deleted this folder (?) on account of the fact that it appeared empty and useless.
My attempts to remedy the issue so far have included upgrading my Maven build to 3.1, restarting my machine, deleting the maven cache `(~/.m2/) and increasing the amount of memory available to Maven as described in here.
The output of my build:
[INFO] ------------------------------------------------------------------------
[INFO] Building my-app 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ my-app ---
[INFO] Deleting /Users/alexwood/Software_Development/Projects/Maven Tutorial/my-app/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ my-app ---
[WARNING] Using platform encoding (MacRoman actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Users/alexwood/Software_Development/Projects/Maven Tutorial/my-app/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ my-app ---
[WARNING] File encoding has not been set, using platform encoding MacRoman, i.e. build is platform dependent!
[INFO] Compiling 1 source file to /Users/alexwood/Software_Development/Projects/Maven Tutorial/my-app/target/classes
My Maven version information:
Apache Maven 3.1.0 (893ca28a1da9d5f51ac03827af98bb730128f9f2; 2013-06-27 19:15:32-0700)
Maven home: /usr/local/Cellar/maven/3.1.0/libexec
Java version: 1.6.0_51, vendor: Apple Inc.
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x", version: "10.8.4", arch: "x86_64", family: "mac"
The pom.xml file I'm using:
<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.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>my-app</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
Any help would be much appreciated. If I can provide any further clarification, please let me know.
mvn compileor some other lifecycle?mvn clean install, butmvn compilealone seems to have the same problem.mvn -X clean install. Perhaps you'll get some more information.