Your app is ready!

This is a template for a web application that uses Spring MVC and Hibernate. The sample code is a simple CRUD page that manipulates records for a single model object. To try it out go to the people page. Then use Eclipse or the Command Line to deploy some changes.

Using Eclipse 3.7:

Step 1. Setup your environment

  1. Ensure EGit is installed.
  2. Ensure the Maven Eclipse Plugin is installed.
  3. Create an SSH key if you haven't already:
    1. Go to Window Preferences General Network Connections SSH2
    2. Choose the Key Management tab
    3. Click Generate RSA Key... SSH Eclipse Preferences Window
    4. Copy the generated public key in the text box and add it to your account
    5. Click Save Private Key..., accepting the defaults
    6. Click Ok

Step 2. Clone the App

  1. Go to File Import... Git Projects from Git Import
  2. Choose URI and click Next
  3. Enter git@heroku.com:.git in the URI field. Clone Git Repository
  4. Click Next three times
    Click Yes to the question of authenticity if the question appears.
  5. Choose Import as general project Import Projects from Git
  6. Click Finish

Step 3. Configure the App

  1. Right-click the project root
  2. Choose Configure Convert to Maven Project

Step 4. Makes some changes to the app

  1. Open PersonServiceImpl.java
  2. Query the people in alphabetical order by replacing line 29 with the following two lines:
    Root<Person> from = c.from(Person.class);
    c.orderBy(em.getCriteriaBuilder().asc(from.get("lastName")));
                    

Step 5. Deploy to Heroku

  1. Right-click the project root and choose Team Commit
  2. Enter a commit message and click Commit Commit Changes
  3. Right-click the project root and choose Team Push to Upstream
  4. Review the push results. At the bottom, a "... deployed to Heroku" message will appear. Push Results

Done!

You've just cloned, modified, and deployed a brand new app.

See your changes

Learn more at the Heroku Dev Center

Using Command Line:

Step 1. Setup your environment

  1. Install the Heroku Toolbelt.
  2. Install Maven.

Step 2. Login to Heroku

heroku login
Be sure to create, or associate an SSH key with your account.
$ heroku login
Enter your Heroku credentials.
Email: naaman@heroku.com
Password:
Could not find an existing public key.
Would you like to generate one? [Yn] Y
Generating new SSH public key.
Uploading SSH public key /Users/Administrator/.ssh/id_rsa.pub
Authentication successful.

Step 3. Clone the App

git clone -o heroku git@heroku.com:.git

Step 4. Makes some changes to the app

  1. Open src/main/java/com/example/PersonServiceImpl.java in your favorite editor
  2. Query the people in alphabetical order by replacing line 29 with the following two lines:
    Root<Person> from = c.from(Person.class);
    c.orderBy(em.getCriteriaBuilder().asc(from.get("lastName")));
                    

Step 5. Make sure the app still compiles

mvn clean package

Step 6. Deploy your changes

  1. git commit -am "New changes to deploy"
  2. git push heroku master

Done!

You've just cloned, modified, and deployed a brand new app.

See your changes

Learn more at the Heroku Dev Center