Maven compile successful, but install failed
compiler-errors, java, java-7, maven-3
Solution
If you take a look at the Maven Build Lifecycle, you will notice that `test-compile` phase goes after `compile`, but before `install`.
Since the file which fails to compile is `mainTest.java`, looks like this is your problem:
Doesn't `mvn compile` actually compile everything?
No, it doesn't compile test sources.
Problem
I am using `maven 3.2.2` and `jdk-1.7.0_60`. I am executing `mvn compile` for a particular project, the compilation succeeds. But when I run `mvn clean install` on the same component, I get the following error- ``` [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /C:/projects/myProject/src/mainTest.java:[105,56] cannot find symbol symbol: method getIdFromName(java.lang.String) location: class java.lang.Object ``` What could be the reason behind this? Doesn't `mvn compile` actually compile everything? As far as I know, the only difference between `mvn compile` and `mvn clean install` is that the latter command copies the required jar.