TU Wien:Software Engineering und Projektmanagement PR (Biffl)/Getting started with Intellij

Aus VoWi
Zur Navigation springen Zur Suche springen

Since the SEPM team doesn't feel like providing a guide on how to do development like a normal person, it's time to whip out a popular Thanos quote: Fine, I'll do it myself

Getting Started[Bearbeiten | Quelltext bearbeiten]

  1. Open the backend folder in Intellij. Make sure that your file path is nice and simple and doesn't have any special characters. Not even spaces are supported. This tutorial is using the new UI, but you should be able to adapt this to the old UI.
  2. Wait for Maven to slowly do its stuff.
  3. Open the SepmIndividualAssignmentApplication.java. Make sure that the java folder up there is marked in blue (sources root), that way Intellij knows it's where the source code goes. Then, click on the green button to start it. You'll only press this button this one time. After that, you can always press on the stuff in the top bar.

    (This screenshot is using the old UI, thus giving us a perfectly balanced situation)
  4. It should be running with the "default" profile and is available. For example, visiting http://localhost:8080/horses will return an empty array. Try sending a GET request to that URL using a REST client like Insomnia.
  5. Configuration time! We want our "datagen" profile! Stop it by pressing on that red square. (Definitely not a useless arrow)
  6. Press the 3 buttons to edit the configuration. We're going to tweak it so that we automatically run the cute data generator whenever we start it.


    (With the old interface)
  7. "Modify options" and then press on "Add VM options".
  8. Put -Dspring.profiles.active=datagen right there and save it. Just press the Apply button at the bottom.


    (Depending on the theme, setting the "VM options" can look quite different.)
  9. And now, when you hit Run, the "datagen" profile will be used and the http://localhost:8080/horses endpoint will politely return something! (I recommend using Insomnia, Postman, or Firefox to check it out. Or Chrome, if one really wants.)

Other Maven Commands[Bearbeiten | Quelltext bearbeiten]

  1. Wait, what about all the other mvn commands? Well, you can press those Maven buttons at the right side of Intellij.
  2. And now you can type in whatever maven commands you need. No need to go out of your way to install maven or any of that boring stuff.