Overview

Skill Level: Beginner

Learn how to develop, test, and run a simple Spring Cloud Task using Eclipse on your machine.

Ingredients

Install the following on your machine:

Step-by-step

  1. Create a new "Spring starter Project"

     

    recipe01-step01-0001

     

    recipe01-step01-0002-1

     

    recipe01-step01-0003

     

    recipe01-step01-0004

     

  2. Edit the java application file

     

    recipe01-step02-0001

     

     

  3. [Optional] Run the task as a "Spring Boot App"

    recipe01-step03-0001

     

    Observe the “I am the simple Spring Boot Task” message printed in the console:

     

    recipe01-step03-0002

  4. [Optional] Build the project using Mavin

     

    recipe01-step04-0001

     

     

    NOTE: You will need to type the goal name as “package” and delete “pom.xml” to leave the “Profiles” field empty before you hit the “Run” button.

     

    recipe01-step04-0002

     

    Observe the console to see that the “target/MySimpleTask-0.0.1-SNAPSHOT.jar” was successfully created with no errors.

    recipe01-step04-0003

  5. [Optional] Update the test case by adding your own test logic

     

    recipe01-step05-0001

     

    recipe01-step05-0002

     

     

    Observe the success of the execution of the test case in the console:

     

    recipe01-step05-0003

  6. [Optional] Run the application from command line

     

    NOTES:

    • You must perform step 4 before you can perform this step.
      This step is run from the command line (not within Eclipse) and is equivalent to step 3 (which is done in Eclipse).

    Observe the “I am the simple Spring Boot Task” message printed in the terminal:

    recipe01-step06-0001-1

1 comment on"Develop a Spring Cloud Task using Eclipse"

  1. Ahmed_Abbas May 27, 2020

    You are welcome to connect with the author on LinkedIn: https://www.linkedin.com/in/-ahmed-abbas-/

Join The Discussion