I am using Maven to build a HelloWorld Program. But I failed on 

```
mvn package

```

Error messages are:

```
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-    plugin:3.1:compile (default-compile) on project QuickStart: Compilation failure: Compilation failure:
[ERROR] /Users/xxx/java/QuickStart/src/main/java/hello/Greeting.java:[3,43] package org.hibernate does not exist
[ERROR] /Users/xxx/java/QuickStart/src/main/java/hello/Greeting.java:[8,9] cannot find symbol
[ERROR] symbol:  class Session 
[ERROR] location: class hello.Greeting

```

And I find that if I compile Greeting.java manually, everything will work fine, what's the reason ? Thank you.

Greeting.java is so simple:

```
package hello;

import org.hibernate.Session;

public class Greeting {

    public Greeting() {
        Session session;
    }

}

```

and my pom.xml is copied from spring.io:

```
  <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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>QuickStart</groupId>
    <artifactId>QuickStart</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <dependencies>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>5.0.7.Final</version>
        </dependency>
    </dependencies>

</project>

```